serge1 / ELFIO

ELFIO - ELF (Executable and Linkable Format) reader and producer implemented as a header only C++ library
http://serge1.github.io/ELFIO
MIT License
720 stars 155 forks source link

Add 'make check' target #51

Closed schultetwin1 closed 3 years ago

serge1 commented 3 years ago

Thank you again!

serge1 commented 3 years ago

I am sorry, it does not seem to work. I get the following output:

user@ubuntu:~/elfio/build$ make test Running tests... Test project /home/user/elfio/build Start 1: ELFIOTest 1/1 Test #1: ELFIOTest ........................ Passed 0.23 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 0.23 sec user@ubuntu:~/elfio/build$ make check make[2]: No rule to make target 'tests/CMakeFiles/test.dir/all', needed by 'tests/CMakeFiles/check.dir/all'. Stop. make[1]: [CMakeFiles/Makefile2:456: tests/CMakeFiles/check.dir/rule] Error 2 make: *** [Makefile:267: check] Error 2

Are my steps wrong?

Serge

serge1 commented 3 years ago

Another question: is it possible that 'make test' will build the test executable prior running it? I'd like that the sequence make clean make test will work without 'make' in the middle

schultetwin1 commented 3 years ago

Are my steps wrong?

Sorry about that, I was using the ninja generator (not the make generator) and it was working perfectly. I switched to trying to make generator and got the same issue. I found this cmake wiki page which seems to have a nice solution for us. I'll put out a change for that. I tested this change for both ninja and make.

Another question: is it possible that 'make test' will build the test executable prior running it? I'd like that the sequence

The CMake wiki page had a solution for that as well :)

Both are in #52