-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration/boosttest #387
Conversation
guwirth
commented
Jan 15, 2015
- add initial files to setup an integration test for boost and boost unit tests
- currently only files without build & check
|
Would you consider moving the integration test data into a sub module? On Fri, Jan 16, 2015, 19:39 Waleri Enns [email protected] wrote:
|
;-> that's boost. Boost test framework is on top of boost. I already removed a lot of directories. Next step would be to cleanup within the directories. Problem I see is that this is a lot of work each time we upgrade to a new boost version. Will try to find out touched files with sysinternal tools... |
How about installing it via
|
I dont think its necessary, at least at this point of time. I think we can manage the problem otherwise. |
Will try with sudo. Do you know to which location boost will be installed? Are there afterwards environment variables I can use? Someone experience with all that stuff? |
Just to be clear: this command line would work on Ubuntu and Debian derivates and looks differently with other package managers. My point is just that: you can install boost test on the system, just like e.g. cppcheck. I.e.:
As for locations of the libs and headers etc.: on Linux they just land in standard locations (headers in /usr/include, libs in /usr/lib) and it just works. To make building work cross platform, one can just keep (and change, if necessary) in constants inside of build files. |
@wenns : would like to write the tests now.
|
Please add new scenarios to the test_execution_statistics.feature. Your test cases are the same feature, after all. Behave's execution procedure is like so:
|
@wenns tried to add a first test to test_execution_statistics.feature but it's not executed. See nothing in the log file on the Travis server. Do you have any idea? |
|
||
|
||
before_install: | ||
- sudo apt-get install libboost-dev libboost-test-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not work on windows. or on any non deb base system... isnt there a better way of handling these...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .travis.yml will be executed on a Travis VM, which is garanteed to be a debian derivate ;)
Having said this, the line is not actually needed, as the behave will only run 'sonar-runner' against checked in reports, no?
The boost header, libs, etc. are needed only for developing the tests, i.e. on your workstation. Not on the CI slave.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, did not notice that was in the yaml file.. Good as it is :)
On Wed, Jan 21, 2015, 21:17 Waleri Enns [email protected] wrote:
In .travis.yml
#387 (comment):@@ -4,7 +4,10 @@ jdk:
- oraclejdk8
- openjdk7
+before_install:
- sudo apt-get install libboost-dev libboost-test-dev
The .travis.yml will be executed on a Travis VM, which is garanteed to be
a debian derivate ;)
Having said this, the line is not actually needed, as the behave will only
run 'sonar-runner' against checked in reports, no?
The boost header, libs, etc. are needed only for developing the tests,
i.e. on your workstation. Not on the CI slave.So not probs here
wont be executed on Windows
—
Reply to this email directly or view it on GitHub
https://github.com/wenns/sonar-cxx/pull/387/files#r23325522.
@jmecosta: there is also the possibility
@wenns, @jmecosta: |
:-< copied from the wrong example: 'Scenario: googletest report is invalid' is also wrong
Still not sure about that. Like to test AST based approach for this I need the header files otherwise unit tests can't be parsed in the right way? |
Ahh. Damn. You're right!
[Had a look into the test files] Oh yes, looks like... |
|
@@ -124,7 +125,18 @@ public SourceCode createSourceCode(SourceCode parentSourceCode, AstNode astNode) | |||
sb.append(token.getValue()); | |||
} | |||
String functionName = sb.toString(); | |||
SourceFunction function = new SourceFunction(functionName + ":" + astNode.getToken().getLine()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is creating the qualified name including the namespaces. Going from current node upwards the tree adding all namespace names.
The tests dont run on my machine (Linux 32 bit). wth? They did pass Travis and they obviously passed on your machine. But I get a bunch of:
where the lookup is expected to succeed. What can cause this? The stuff I merged in the meanwhile? Replacement of the deprecated ModuleFileSystem? Hmm... |
:-< rebase to see if last changes are the issue |
Fails after rebase, so last changes on master are the root cause. |
Input after transformation: <?xml version="1.0" encoding="utf-8"?>
<testsuite tests="1" errors="0" failures="0" skipped="0" name="my_module">
<testcase classname="my_test" name="my_test" filename="tests/unittests/test_simple.cc" />
</testsuite> Seems to be changed behaviour in problem of 'sonar-project.properties'? sonar.projectKey=boosttest_project
sonar.projectName=boosttest_project
sonar.projectVersion=1
sonar.language=c++
sonar.sources=src
sonar.tests=tests/unittests
sonar.cxx.includeDirectories=src,tests
sonar.cxx.xunit.xsltURL=boosttest-1.x-to-junit-1.0.xsl
sonar.cxx.xunit.reportPath=build/xunit-report.xml |
@Typz, @wenns original search in fs.testDirs() is missing now? Old: public org.sonar.api.resources.File findInSonar(File file, SensorContext context, ModuleFileSystem fs, Project project) {
org.sonar.api.resources.File unitTestFile = org.sonar.api.resources.File.fromIOFile(file, project);
if (unitTestFile == null) {
unitTestFile = org.sonar.api.resources.File.fromIOFile(file, fs.testDirs());
}
if (context.getResource(unitTestFile) == null) {
unitTestFile = null;
}
return unitTestFile;
} New: public org.sonar.api.resources.File findInSonar(File file, SensorContext context, FileSystem fs, Project project) {
org.sonar.api.resources.File unitTestFile = org.sonar.api.resources.File.fromIOFile(file, project);
if (context.getResource(unitTestFile) == null) {
unitTestFile = null;
}
return unitTestFile;
} |
Yep, saw that already. The point is, the older version had two access trials because of < 4.0 compatibility issue of the like... The new one should work too. Will try to investigate further. |
http://javadocs.sonarsource.org/4.5/apidocs/org/sonar/api/resources/File.html public static File fromIOFile(File file, Project module) |
We're still using 4.2 API. |
@wenns are you looking for a solution? |
Right now Im cleaning rooms ;) |
Have a time slot between 4 and 6 o'clock. If you want I can do another try... |
Lets make it that way: I'll just merge the stuff and skip failing tests. And we'll address the problem on the master. I mean: the PR is OK, its master thats broken. This PR just exposes a problem. |
Pushed to master. Failing tests are marked with @Skip. If you want to run them, remove this annotation. |
- adapt boost xsl to support changed xunit feature: support all log_level settings - extend SourceCodeBuilderVisitor for functions to return qualified names including namespaces - extend xunit lookup table: supports search for qualified and unqualified classname now - add a new unit test to search for qualified classname with namespace - use 'sudo apt-get install libboost-dev libboost-test-dev' for test with real boost - add boost test examples - add boost test reports - add new scenarios to integration tests: - add 'Scenario Outline: boosttest reports cannot be found or are empty' - add 'Scenario: Importing nested boosttest report in default mode' - add 'Scenario: Importing unchanged boosttest reports in default mode' - add 'Scenario Outline: Importing unchanged boosttest reports in detailed mode (filename tag)' - add 'Scenario Outline: Importing unchanged boosttest reports in detailed mode (AST)' - add 'Scenario: Test with real boost test framework' - close #401 - close #372 - close #368 - close #375