aboutsummaryrefslogtreecommitdiff
path: root/test/check.sh
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-08 21:16:31 +0200
committerAdrian Kummerländer2014-05-08 21:16:31 +0200
commit947603b5d7f05053a93a3cfe257fa7ab11304a90 (patch)
tree58ed6c641ac0e9f36b0ca6e8d347ab0308e81a51 /test/check.sh
parent209f0b2fd9310f503d4599b12483fddc04d1f7dd (diff)
downloadInputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar.gz
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar.bz2
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar.lz
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar.xz
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar.zst
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.zip
Implemented black-box test cases
* the directories below "./test" contain test cases ** "transformation.xsl" and the expected result as "reference.xml" ** tests are performed by "check.sh" *** returns diff on error * this system enables simple verification of external function results ** way simpler than C++ unit tests would be in this scenario * expanded cmake instructions to automatically execute the test cases * old example transformation was removed
Diffstat (limited to 'test/check.sh')
-rwxr-xr-xtest/check.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/check.sh b/test/check.sh
new file mode 100755
index 0000000..fd537d7
--- /dev/null
+++ b/test/check.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+for testcase in *;
+do
+ if [ -d $testcase ] && [ "$testcase" != "common" ]
+ then
+ echo $testcase
+
+ cd $testcase
+ rm -f actual.xml
+
+ ./../../build/test --transformation transformation.xsl --target actual.xml
+ diff -u reference.xml actual.xml
+
+ if [ $? = 0 ]
+ then
+ echo "passed."
+ else
+ echo "failed."
+ fi
+
+ cd ..
+ fi
+done