@@ -24,32 +24,37 @@ CXXFLAGS += -Werror -Wextra -Wall
24
24
25
25
cwl_v1_2.h : FORCE
26
26
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" \
28
28
--codegen-spdx-license-identifier " Apache-2.0" \
29
29
https://github.com/common-workflow-language/cwl-v1.2/raw/main/CommonWorkflowLanguage.yml \
30
30
> $@
31
31
32
32
# # clean : clean up the build
33
33
clean : 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
35
35
36
36
# # regen_parser : regenerate the CWL v1.2 parser
37
37
regen_parser : cwl_v1_* .h
38
38
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
+
39
47
# # 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
53
58
FORCE :
54
59
55
60
# Use this to print the value of a Makefile variable
0 commit comments