dmonopoly/gtest-cmake-example

can't find the test

Opened this issue · 4 comments

hi,

following the steps you outline i end up with

➜  build git:(master) make test
Running tests...
Test project /Users/florian.oswald/git/gtest-cmake-example/build
    Start 1: that-test-I-made
Could not find executable /Users/florian.oswald/git/gtest-cmake-example/build/runUnitTests
Looked in the following places:
/Users/florian.oswald/git/gtest-cmake-example/build/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/Release/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/Release/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/Debug/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/Debug/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/MinSizeRel/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/MinSizeRel/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/RelWithDebInfo/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/RelWithDebInfo/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/Deployment/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/Deployment/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/Development/runUnitTests
/Users/florian.oswald/git/gtest-cmake-example/build/Development/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/Release/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/Release/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/Debug/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/Debug/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/MinSizeRel/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/MinSizeRel/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/RelWithDebInfo/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/RelWithDebInfo/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/Deployment/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/Deployment/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/Development/runUnitTests
Users/florian.oswald/git/gtest-cmake-example/build/Development/runUnitTests
Unable to find executable: /Users/florian.oswald/git/gtest-cmake-example/build/runUnitTests
1/2 Test #1: that-test-I-made .................***Not Run   0.00 sec
    Start 2: that-other-test-I-made
Could not find executable runUnitTests
Looked in the following places:
runUnitTests
runUnitTests
Release/runUnitTests
Release/runUnitTests
Debug/runUnitTests
Debug/runUnitTests
MinSizeRel/runUnitTests
MinSizeRel/runUnitTests
RelWithDebInfo/runUnitTests
RelWithDebInfo/runUnitTests
Deployment/runUnitTests
Deployment/runUnitTests
Development/runUnitTests
Development/runUnitTests
Unable to find executable: runUnitTests
2/2 Test #2: that-other-test-I-made ...........***Not Run   0.00 sec

0% tests passed, 2 tests failed out of 2

Total Test time (real) =   0.00 sec

The following tests FAILED:
      1 - that-test-I-made (Not Run)
      2 - that-other-test-I-made (Not Run)
Errors while running CTest
make: *** [test] Error 8

any ideas?

@floswald
May be you need to run $ make command before $ make test

Hi Florian, looks like you're on windows using MSVC? I had a similar problem there. The issue was that the runtime library setting for the runUnitTests target doesn't match those of the gtest target. This causes a linker error, so the runUnitTests executable is not built and it cannot be found at runtime.

I just created a pull request that fixes the issue. Hope that helps.

Cheers,
Stefan

I'm on os Yosemite. Didn't look into this further.
Cheers

On Wednesday, 13 January 2016, Stefan notifications@github.com wrote:

Hi Florian, looks like you're on windows using MSVC? I had a similar
problem there. The issue was that the runtime library setting for the
runUnitTests target doesn't match those of the gtest target. This causes a
linker error, so the runUnitTests executable is not built and it cannot be
found at runtime.

I just created a pull request that fixes the issue. Hope that helps.

Cheers,
Stefan


Reply to this email directly or view it on GitHub
#2 (comment)
.

tijme commented

Hi @floswald, did you find a fix for this issue? I'm on Sierra and I'm having the same problems.

Fixed this by updating to GoogleTest v1.8.