Skip to content

Commit

Permalink
Merge pull request #1695 from guwirth/sq77
Browse files Browse the repository at this point in the history
test SQ7.7
  • Loading branch information
guwirth authored Mar 26, 2019
2 parents a3e16ef + a00c56d commit 8e16538
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 28 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:
- SONARLABEL=sonarqube-7.4 SONARAPI=SqApi67
- SONARLABEL=sonarqube-7.5 SONARAPI=SqApi75
- SONARLABEL=sonarqube-7.6 SONARAPI=SqApi76
- SONARLABEL=sonarqube-7.7 SONARAPI=SqApi76

matrix:
fast_finish: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ private void save(Collection<SourceCode> squidSourceFiles, SensorContext context

private void saveMeasures(InputFile inputFile, SourceFile squidFile, SensorContext context) {
// CORE METRICS
context.<Integer>newMeasure().forMetric(CoreMetrics.FILES).on(inputFile)
.withValue(squidFile.getInt(CxxMetric.FILES)).save();
context.<Integer>newMeasure().forMetric(CoreMetrics.NCLOC).on(inputFile)
.withValue(squidFile.getInt(CxxMetric.LINES_OF_CODE)).save();
context.<Integer>newMeasure().forMetric(CoreMetrics.STATEMENTS).on(inputFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public void testCollectingSquidMetrics() throws IOException {
sensor.execute(context);

SoftAssertions softly = new SoftAssertions();
softly.assertThat(context.measure(inputFile0.key(), CoreMetrics.FILES).value()).isEqualTo(1);
softly.assertThat(context.measure(inputFile0.key(), CoreMetrics.NCLOC).value()).isEqualTo(54);
softly.assertThat(context.measure(inputFile0.key(), CoreMetrics.STATEMENTS).value()).isEqualTo(50);
softly.assertThat(context.measure(inputFile0.key(), CoreMetrics.FUNCTIONS).value()).isEqualTo(7);
Expand All @@ -106,7 +105,6 @@ public void testComplexitySquidMetrics() throws IOException {
sensor.execute(context);

SoftAssertions softly = new SoftAssertions();
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.FILES).value()).isEqualTo(1);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.FUNCTIONS).value()).isEqualTo(22);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.CLASSES).value()).isEqualTo(2);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.COMPLEXITY).value()).isEqualTo(38);
Expand Down Expand Up @@ -175,7 +173,6 @@ public void testReplacingOfExtenalMacros() throws IOException {
sensor.execute(context);

SoftAssertions softly = new SoftAssertions();
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.FILES).value()).isEqualTo(1);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.NCLOC).value()).isEqualTo(1);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.STATEMENTS).value()).isEqualTo(0);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.FUNCTIONS).value()).isEqualTo(0);
Expand All @@ -194,7 +191,6 @@ public void testFindingIncludedFiles() throws IOException {
sensor.execute(context);

SoftAssertions softly = new SoftAssertions();
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.FILES).value()).isEqualTo(1);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.NCLOC).value()).isEqualTo(9);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.STATEMENTS).value()).isEqualTo(0);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.FUNCTIONS).value()).isEqualTo(9);
Expand All @@ -218,7 +214,6 @@ public void testForceIncludedFiles() throws IOException {

// These checks actually check the force include feature, since only if it works the metric values will be like follows
SoftAssertions softly = new SoftAssertions();
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.FILES).value()).isEqualTo(1);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.NCLOC).value()).isEqualTo(1);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.STATEMENTS).value()).isEqualTo(2);
softly.assertThat(context.measure(inputFile.key(), CoreMetrics.FUNCTIONS).value()).isEqualTo(1);
Expand Down
1 change: 0 additions & 1 deletion integration-tests/features/multimodule_analysis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Feature: cpp-multimodule-project
| statements | 36 |
| classes | 1 |
| files | 8 |
| directories | 4 |
| functions | 5 |
| comment_lines_density | 30 |
| comment_lines | 24 |
Expand Down
3 changes: 0 additions & 3 deletions integration-tests/features/smoketest.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Feature: Smoketest
| statements | 36 |
| classes | 1 |
| files | 8 |
| directories | 4 |
| functions | 5 |
| comment_lines_density | 30 |
| comment_lines | 24 |
Expand Down Expand Up @@ -65,7 +64,6 @@ Feature: Smoketest
| statements | 36 |
| classes | 1 |
| files | 8 |
| directories | 4 |
| functions | 5 |
| comment_lines_density | 30 |
| comment_lines | 24 |
Expand Down Expand Up @@ -105,7 +103,6 @@ Feature: Smoketest
| statements | 36 |
| classes | 1 |
| files | 8 |
| directories | 5 |
| functions | 5 |
| comment_lines_density | 30 |
| comment_lines | 24 |
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/features/steps/test_execution_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,10 @@ def _run_command(context, command):
)
proc.communicate()

# print log file result for debugging
#if proc.returncode != 0:
# with open(context.log, "r") as log:
# print(RED + log.read() + RESET_ALL)

context.rc = proc.returncode

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Feature: GoogleTestWithBullseyeAndVsProject
| statements | 7 |
| classes | 1 |
| files | 2 |
| directories | 1 |
| functions | 3 |
| comment_lines_density | 0 |
| duplicated_lines_density | 0 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include "targetver.h"
#include "targetver.hh"

//#include <stdio.h>
//#include <tchar.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

#ifdef _WIN32
#include <SDKDDKVer.h>
#include <SDKDDKVer.hh>
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.hh"

#define BOOST_TEST_MODULE my_module
#include <boost/test/unit_test.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.hh"

#define BOOST_TEST_MODULE my_module
#include <boost/test/unit_test.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.hh"

#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.hh"

#define BOOST_TEST_MODULE my_module
#include <boost/test/unit_test.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.hh"

#define BOOST_TEST_MODULE my_module
#include <boost/test/unit_test.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <googletest/gtest/gtest.h>

#include "..\PathHandling\PathHandle.h"
#include "..\PathHandling\PathHandle.hpp"

class PathHandlingTest : public ::testing::Test
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "PathHandle.h"
#include "PathHandle.hpp"


PathHandle::PathHandle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="PathHandle.h" />
<ClInclude Include="PathHandle.hpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="PathHandle.cpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ sonar.doxygen.enable=true
# c# settings
sonar.visualstudio.enable=false
sonar.sourceEncoding=UTF-8
sonar.sources=.
sonar.tests=.
sonar.sources=PathHandling
sonar.tests=PathHandling.Test

# c++ properties
sonar.language=c++
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<results>
<error file="./PathHandling/PathHandle.h" line="0" id="cpplint_legal_copyright_0" severity="warning" msg="No copyright message found. You should have a line: Copyright [year] &lt;Copyright Owner&gt;"/>
<error file="./PathHandling/PathHandle.h" line="0" id="cpplint_build_header_guard_0" severity="warning" msg="No #ifndef header guard found, suggested CPP variable is: INTEGRATION_TESTS_TESTDATA_GOOGLETEST_BULLSEYE_VS_PROJECT_PATHHANDLING_PATHHANDLE_H_"/>
<error file="./PathHandling/PathHandle.h" line="8" id="cpplint_whitespace_indent_2" severity="warning" msg="public: should be indented +1 space inside class PathHandle"/>
<error file="./PathHandling/PathHandle.hpp" line="0" id="cpplint_legal_copyright_0" severity="warning" msg="No copyright message found. You should have a line: Copyright [year] &lt;Copyright Owner&gt;"/>
<error file="./PathHandling/PathHandle.hpp" line="0" id="cpplint_build_header_guard_0" severity="warning" msg="No #ifndef header guard found, suggested CPP variable is: INTEGRATION_TESTS_TESTDATA_GOOGLETEST_BULLSEYE_VS_PROJECT_PATHHANDLING_PATHHANDLE_H_"/>
<error file="./PathHandling/PathHandle.hpp" line="8" id="cpplint_whitespace_indent_2" severity="warning" msg="public: should be indented +1 space inside class PathHandle"/>
</results>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="5.0">
<file name="./PathHandling\PathHandle.h">
<file name="./PathHandling\PathHandle.hpp">
<error line="1" severity="warning" message="no copyright notice found" source="T013"/>
<error line="14" severity="warning" message="trailing empty line(s" source="L003"/>
</file>
Expand Down

0 comments on commit 8e16538

Please sign in to comment.