summaryrefslogtreecommitdiffstats
path: root/kabc
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-09-27 17:24:29 +0200
committerSlávek Banko <slavek.banko@axis.cz>2017-07-22 15:56:46 +0200
commit759db62fcf49756d661d492aa67a5abe19812a1e (patch)
treeeccc7ddbacb011ae1aa1a34ada431d9a1488796f /kabc
parent6b9a3998f0df94ebfe4477c2aaf4c393258bf1ef (diff)
downloadtdelibs-759db62fcf49756d661d492aa67a5abe19812a1e.tar.gz
tdelibs-759db62fcf49756d661d492aa67a5abe19812a1e.zip
Fix FTBFS on vcardparser tests from prior commit
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 1571e6174436e1af461745296cacfbb3b369fdf9)
Diffstat (limited to 'kabc')
-rw-r--r--kabc/vcardparser/CMakeLists.txt42
-rw-r--r--kabc/vcardparser/test.sh11
2 files changed, 17 insertions, 36 deletions
diff --git a/kabc/vcardparser/CMakeLists.txt b/kabc/vcardparser/CMakeLists.txt
index 462c20e47..2e0d78f7c 100644
--- a/kabc/vcardparser/CMakeLists.txt
+++ b/kabc/vcardparser/CMakeLists.txt
@@ -90,34 +90,26 @@ tde_add_executable( testvcardformatimpl
LINK ${TDEABC_TESTS_LINK}
)
-add_custom_target(test ALL echo "performing tests on vcardparser"
- COMMAND bash ./test.sh
- DEPENDS testing
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-add_custom_target(testing ALL echo "creating test infrastructure"
- DEPENDS testvcardformatimpl testvcardformat testwrite2 testwrite testread2 testread
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-add_custom_command(
- TARGET testing PRE_BUILD
- COMMAND test
- ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/test.sh || ln -s ${CMAKE_SOURCE_DIR}/kabc/vcardparser/test.sh ${CMAKE_CURRENT_BINARY_DIR}
+add_custom_target( vcardparser_tests ALL
+ COMMENT "[VCardParser] Performing tests"
+ COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/FAILED
+ DEPENDS
+ testvcardformatimpl testvcardformat testwrite2 testwrite testread2 testread
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
-add_custom_command(
- TARGET testing PRE_BUILD
- COMMAND test
- ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/checkvcard.pl || ln -s ${CMAKE_SOURCE_DIR}/kabc/vcardparser/checkvcard.pl ${CMAKE_CURRENT_BINARY_DIR}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-)
+file( GLOB vcardparser_testfiles "tests/*.vcf" )
+list( REMOVE_ITEM vcardparser_testfiles "${CMAKE_CURRENT_SOURCE_DIR}/tests/vcard5.vcf" )
+list( SORT vcardparser_testfiles )
+
+foreach(testfile ${vcardparser_testfiles})
+ add_custom_command(
+ TARGET vcardparser_tests
+ COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/checkvcard.pl ${testfile}
+ )
+endforeach(testfile)
add_custom_command(
- TARGET testing PRE_BUILD
- COMMAND test
- ARGS -d ${CMAKE_CURRENT_BINARY_DIR}/tests || ln -s ${CMAKE_SOURCE_DIR}/kabc/vcardparser/tests ${CMAKE_CURRENT_BINARY_DIR}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ TARGET vcardparser_tests
+ COMMAND test ! -f ${CMAKE_CURRENT_BINARY_DIR}/FAILED
)
diff --git a/kabc/vcardparser/test.sh b/kabc/vcardparser/test.sh
deleted file mode 100644
index 4badd6af7..000000000
--- a/kabc/vcardparser/test.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-TESTFILES="vcard1.vcf vcard2.vcf vcard3.vcf vcard4.vcf vcard6.vcf vcard7.vcf vcard8.vcf vcard9.vcf"
-
-test -f FAILED && rm -f FAILED
-for i in $TESTFILES;
- do perl ./checkvcard.pl ./tests/$i ;
-done;
-
-if [ -f FAILED ]; then
- echo ERROR
- exit 1
-fi \ No newline at end of file