From 0eb56d57a2f24c603981f34b5dfe21e14e810cfc Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Mon, 9 Dec 2024 18:27:55 +0100 Subject: tests: define test cases for ["CC/auto","config_file"] rule The unit tests for runner can be run via the ["test_cases/config", "pytest"] target, which requires `pytest` and `hypothesis`. --- tests/test_cases/config/TARGETS | 57 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/test_cases/config/TARGETS (limited to 'tests/test_cases/config/TARGETS') diff --git a/tests/test_cases/config/TARGETS b/tests/test_cases/config/TARGETS new file mode 100644 index 0000000..b751130 --- /dev/null +++ b/tests/test_cases/config/TARGETS @@ -0,0 +1,57 @@ +{ "both": + { "type": ["test_rules", "test_case"] + , "name": ["config_both"] + , "targets": ["+header_both"] + , "asserts": + [ "test -f header_both/foo.h" + , "cat header_both/foo.h" + , "grep '// comment 1$' header_both/foo.h" + , "grep '#define FOO 1$' header_both/foo.h" + , "grep '#define BAX 0$' header_both/foo.h" + , "grep '#define BAR \"foofoo bar foo\"$' header_both/foo.h" + , "grep '/\\* #undef BAZ \\*/$' header_both/foo.h" + , "grep '/\\* #undef BAX \\*/$' header_both/foo.h" + , "grep '#define FOO$' header_both/foo.h" + , "grep '// comment 2$' header_both/foo.h" + , "grep 'magic_at$' header_both/foo.h" + , "grep 'magic_curly$' header_both/foo.h" + , "grep 'undefined_at--$' header_both/foo.h" + , "grep 'undefined_curly--$' header_both/foo.h" + ] + , "data": [["TREE", null, "data"]] + } +, "@only": + { "type": ["test_rules", "test_case"] + , "name": ["config_@only"] + , "targets": ["+header_@only"] + , "asserts": + [ "test -f header_@only/foo.h" + , "cat header_@only/foo.h" + , "grep '// comment 1$' header_@only/foo.h" + , "grep '#define FOO 1$' header_@only/foo.h" + , "grep '#define BAX 0$' header_@only/foo.h" + , "grep '#define BAR \"foofoo bar \\${FOO}\"$' header_@only/foo.h" + , "grep '/\\* #undef BAZ \\*/$' header_@only/foo.h" + , "grep '/\\* #undef BAX \\*/$' header_@only/foo.h" + , "grep '#define FOO$' header_@only/foo.h" + , "grep '// comment 2$' header_@only/foo.h" + , "grep 'magic_at$' header_@only/foo.h" + , "grep '\\${NO_MAGIC_CURLY}' header_@only/foo.h" + , "grep 'undefined_at--$' header_@only/foo.h" + , "grep 'undefined_curly-\\${UNDEFINED}-$' header_@only/foo.h" + ] + , "data": [["TREE", null, "data"]] + } +, "runner.py": + { "type": "install" + , "files": {"runner.py": ["@", "rules", "CC/auto", "runner"]} + } +, "pytest": + { "type": ["@", "rules", "shell/test", "script"] + , "name": ["config_pytest"] + , "test": ["run_pytest.sh"] + , "deps": ["runner.py", "runner_test.py"] + } +, "ALL": + {"type": "install", "deps": ["both", "@only", "pytest"], "tainted": ["test"]} +} -- cgit v1.2.3