summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJehan <jehan@girinstud.io>2022-12-16 23:10:34 +0100
committerJehan <jehan@girinstud.io>2022-12-16 23:10:34 +0100
commit127d7faf478d62533f2ead1e8df5f2d7a6276da1 (patch)
treee71d2317c30dfdc7c5c9885982e15cbf373496d2
parent3a6806ab192fb1e37c47869e36199c6cf7e435f7 (diff)
test: add ability to have several tests per charsets.
While the expected charset name is still the first part of the test file (until the first point character), the test name is all but the last part (until the last point character). This will allow to have several test files for a single charset. In particular, I want 2 test files at least for Hebrew when it has a visual and logical variant. So I could call these "ibm862.visual.txt" and "ibm862.logical.txt" which both expect IBM862 as a result charset, but test names will "he:ibm862.visual" and he:ibm862.logical" respectively. Without this change, the test names would collide and CMake would refuse these.
-rw-r--r--test/CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a059044..77add68 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -30,6 +30,7 @@ foreach(dir ${dirs})
# Iterate through all files.
foreach(file ${files})
get_filename_component(charset ${file} NAME_WE)
+ get_filename_component(testname ${file} NAME_WLE)
# These are tests known to fail (not supported or not efficient
# enough). We will have to take a closer look and fix these, but
# there is no need to break the whole `make test` right now,
@@ -41,7 +42,7 @@ foreach(dir ${dirs})
"${lang}:${charset}" STREQUAL "he:iso-8859-8")
message(STATUS "Skipping test ${lang}:${charset} (known broken)")
else()
- add_test(NAME "${lang}:${charset}" COMMAND uchardet-tests ${file})
+ add_test(NAME "${lang}:${testname}" COMMAND uchardet-tests ${file})
endif()
endforeach()
endforeach()