summaryrefslogtreecommitdiffstats
path: root/test/w3c/run_minimized_test.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'test/w3c/run_minimized_test.cmake')
-rw-r--r--test/w3c/run_minimized_test.cmake16
1 files changed, 16 insertions, 0 deletions
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()