summaryrefslogtreecommitdiff
path: root/tests/test_cases/config/TARGETS
diff options
context:
space:
mode:
authorAlberto Sartori <alberto.sartori@huawei.com>2024-12-09 18:27:55 +0100
committerAlberto Sartori <alberto.sartori@huawei.com>2024-12-12 10:03:18 +0100
commit0eb56d57a2f24c603981f34b5dfe21e14e810cfc (patch)
tree951beed68bd843f0d597e5cb56376c07b1652dad /tests/test_cases/config/TARGETS
parentd7e42b7d8e2f5951ce4d38584014534e7d6d2ab1 (diff)
downloadrules-cc-0eb56d57a2f24c603981f34b5dfe21e14e810cfc.tar.gz
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`.
Diffstat (limited to 'tests/test_cases/config/TARGETS')
-rw-r--r--tests/test_cases/config/TARGETS57
1 files changed, 57 insertions, 0 deletions
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"]}
+}