summaryrefslogtreecommitdiffstats
path: root/test/w3c
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-12-26 22:29:22 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-12-26 22:29:22 (GMT)
commit42437db418574f2a80d098e568b9498a21343800 (patch)
tree291c1983d8ad14b97be19fda7f3601b9d83c2031 /test/w3c
parent330576fcb4d97504e0d6951067b753499d91b541 (diff)
downloaduscxml-42437db418574f2a80d098e568b9498a21343800.zip
uscxml-42437db418574f2a80d098e568b9498a21343800.tar.gz
uscxml-42437db418574f2a80d098e568b9498a21343800.tar.bz2
Plenty of smaller bug-fixes for uscxml-transform and PROMELA datamodel
Diffstat (limited to 'test/w3c')
-rwxr-xr-xtest/w3c/analyze_tests.pl33
-rw-r--r--test/w3c/run_minimized_flat_test.cmake21
-rw-r--r--test/w3c/run_minimized_test.cmake16
-rw-r--r--test/w3c/run_promela_test.cmake14
4 files changed, 78 insertions, 6 deletions
diff --git a/test/w3c/analyze_tests.pl b/test/w3c/analyze_tests.pl
index 2525008..111db5a 100755
--- a/test/w3c/analyze_tests.pl
+++ b/test/w3c/analyze_tests.pl
@@ -42,7 +42,7 @@ $/ = '-' x 58 . "\n";
while ($block = <FILE>) {
chomp($block);
-
+
# Test Preambel ========
if ($block =~
/
@@ -83,6 +83,37 @@ while ($block = <FILE>) {
# next; - no next as this is part of the actual test output we need to scan below
}
+ # Minimization ========
+ # print $block;
+
+ if ($block =~
+ /
+ Number\sof\selements\sbefore\sreduction:\s(\d+)
+ /x ) {
+ $test->{$currTest}->{'min'}->{'before'} = $1;
+ if ($block =~
+ /
+ Number\sof\selements\safter\sreduction:\s(\d+)
+ /x ) {
+ $test->{$currTest}->{'min'}->{'after'} = $1;
+ }
+ }
+
+ # Flattening ========
+
+ if ($block =~
+ /
+ Number\sof\selements\sbefore\sflattening:\s(\d+)
+ /x ) {
+ $test->{$currTest}->{'flat'}->{'before'} = $1;
+ if ($block =~
+ /
+ Number\sof\selements\safter\sflattening:\s(\d+)
+ /x ) {
+ $test->{$currTest}->{'flat'}->{'after'} = $1;
+ }
+ }
+
# Promela Test ========
if ($block =~
/
diff --git a/test/w3c/run_minimized_flat_test.cmake b/test/w3c/run_minimized_flat_test.cmake
new file mode 100644
index 0000000..81f9114
--- /dev/null
+++ b/test/w3c/run_minimized_flat_test.cmake
@@ -0,0 +1,21 @@
+# minimize SCXML document and run
+
+get_filename_component(TEST_FILE_NAME ${TESTFILE} NAME)
+
+set(ENV{USCXML_MINIMIZE_WAIT_FOR_COMPLETION} "TRUE")
+set(ENV{USCXML_MINIMIZE_RETAIN_AS_COMMENTS} "TRUE")
+
+execute_process(COMMAND ${USCXML_TRANSFORM_BIN} -tflat -i ${TESTFILE} -o ${OUTDIR}/${TEST_FILE_NAME}.flat.scxml RESULT_VARIABLE CMD_RESULT)
+if(CMD_RESULT)
+ message(FATAL_ERROR "Error running ${USCXML_TRANSFORM_BIN}")
+endif()
+
+execute_process(COMMAND ${USCXML_TRANSFORM_BIN} -tmin -i ${OUTDIR}/${TEST_FILE_NAME}.flat.scxml -o ${OUTDIR}/${TEST_FILE_NAME}.flat.min.scxml RESULT_VARIABLE CMD_RESULT)
+if(CMD_RESULT)
+ message(FATAL_ERROR "Error running ${USCXML_TRANSFORM_BIN}")
+endif()
+
+execute_process(COMMAND ${USCXML_W3C_TEST_BIN} ${OUTDIR}/${TEST_FILE_NAME}.flat.min.scxml RESULT_VARIABLE CMD_RESULT)
+if(CMD_RESULT)
+ message(FATAL_ERROR "Error running ${USCXML_W3C_TEST_BIN}")
+endif()
diff --git a/test/w3c/run_minimized_test.cmake b/test/w3c/run_minimized_test.cmake
new file mode 100644
index 0000000..481c0e9
--- /dev/null
+++ b/test/w3c/run_minimized_test.cmake
@@ -0,0 +1,16 @@
+# minimize SCXML document and run
+
+get_filename_component(TEST_FILE_NAME ${TESTFILE} NAME)
+
+set(ENV{USCXML_MINIMIZE_WAIT_FOR_COMPLETION} "TRUE")
+set(ENV{USCXML_MINIMIZE_RETAIN_AS_COMMENTS} "TRUE")
+
+execute_process(COMMAND ${USCXML_TRANSFORM_BIN} -tmin -i ${TESTFILE} -o ${OUTDIR}/${TEST_FILE_NAME}.min.scxml RESULT_VARIABLE CMD_RESULT)
+if(CMD_RESULT)
+ message(FATAL_ERROR "Error running ${USCXML_TRANSFORM_BIN}")
+endif()
+
+execute_process(COMMAND ${USCXML_W3C_TEST_BIN} ${OUTDIR}/${TEST_FILE_NAME}.min.scxml RESULT_VARIABLE CMD_RESULT)
+if(CMD_RESULT)
+ message(FATAL_ERROR "Error running ${USCXML_W3C_TEST_BIN}")
+endif()
diff --git a/test/w3c/run_promela_test.cmake b/test/w3c/run_promela_test.cmake
index 179cd68..e19148f 100644
--- a/test/w3c/run_promela_test.cmake
+++ b/test/w3c/run_promela_test.cmake
@@ -1,23 +1,27 @@
# convert given file to promela and run spin
get_filename_component(TEST_FILE_NAME ${TESTFILE} NAME)
+execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTDIR})
execute_process(COMMAND ${USCXML_TRANSFORM_BIN} -i ${TESTFILE} -o ${OUTDIR}/${TEST_FILE_NAME}.pml RESULT_VARIABLE CMD_RESULT)
if(CMD_RESULT)
message(FATAL_ERROR "Error running ${USCXML_TRANSFORM_BIN}: ${CMD_RESULT}")
endif()
-execute_process(COMMAND ${SPIN_BIN} -a ${OUTDIR}/${TEST_FILE_NAME}.pml RESULT_VARIABLE CMD_RESULT)
+execute_process(COMMAND ${SPIN_BIN} -a ${OUTDIR}/${TEST_FILE_NAME}.pml WORKING_DIRECTORY ${OUTDIR} RESULT_VARIABLE CMD_RESULT)
if(CMD_RESULT)
- message(FATAL_ERROR "Error running ${SPIN_BIN}: ${CMD_RESULT}")
+ message(FATAL_ERROR "Error running spin ${SPIN_BIN}: ${CMD_RESULT}")
endif()
-execute_process(COMMAND ${GCC_BIN} -DMEMLIM=1024 -DVECTORSZ=2048 -O2 -DXUSAFE -w -o ${OUTDIR}/pan ${OUTDIR}/pan.c RESULT_VARIABLE CMD_RESULT)
+execute_process(COMMAND ${GCC_BIN} -DMEMLIM=1024 -DVECTORSZ=8192 -O2 -DXUSAFE -w -o ${OUTDIR}/pan ${OUTDIR}/pan.c WORKING_DIRECTORY ${OUTDIR} RESULT_VARIABLE CMD_RESULT)
if(CMD_RESULT)
- message(FATAL_ERROR "Error running ${GCC_BIN}: ${CMD_RESULT}")
+ message(FATAL_ERROR "Error running gcc ${GCC_BIN}: ${CMD_RESULT}")
endif()
-execute_process(COMMAND ${OUTDIR}/pan -m10000 -a RESULT_VARIABLE CMD_RESULT)
+execute_process(COMMAND ${OUTDIR}/pan -m10000 -a WORKING_DIRECTORY ${OUTDIR} RESULT_VARIABLE CMD_RESULT)
if(CMD_RESULT)
message(FATAL_ERROR "Error running pan: ${CMD_RESULT}")
endif()
+#
+# message(STATUS "${TEST_OUT}")
+# file(WRITE ${OUTDIR}/${TEST_FILE_NAME}.pml.out ${TEST_OUT}) \ No newline at end of file