|
@ -63,27 +63,12 @@ endif() |
|
|
|
|
|
|
|
|
if(UTF8PROC_ENABLE_TESTING) |
|
|
if(UTF8PROC_ENABLE_TESTING) |
|
|
enable_testing() |
|
|
enable_testing() |
|
|
if (NOT WIN32) |
|
|
file(MAKE_DIRECTORY data) |
|
|
set(curl_cmd "/usr/bin/curl") |
|
|
set(UNICODE_VERSION 13.0.0) |
|
|
set(curl_param --retry 5 --location -\#) |
|
|
file(DOWNLOAD http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/NormalizationTest.txt data/NormalizationTest.txt SHOW_PROGRESS) |
|
|
set(UNICODE_VERSION 12.1.0) |
|
|
file(DOWNLOAD http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/auxiliary/GraphemeBreakTest.txt data/GraphemeBreakTestOrg.txt SHOW_PROGRESS) |
|
|
set(UNICODE_EMOJI_VERSION 12.0) |
|
|
file(REMOVE data/GraphemeBreakTestOrg.txt) |
|
|
|
|
|
|
|
|
execute_process(COMMAND mkdir -p data) |
|
|
|
|
|
execute_process( |
|
|
|
|
|
COMMAND ${curl_cmd} ${curl_param} -o data/emoji-data.txt -O http://unicode.org/Public/emoji/${UNICODE_EMOJI_VERSION}/emoji-data.txt |
|
|
|
|
|
COMMAND ${curl_cmd} ${curl_param} -o data/UnicodeData.txt -O http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/UnicodeData.txt |
|
|
|
|
|
COMMAND ${curl_cmd} ${curl_param} -o data/EastAsianWidth.txt -O http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/EastAsianWidth.txt |
|
|
|
|
|
COMMAND ${curl_cmd} ${curl_param} -o data/GraphemeBreakProperty.txt -O http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/auxiliary/GraphemeBreakProperty.txt |
|
|
|
|
|
COMMAND ${curl_cmd} ${curl_param} -o data/DerivedCoreProperties.txt -O http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/DerivedCoreProperties.txt |
|
|
|
|
|
COMMAND ${curl_cmd} ${curl_param} -o data/CompositionExclusions.txt -O http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/CompositionExclusions.txt |
|
|
|
|
|
COMMAND ${curl_cmd} ${curl_param} -o data/CaseFolding.txt -O http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/CaseFolding.txt |
|
|
|
|
|
COMMAND ${curl_cmd} ${curl_param} -o data/NormalizationTest.txt -O http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/NormalizationTest.txt |
|
|
|
|
|
COMMAND ${curl_cmd} ${curl_param} -o data/GraphemeBreakTestOrg.txt -O http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/auxiliary/GraphemeBreakTest.txt |
|
|
|
|
|
) |
|
|
|
|
|
execute_process(COMMAND bash -c "cat data/GraphemeBreakTestOrg.txt | /usr/bin/perl -pe 's,÷,/,g;s,×,+,g'" OUTPUT_FILE data/GraphemeBreakTest.txt) |
|
|
|
|
|
execute_process(COMMAND bash -c "rm -f data/GraphemeBreakTestOrg.txt") |
|
|
|
|
|
endif() |
|
|
|
|
|
add_executable(case test/tests.h test/tests.c utf8proc.h test/case.c) |
|
|
add_executable(case test/tests.h test/tests.c utf8proc.h test/case.c) |
|
|
target_link_libraries(case utf8proc) |
|
|
target_link_libraries(case utf8proc) |
|
|
add_executable(custom test/tests.h test/tests.c utf8proc.h test/custom.c) |
|
|
add_executable(custom test/tests.h test/tests.c utf8proc.h test/custom.c) |
|
@ -114,5 +99,5 @@ if(UTF8PROC_ENABLE_TESTING) |
|
|
add_executable(normtest test/tests.h test/tests.c utf8proc.h test/normtest.c) |
|
|
add_executable(normtest test/tests.h test/tests.c utf8proc.h test/normtest.c) |
|
|
target_link_libraries(normtest utf8proc) |
|
|
target_link_libraries(normtest utf8proc) |
|
|
#add_test(utf8proc.testgraphemetest graphemetest data/GraphemeBreakTest.txt) |
|
|
#add_test(utf8proc.testgraphemetest graphemetest data/GraphemeBreakTest.txt) |
|
|
#add_test(utf8proc.testnormtest normtest data/NormalizationTest.txt) |
|
|
add_test(utf8proc.testnormtest normtest data/NormalizationTest.txt) |
|
|
endif() |
|
|
endif() |
|
|