@@ -24,32 +24,37 @@ CXXFLAGS += -Werror -Wextra -Wall
2424
2525cwl_v1_2.h : FORCE
2626 schema-salad-tool --codegen cpp \
27- --codegen-spdx-copyright-text " Copyright 2016-2023 CWL Project Contributors" \
27+ --codegen-spdx-copyright-text " Copyright 2016-2024 CWL Project Contributors" \
2828 --codegen-spdx-license-identifier " Apache-2.0" \
2929 https://github.com/common-workflow-language/cwl-v1.2/raw/main/CommonWorkflowLanguage.yml \
3030 > $@
3131
3232# # clean : clean up the build
3333clean : FORCE
34- rm -f cwl_output_example cwl_input_example output_cwl.cwl
34+ rm -f cwl_output_example cwl_input_example cwl_input_example_store_config
3535
3636# # regen_parser : regenerate the CWL v1.2 parser
3737regen_parser : cwl_v1_* .h
3838
39+ define run_test
40+ @result="$(shell eval $(1 ) | md5sum -b) " ; \
41+ expected="$(shell eval $(2 ) | md5sum -b) " ; \
42+ if [ "$$result" != "$$expected" ] ; then \
43+ echo test failed '$(1 ) ': $$result != $$expected; exit 1; \
44+ fi;
45+ endef
46+
3947# # tests : compile and run the tests
40- tests : FORCE cwl_output_example cwl_input_example
41- @result_output=" $( shell ./cwl_output_example | md5sum -b) " ; \
42- result_input=" $( shell ./cwl_input_example expected_cwl.cwl | md5sum -b) " ; \
43- expected=" $( shell cat expected_cwl.cwl | md5sum -b) " ; \
44- if [ " $$ result_output" = " $$ expected" ] ; then \
45- if [ " $$ result_input" = " $$ expected" ] ; then \
46- echo test passed ; \
47- else \
48- echo test failed cwl_input_example $$ result_input ! = $$ expected; exit 1; \
49- fi \
50- else \
51- echo test failed cwl_output_example $$ result_output ! = $$ expected; exit 1; \
52- fi
48+ tests : FORCE cwl_output_example cwl_input_example cwl_input_example_store_config
49+ $(call run_test,./cwl_output_example,cat tests/expected_cwl.cwl)
50+ $(call run_test,./cwl_input_example tests/expected_cwl.cwl,cat tests/expected_cwl.cwl)
51+ $(call run_test,./cwl_input_example_store_config tests/01_types.cwl,cat tests/01_types_expected.cwl)
52+ $(call run_test,./cwl_input_example_store_config tests/01_types.cwl no_simplification,cat tests/01_types_expected_no_simplification.cwl)
53+ $(call run_test,./cwl_input_example_store_config tests/01_types.cwl no_list_to_map,cat tests/01_types_expected_no_list_to_map.cwl)
54+ $(call run_test,./cwl_input_example_store_config tests/01_types.cwl no_simplification no_list_to_map,cat tests/01_types_expected_no_simplification_and_list_to_map.cwl)
55+ $(call run_test,./cwl_input_example tests/02_expression.cwl,cat tests/02_expression_expected.cwl)
56+
57+ @echo test passed
5358FORCE :
5459
5560# Use this to print the value of a Makefile variable
0 commit comments