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

mptest isn't built with make all #36

Closed
fanquake opened this issue May 13, 2020 · 2 comments
Closed

mptest isn't built with make all #36

fanquake opened this issue May 13, 2020 · 2 comments

Comments

@fanquake
Copy link
Contributor

Following the installation instructions in the README on a new Debian system. It seems that make all doesn't build the mptest executable, so the tests don't run.

If you build it with make mptest and then run make test everything works fine. Unsure if this a doc or CMake issue.

cmake ..
-- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'capnp'
--   Found capnp, version 0.7.0
-- Checking for module 'capnp-rpc'
--   Found capnp-rpc, version 0.7.0
-- Checking for module 'capnp-json'
--   Found capnp-json, version 0.7.0
-- Checking for module 'kj'
--   Found kj, version 0.7.0
-- Checking for module 'kj-async'
--   Found kj-async, version 0.7.0
-- Checking for module 'kj-http'
--   Found kj-http, version 0.7.0
-- Checking for module 'kj-test'
--   Found kj-test, version 0.7.0
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- 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  
-- Looking for C++ include kj/filesystem.h
-- Looking for C++ include kj/filesystem.h - found
-- Performing Test HAVE_PTHREAD_GETNAME_NP
-- Performing Test HAVE_PTHREAD_GETNAME_NP - Success
-- Performing Test HAVE_PTHREAD_THREADID_NP
-- Performing Test HAVE_PTHREAD_THREADID_NP - Failed
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: /libmultiprocess/build
root@3ddadd8ec436:/libmultiprocess/build# make
[ 14%] Compiling Cap'n Proto schema include/mp/proxy.capnp
Scanning dependencies of target multiprocess
[ 28%] Building CXX object CMakeFiles/multiprocess.dir/include/mp/proxy.capnp.c++.o
[ 42%] Building CXX object CMakeFiles/multiprocess.dir/src/mp/proxy.cpp.o
[ 57%] Building CXX object CMakeFiles/multiprocess.dir/src/mp/util.cpp.o
[ 71%] Linking CXX static library libmultiprocess.a
[ 71%] Built target multiprocess
Scanning dependencies of target mpgen
[ 85%] Building CXX object CMakeFiles/mpgen.dir/src/mp/gen.cpp.o
/libmultiprocess/src/mp/gen.cpp: In function 'void Generate(kj::StringPtr, kj::StringPtr, kj::StringPtr, kj::ArrayPtr<const kj::StringPtr>)':
/libmultiprocess/src/mp/gen.cpp:154:77: warning: 'capnp::ParsedSchema capnp::SchemaParser::parseDiskFile(kj::StringPtr, kj::StringPtr, kj::ArrayPtr<const kj::StringPtr>) const' is deprecated [-Wdeprecated-declarations]
  154 |     auto file_schema = parser.parseDiskFile(src_file, src_file, import_paths);
      |                                                                             ^
In file included from /libmultiprocess/src/mp/gen.cpp:9:
/usr/include/capnp/schema-parser.h:103:16: note: declared here
  103 |   ParsedSchema parseDiskFile(kj::StringPtr displayName, kj::StringPtr diskPath,
      |                ^~~~~~~~~~~~~
[100%] Linking CXX executable mpgen
[100%] Built target mpgen
root@3ddadd8ec436:/libmultiprocess/build# make all test
[ 71%] Built target multiprocess
[100%] Built target mpgen
Running tests...
Test project /libmultiprocess/build
    Start 1: mptest
Could not find executable /libmultiprocess/build/mptest
Looked in the following places:
/libmultiprocess/build/mptest
/libmultiprocess/build/mptest
/libmultiprocess/build/Release/mptest
/libmultiprocess/build/Release/mptest
/libmultiprocess/build/Debug/mptest
/libmultiprocess/build/Debug/mptest
/libmultiprocess/build/MinSizeRel/mptest
/libmultiprocess/build/MinSizeRel/mptest
/libmultiprocess/build/RelWithDebInfo/mptest
/libmultiprocess/build/RelWithDebInfo/mptest
/libmultiprocess/build/Deployment/mptest
/libmultiprocess/build/Deployment/mptest
/libmultiprocess/build/Development/mptest
/libmultiprocess/build/Development/mptest
libmultiprocess/build/mptest
libmultiprocess/build/mptest
libmultiprocess/build/Release/mptest
libmultiprocess/build/Release/mptest
libmultiprocess/build/Debug/mptest
libmultiprocess/build/Debug/mptest
libmultiprocess/build/MinSizeRel/mptest
libmultiprocess/build/MinSizeRel/mptest
libmultiprocess/build/RelWithDebInfo/mptest
libmultiprocess/build/RelWithDebInfo/mptest
libmultiprocess/build/Deployment/mptest
libmultiprocess/build/Deployment/mptest
libmultiprocess/build/Development/mptest
libmultiprocess/build/Development/mptest
Unable to find executable: /libmultiprocess/build/mptest
1/1 Test #1: mptest ...........................***Not Run   0.00 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.00 sec

The following tests FAILED:
	  1 - mptest (Not Run)
Errors while running CTest
make: *** [Makefile:107: test] Error 8
@ryanofsky
Copy link
Collaborator

Thanks for reporting. I guess this is technically a documentation bug, but there wasn't a convenient way to build and run all tests, so I added "make check" and "make tests" targets in #37

ryanofsky added a commit that referenced this issue May 13, 2020
0378353 Add "make check" target to build and run tests (Russell Yanofsky)

Pull request description:

  fanquake reported #36 that instructions for running tests in the README are wrong, and there isn't a convenient way to build and run tests, so this PR adds a "make check" custom target to make it more straightforward.

  The new "make check" target builds and runs all available tests, while the previous "make test" target (provided by CTest) only runs existing test binaries without building anything.

  This PR also:

  - Moves all test code and build rules to a new test/ subdirectory to separate test code from non-test code
  - Adds a new "make tests" target used internally by "make check" to build tests without running them

Top commit has no ACKs.

Tree-SHA512: f2355c23c6286c519169bf5e0c08c06296bfe009ef096edd37bbd447ff39cd39d1ab4bb7645d76dd0086e39ab6389c4d9b79649b5708e52880a693f7ead5d49e
@ryanofsky
Copy link
Collaborator

Thanks for testing #37. Just merged that, so the problem should be resolved. The test still won't be built with "make all" but the convention for cmake (as per "make help") seems to be that "make all" is identical to "make", and it wouldn't make sense to build tests for the default target

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

2 participants