Skip to content
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

use cmake build type defined in .travis.yml for travis builds #1235

Merged
merged 10 commits into from Sep 1, 2017
Merged

use cmake build type defined in .travis.yml for travis builds #1235

merged 10 commits into from Sep 1, 2017

Conversation

ghost
Copy link

@ghost ghost commented Aug 30, 2017

Currently, the BUILD_TYPE variable of .travis.yml was ignored up to now by travis.sh and the build process.

Also, while cmake does not complain on build type debug (as listed in .travis.yml currently), the cmake documentation always spells it Debug, so take this.

Using the variable in travis.sh to call cmake -DCMAKE_BUILD_TYPE=Debug leads to the problem reported in issue #1175, i.e. some Python driven tests won't find their test executable.

The travis build triggered by the first commits here will probably fail; then a fix can be tested and discussed.

This pull request fixes #1175 and #1070.

Herbert Thielen added 2 commits August 30, 2017 11:59
The BUILD_TYPE variable of .travis.yml was ignored up to now.
While cmake does not complain on build type 'debug', the cmake
documentation always spells it 'Debug', so take this.
@ghost
Copy link
Author

ghost commented Aug 30, 2017

As expected, Travis build 853 is failing, i.e. CTest is failing with error messages as the following:

      Start 60: gtest_xml_output_unittest

60/60 Test #60: gtest_xml_output_unittest ...............***Failed    0.05 sec

Unable to find the test binary "/home/travis/build/google/googletest/build/googlemock/gtest/Debug/gtest_xml_output_unittest_". Please make sure to provide a path to the binary via the --build_dir flag or the BUILD_DIR environment variable.

The build type Debug was part of the path to the executable, which is wrong for this Cmake generator.
Trying to fix this now, though it might affect Windows which I'm unable to test currently - but AppVeyor will show it ...

Herbert Thielen added 2 commits August 30, 2017 12:48
On single-configuration build systems as Makefile Generators, there is
no subdirectory for the configuration in the build tree - therefore ask
cmake for the subdir by using CMAKE_CFG_INTDIR, which is just '.' on
single-configuration build systems (Linux et al.).
@ghost
Copy link
Author

ghost commented Aug 30, 2017

Ok, unfortunately, ${CMAKE_CFG_INTDIR} is set during build only, not during test, so AppVeyor is complaining now. Seems we need a small switch here.

Herbert Thielen added 2 commits August 30, 2017 15:14
This reverts commit 73d58dd.

Unfortunately, ${CMAKE_CFG_INTDIR} is set during build only and doesn't
help here.
@ghost ghost changed the title WIP: use cmake build type defined in .travis.yml for travis builds use cmake build type defined in .travis.yml for travis builds Aug 30, 2017
@ghost
Copy link
Author

ghost commented Aug 30, 2017

@gennadiycivil As soon as AppVeyor has finished, this is ready for review :-)

@gennadiycivil
Copy link
Contributor

Looks mostly good to me - but can we add tests for positive proof?
It would be helpful to show simple test case "before" that was failing and then show same test "After"
I think you mostly have this , but if you could make it easier to review I would really appreciate it

@gennadiycivil gennadiycivil self-assigned this Aug 31, 2017
@ghost
Copy link
Author

ghost commented Aug 31, 2017

@gennadiycivil - I already tried to create comments here in sequence to show this, sorry that it wasn't obvious enough.

The failing build is mentioned in this comment with a link to the build logs, after turning on the build type in travis.sh in commit cc246 - together with commit dae04 to use the CMake typical Debug instead of debug in .travis.yml. All Python based tests are failing, as the path given to Python is wrong.

The following commits, i.e. the changes in googletest/cmake/internal_utils.cmake, fix the build path given to Python. This path was o.k. for Windows, i.e. added e.g. Debug as postfix, but didn't work on UNIXoid systems which do not have split directories for multiple configurations in the build path.

@ghost ghost mentioned this pull request Aug 31, 2017
@ghost
Copy link
Author

ghost commented Aug 31, 2017

Hmm, Travis build 888.6 timed out after a warning, probably not source code related? Will merge master into this branch to see the result of the next build.

@gennadiycivil gennadiycivil merged commit b3a1f87 into google:master Sep 1, 2017
@ghost ghost mentioned this pull request Sep 1, 2017
@ghost ghost deleted the hethi/issue-1175-cmake-build-type branch September 1, 2017 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some tests are failing when using the debug configuration (-DCMAKE_BUILD_TYPE=Debug) on Debian
1 participant