diff options
author | Roger Leigh <rleigh@codelibre.net> | 2022-01-16 22:47:10 +0000 |
---|---|---|
committer | Roger Leigh <rleigh@codelibre.net> | 2022-01-23 09:59:47 +0000 |
commit | 6e6c4e26dcb843adf7ff1de0b2d9a1733366fc84 (patch) | |
tree | 5950eff005e3c4d9c21493b08a62b7ae35b71162 /test/TiffTestCommon.cmake | |
parent | 8a481db9b52658b91d6b8d3053192b5617c56e78 (diff) | |
download | libtiff-git-6e6c4e26dcb843adf7ff1de0b2d9a1733366fc84.tar.gz |
Correct CMake testingcmake-test
* Use functions rather than macros to avoid problems with variables in
conditions (since macro arguments are not variables)
* Conditionally add to file lists and test program lists based upon the
configuration options (e.g. JPEG and old-JPEG availability)
* Sync tests, files and option usage with current automake usage
Diffstat (limited to 'test/TiffTestCommon.cmake')
-rw-r--r-- | test/TiffTestCommon.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/TiffTestCommon.cmake b/test/TiffTestCommon.cmake index a0db6782..6d3b0465 100644 --- a/test/TiffTestCommon.cmake +++ b/test/TiffTestCommon.cmake @@ -56,6 +56,7 @@ macro(test_convert_multi command infile outfile) message(FATAL_ERROR "Returned failed status ${TEST_STATUS}! Output (if any) is in \"${native_outfile}\"") endif() endmacro() + # # Test a simple command which sends output to stdout # @@ -74,6 +75,19 @@ macro(test_stdout command infile outfile) endmacro() # +# Test a simple command which sends output to stdout +# +# test_stdout command infile outfile +macro(test_stdout_noargs command) + message(STATUS "Running ${MEMCHECK} ${command}") + execute_process(COMMAND ${MEMCHECK} ${command} + RESULT_VARIABLE TEST_STATUS) + if(TEST_STATUS) + message(FATAL_ERROR "Returned failed status ${TEST_STATUS}!") + endif() +endmacro() + +# # Execute a simple command (e.g. tiffinfo) with one input file # # test_exec command infile |