diff options
author | Celeste Wouters <perso@elementw.net> | 2021-12-11 18:08:44 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-12-15 21:21:29 +0100 |
commit | c5148d8c7365ae4da237cdb9b8f8b7904aac80ff (patch) | |
tree | 965a178ef478407e0567b052639eeb01f834d9eb /test cases | |
parent | a2934ca9d13ede4eb97b320bc768319ecad7b525 (diff) | |
download | meson-c5148d8c7365ae4da237cdb9b8f8b7904aac80ff.zip meson-c5148d8c7365ae4da237cdb9b8f8b7904aac80ff.tar.gz meson-c5148d8c7365ae4da237cdb9b8f8b7904aac80ff.tar.bz2 |
rewriter: create {add,rm}_extra_files commands
Add ability to mutate a target's `extra_files` list through the
rewriter.
The logic is copied from sources add/rm, but changes the `extra_files`
kwarg instead of the sources positional argument.
Has additional logic to handle creating the `extra_files` list if it
doesn't exist.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/rewrite/6 extra_files/addExtraFiles.json | 111 | ||||
-rw-r--r-- | test cases/rewrite/6 extra_files/info.json | 57 | ||||
-rw-r--r-- | test cases/rewrite/6 extra_files/meson.build | 21 | ||||
-rw-r--r-- | test cases/rewrite/6 extra_files/rmExtraFiles.json | 93 |
4 files changed, 282 insertions, 0 deletions
diff --git a/test cases/rewrite/6 extra_files/addExtraFiles.json b/test cases/rewrite/6 extra_files/addExtraFiles.json new file mode 100644 index 0000000..421ed92 --- /dev/null +++ b/test cases/rewrite/6 extra_files/addExtraFiles.json @@ -0,0 +1,111 @@ +[ + { + "type": "target", + "target": "trivialprog1", + "operation": "extra_files_add", + "sources": ["a2.hpp", "a1.hpp", "a2.hpp"] + }, + { + "type": "target", + "target": "trivialprog2", + "operation": "extra_files_add", + "sources": ["a7.hpp"] + }, + { + "type": "target", + "target": "trivialprog3", + "operation": "extra_files_add", + "sources": ["a5.hpp"] + }, + { + "type": "target", + "target": "trivialprog4", + "operation": "extra_files_add", + "sources": ["a5.hpp"] + }, + { + "type": "target", + "target": "trivialprog5", + "operation": "extra_files_add", + "sources": ["a3.hpp"] + }, + { + "type": "target", + "target": "trivialprog7", + "operation": "extra_files_add", + "sources": ["a6.hpp", "a1.hpp"] + }, + { + "type": "target", + "target": "trivialprog8", + "operation": "extra_files_add", + "sources": ["a2.hpp", "a7.hpp"] + }, + { + "type": "target", + "target": "trivialprog9", + "operation": "extra_files_add", + "sources": ["a9.hpp", "a8.hpp"] + }, + { + "type": "target", + "target": "trivialprog10", + "operation": "extra_files_add", + "sources": ["a4.hpp", "a1.hpp"] + }, + { + "type": "target", + "target": "trivialprog0", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog1", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog2", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog3", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog4", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog5", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog6", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog7", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog8", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog9", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog10", + "operation": "info" + } +] diff --git a/test cases/rewrite/6 extra_files/info.json b/test cases/rewrite/6 extra_files/info.json new file mode 100644 index 0000000..0f1a3bd --- /dev/null +++ b/test cases/rewrite/6 extra_files/info.json @@ -0,0 +1,57 @@ +[ + { + "type": "target", + "target": "trivialprog0", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog1", + "operation": "info" + }, + { + "type": "target", + "target": "exe2", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog3", + "operation": "info" + }, + { + "type": "target", + "target": "exe4", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog5", + "operation": "info" + }, + { + "type": "target", + "target": "exe6", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog7", + "operation": "info" + }, + { + "type": "target", + "target": "exe8", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog9", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog10", + "operation": "info" + } +] diff --git a/test cases/rewrite/6 extra_files/meson.build b/test cases/rewrite/6 extra_files/meson.build new file mode 100644 index 0000000..f9aab46 --- /dev/null +++ b/test cases/rewrite/6 extra_files/meson.build @@ -0,0 +1,21 @@ +project('rewritetest', 'cpp') + +ef1 = ['main.hpp', 'fileA.hpp'] +ef2 = files(['fileB.hpp', 'fileC.hpp']) +ef3 = ef1 +ef4 = [ef3] +ef5 = [] + +# Magic comment + +exe0 = executable('trivialprog0', 'main.cpp', extra_files : ef1 + ef2) +exe1 = executable('trivialprog1', 'main.cpp', extra_files : ef1) +exe2 = executable('trivialprog2', 'main.cpp', extra_files : [ef2]) +exe3 = executable('trivialprog3', 'main.cpp', extra_files : ['main.hpp', 'fileA.hpp']) +exe4 = executable('trivialprog4', 'main.cpp', extra_files : ['main.hpp', ['fileA.hpp']]) +exe5 = executable('trivialprog5', 'main.cpp', extra_files : [ef2, 'main.hpp']) +exe6 = executable('trivialprog6', 'main.cpp', extra_files : ef3) +executable('trivialprog7', 'main.cpp', extra_files : ef4) +exe8 = executable('trivialprog8', 'main.cpp', extra_files : []) +exe9 = executable('trivialprog9', 'main.cpp') +exe10 = executable('trivialprog10', 'main.cpp', extra_files : ef5) diff --git a/test cases/rewrite/6 extra_files/rmExtraFiles.json b/test cases/rewrite/6 extra_files/rmExtraFiles.json new file mode 100644 index 0000000..bd2855b --- /dev/null +++ b/test cases/rewrite/6 extra_files/rmExtraFiles.json @@ -0,0 +1,93 @@ +[ + { + "type": "target", + "target": "trivialprog1", + "operation": "extra_files_rm", + "sources": ["fileA.hpp"] + }, + { + "type": "target", + "target": "trivialprog3", + "operation": "extra_files_rm", + "sources": ["fileA.hpp"] + }, + { + "type": "target", + "target": "trivialprog4", + "operation": "extra_files_rm", + "sources": ["fileA.hpp"] + }, + { + "type": "target", + "target": "trivialprog5", + "operation": "extra_files_rm", + "sources": ["fileB.hpp"] + }, + { + "type": "target", + "target": "trivialprog6", + "operation": "extra_files_rm", + "sources": ["fileA.hpp"] + }, + { + "type": "target", + "target": "trivialprog7", + "operation": "extra_files_rm", + "sources": ["fileA.hpp"] + }, + { + "type": "target", + "target": "trivialprog0", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog1", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog2", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog3", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog4", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog5", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog6", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog7", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog8", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog9", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog10", + "operation": "info" + } +] |