diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2021-05-07 18:27:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-07 18:27:17 -0400 |
commit | d0e3a85d09eb43c5de821dded7fc4aa76f593d2d (patch) | |
tree | 0f35d7d1ea267cccec6e476ed1eb3c010927c653 /tests | |
parent | b072d93e47949c9729c979fceef8a7c7bfd22d39 (diff) | |
download | cleanpath-d0e3a85d09eb43c5de821dded7fc4aa76f593d2d.tar.gz |
Testing (#5)
* Fix separators appearing at the end once and for all
* Add cleanpath executable tests
* Escape slashes
* Enable verbose testing
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4f23ecf..7a56301 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -20,3 +20,28 @@ foreach(file ${files}) PROPERTIES TIMEOUT 120) endforeach() + +# For these tests to pass TESTVAR_WIN (Windows) and TESTVAR_NIX (Unix-like) +# must be set in the runtime environment prior to execution. For some +# reason environment variables defined here are not passed on to child +# processes. +set(TEST_SETUP -E TESTVAR) + +if(${CMAKE_SYSTEM_NAME} EQUAL WINDOWS) + set(TEST_SETUP ${TEST_SETUP}_WIN) + set(exec ${CMAKE_BINARY_DIR}/cleanpath.exe) + + add_test(cmd_arg_exact ${exec} --exact ${TEST_SETUP} C:\\usr\\bin) + add_test(cmd_arg_loose ${exec} --loose ${TEST_SETUP} C:\\usr\\bin) +else() + set(TEST_SETUP ${TEST_SETUP}_NIX) + set(exec ${CMAKE_BINARY_DIR}/cleanpath) + + add_test(cmd_arg_exact ${exec} ${TEST_SETUP} --exact /usr/bin) + add_test(cmd_arg_loose ${exec} ${TEST_SETUP} --loose /usr/bin) + add_test(cmd_arg_regex ${exec} ${TEST_SETUP} --regex /usr/bin) +endif() + +add_test(cmd_arg_help ${exec} --help) +add_test(cmd_arg_version ${exec} --version) +add_test(cmd_arg_list ${exec} --list) |