Browse Source

- integrated test-target into cmake config

development
Andreas Romeyke 2 years ago
parent
commit
cb7804d24b
  1. 8
      README.testsuite
  2. 12
      src/CMakeLists.txt

8
README.testsuite

@ -18,7 +18,13 @@ It needs the following Perl modules (in brackets the debian module):
* Test::More (perl-modules-XXX with XXX as Perl-version )
The call looks like this:
in cmake the test-target is enabled by default, you could run it via:
$> cmake ../src
$> make
$> make test
If you want to call it manually, you should try this instead:
$> cd t/
$> perl -I./ test_grammar.t && echo "fine!"

12
src/CMakeLists.txt

@ -104,3 +104,15 @@ install(DIRECTORY
file( GLOB README_FILES "../README*" "../FAQ" "../LICENSE" "../TODO" "../BUGS")
install(FILES ${README_FILES} DESTINATION share/checkit_tiff/)
INCLUDE(FindPerl)
if (PERL_FOUND)
enable_testing()
SET(T_DIR ${PROJECT_SOURCE_DIR}/../t )
add_test(NAME grammar COMMAND ${PERL_EXECUTABLE} -I${T_DIR} test_grammar.t WORKING_DIRECTORY ${T_DIR} )
add_test(NAME config COMMAND ${PERL_EXECUTABLE} -I ${T_DIR} test_config_examples.t WORKING_DIRECTORY ${T_DIR} )
add_test(NAME validfiles COMMAND ${PERL_EXECUTABLE} -I ${T_DIR} test_should_pass.t WORKING_DIRECTORY ${T_DIR} )
add_test(NAME invalidfiles COMMAND ${PERL_EXECUTABLE} -I ${T_DIR} test_should_fail.t WORKING_DIRECTORY ${T_DIR} )
else(PERL_FOUND)
MESSAGE(WARN "for testsuite an installed Perl is needed")
endif()
Loading…
Cancel
Save