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

CI/CMake3.8: header test fail on empty /include folder #60

Open
marehr opened this issue Dec 14, 2021 · 0 comments
Open

CI/CMake3.8: header test fail on empty /include folder #60

marehr opened this issue Dec 14, 2021 · 0 comments

Comments

@marehr
Copy link
Member

marehr commented Dec 14, 2021

From what I gathered:

  • Header test
  • on cmake3.8 can't handle non-existing /include folder

Example log:

[100%] Linking CXX executable header_test
/usr/bin/ld: ../../lib/libgtest_main.a(gtest_main.cc.o): in function `main':
gtest_main.cc:(.text.startup+0x33): undefined reference to `testing::InitGoogleTest(int*, char**)'
/usr/bin/ld: gtest_main.cc:(.text.startup+0x38): undefined reference to `testing::UnitTest::GetInstance()'
/usr/bin/ld: gtest_main.cc:(.text.startup+0x40): undefined reference to `testing::UnitTest::Run()'
collect2: error: ld returned 1 exit status
Complete Log:
+ make -k test
Running tests...
Test project /home/runner/work/dream_stellar/dream_stellar/build
make[1]: *** No rule to make target 'api_test'.
make[1]: *** No rule to make target 'cli_test'.
Scanning dependencies of target gtest_project
[ 10%] Creating directories for 'gtest_project'
[ 20%] Performing download step (git clone) for 'gtest_project'
Cloning into 'googletest'...
Note: switching to '252ce9c52d304659eff6be558209c811b7191963'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 252ce9c5 Googletest export
[ 30%] No patch step for 'gtest_project'
[ 40%] Performing update step for 'gtest_project'
[ 50%] Performing configure step for 'gtest_project'
-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Check for working C compiler: /usr/bin/gcc-11
-- Check for working C compiler: /usr/bin/gcc-11 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-11
-- Check for working CXX compiler: /usr/bin/g++-11 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python (found version "3.8.10") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/runner/work/dream_stellar/dream_stellar/build/test/gtest_project/src/gtest_project-build
[ 60%] Performing build step for 'gtest_project'
Scanning dependencies of target gtest
[ 25%] Building CXX object googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 50%] Linking CXX static library ../lib/libgtest.a
[ 50%] Built target gtest
Scanning dependencies of target gtest_main
[ 75%] Building CXX object googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[100%] Linking CXX static library ../lib/libgtest_main.a
[100%] Built target gtest_main
[ 70%] Performing install step for 'gtest_project'
[ 50%] Built target gtest
[100%] Built target gtest_main
Install the project...
-- Install configuration: "Release"
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/lib/cmake/GTest/GTestTargets.cmake
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/lib/cmake/GTest/GTestTargets-release.cmake
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/lib/cmake/GTest/GTestConfigVersion.cmake
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/lib/cmake/GTest/GTestConfig.cmake
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest-matchers.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest-spi.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/gtest-string.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/gtest-port-arch.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/gtest-filepath.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/gtest-port.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/gtest-type-util.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/custom
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/custom/gtest.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/custom/gtest-port.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/custom/gtest-printers.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/custom/README.md
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/gtest-death-test-internal.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/gtest-param-util.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/internal/gtest-internal.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest_prod.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest-test-part.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest-death-test.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest-message.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest-param-test.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest-printers.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest-typed-test.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/include/gtest/gtest_pred_impl.h
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/lib/libgtest.a
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/lib/libgtest_main.a
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/lib/pkgconfig/gtest.pc
-- Installing: /home/runner/work/dream_stellar/dream_stellar/build/lib/pkgconfig/gtest_main.pc
[ 80%] Completed 'gtest_project'
[ 80%] Built target gtest_project
Scanning dependencies of target seqan_library
[ 80%] Built target seqan_library
Scanning dependencies of target header_test
[ 90%] Building CXX object test/header/CMakeFiles/header_test.dir/__/__/header_test.cpp.o
[100%] Linking CXX executable header_test
/usr/bin/ld: ../../lib/libgtest_main.a(gtest_main.cc.o): in function `main':
gtest_main.cc:(.text.startup+0x33): undefined reference to `testing::InitGoogleTest(int*, char**)'
/usr/bin/ld: gtest_main.cc:(.text.startup+0x38): undefined reference to `testing::UnitTest::GetInstance()'
/usr/bin/ld: gtest_main.cc:(.text.startup+0x40): undefined reference to `testing::UnitTest::Run()'
collect2: error: ld returned 1 exit status
make[4]: *** [test/header/CMakeFiles/header_test.dir/build.make:97: test/header/header_test] Error 1
make[4]: Target 'test/header/CMakeFiles/header_test.dir/build' not remade because of errors.
make[3]: *** [CMakeFiles/Makefile2:278: test/header/CMakeFiles/header_test.dir/all] Error 2
make[2]: *** [CMakeFiles/Makefile2:285: test/header/CMakeFiles/header_test.dir/rule] Error 2
make[2]: Target 'header_test' not remade because of errors.
make[1]: *** [Makefile:227: header_test] Error 2
    Start 1: header/header_test
Could not find executable /home/runner/work/dream_stellar/dream_stellar/build/test/header/header_test
Looked in the following places:
/home/runner/work/dream_stellar/dream_stellar/build/test/header/header_test
/home/runner/work/dream_stellar/dream_stellar/build/test/header/header_test
/home/runner/work/dream_stellar/dream_stellar/build/test/header/Release/header_test
Unable to find executable: /home/runner/work/dream_stellar/dream_stellar/build/test/header/header_test
Errors while running CTest
make: *** [Makefile:119: test] Error 8

https://github.com/marehr/dream_stellar/runs/4484325378?check_suite_focus=true

cmake 3.22 seems to work fine. Adding an empty dummy file empty.hpp in /include makes it work again.

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

No branches or pull requests

1 participant