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/data/TARGETS | 48 ++++++++++++++++++++++++++++++++++++ tests/test_cases/config/data/foo.in | 13 ++++++++++ 2 files changed, 61 insertions(+) create mode 100644 tests/test_cases/config/data/TARGETS create mode 100644 tests/test_cases/config/data/foo.in (limited to 'tests/test_cases/config/data') diff --git a/tests/test_cases/config/data/TARGETS b/tests/test_cases/config/data/TARGETS new file mode 100644 index 0000000..f3e7cf0 --- /dev/null +++ b/tests/test_cases/config/data/TARGETS @@ -0,0 +1,48 @@ +{ "blueprint": + { "type": ["@", "rules", "CC/auto", "config_file"] + , "input": ["foo.in"] + , "output": ["foo.h"] + , "magic_string": ["cmakedefine"] + } +, "blueprint_@only": + { "type": ["@", "rules", "CC/auto", "config_file"] + , "input": ["foo.in"] + , "output": ["foo.h"] + , "magic_string": ["cmakedefine"] + , "@only": ["true"] + } +, "header_both": + { "type": "configure" + , "target": "blueprint" + , "config": + { "type": "let*" + , "bindings": + [ [ "defines" + , [ ["FOO", "foo"] + , ["BAR", "bar"] + , ["NO_MAGIC_AT", "magic_at"] + , ["NO_MAGIC_CURLY", "magic_curly"] + ] + ] + ] + , "body": {"type": "env", "vars": ["defines"]} + } + } +, "header_@only": + { "type": "configure" + , "target": "blueprint_@only" + , "config": + { "type": "let*" + , "bindings": + [ [ "defines" + , [ ["FOO", "foo"] + , ["BAR", "bar"] + , ["NO_MAGIC_AT", "magic_at"] + , ["NO_MAGIC_CURLY", "magic_curly"] + ] + ] + ] + , "body": {"type": "env", "vars": ["defines"]} + } + } +} diff --git a/tests/test_cases/config/data/foo.in b/tests/test_cases/config/data/foo.in new file mode 100644 index 0000000..66bd9ba --- /dev/null +++ b/tests/test_cases/config/data/foo.in @@ -0,0 +1,13 @@ +// comment 1 +#cmakedefine01 FOO +#cmakedefine01 BAX +#cmakedefine FOO "@FOO@" +#cmakedefine BAR "@FOO@@FOO@ bar ${FOO}" +#cmakedefine BAZ "baz" +#cmakedefine BAX +#cmakedefine FOO +// comment 2 +@NO_MAGIC_AT@ +${NO_MAGIC_CURLY} +undefined_at-@UNDEFINED@- +undefined_curly-${UNDEFINED}- -- cgit v1.2.3