diff options
Diffstat (limited to 'test/w3c/run_promela_test.cmake')
-rw-r--r-- | test/w3c/run_promela_test.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/w3c/run_promela_test.cmake b/test/w3c/run_promela_test.cmake new file mode 100644 index 0000000..e46ab60 --- /dev/null +++ b/test/w3c/run_promela_test.cmake @@ -0,0 +1,23 @@ +# convert given file to promela and run spin + +get_filename_component(TEST_FILE_NAME ${TESTFILE} NAME) + +execute_process(COMMAND ${USCXML_TRANSFORM_BIN} -s -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) +if(CMD_RESULT) + message(FATAL_ERROR "Error running ${SPIN_BIN}: ${CMD_RESULT}") +endif() + +execute_process(COMMAND ${GCC_BIN} -DMEMLIM=1024 -O2 -DXUSAFE -w -o ${OUTDIR}/pan ${OUTDIR}/pan.c RESULT_VARIABLE CMD_RESULT) +if(CMD_RESULT) + message(FATAL_ERROR "Error running ${GCC_BIN}: ${CMD_RESULT}") +endif() + +execute_process(COMMAND ${OUTDIR}/pan -m10000 -a RESULT_VARIABLE CMD_RESULT) +if(CMD_RESULT) + message(FATAL_ERROR "Error running pan: ${CMD_RESULT}") +endif() |