diff options
author | David 'Digit' Turner <digit+github@google.com> | 2022-02-21 18:32:35 (GMT) |
---|---|---|
committer | David 'Digit' Turner <digit+github@google.com> | 2022-03-21 13:44:26 (GMT) |
commit | 988c847ee728de5520d07051843c02a17dd44777 (patch) | |
tree | 2576c688b1db657ebaa21a92a02bada0dca81e6f /misc | |
parent | 1463b1fc3135358ebb19d29448e99ef62e5f1ee6 (diff) | |
download | Ninja-988c847ee728de5520d07051843c02a17dd44777.zip Ninja-988c847ee728de5520d07051843c02a17dd44777.tar.gz Ninja-988c847ee728de5520d07051843c02a17dd44777.tar.bz2 |
Make the output of `ninja -t inputs` deterministic
This sorts the output of `ninja -t inputs` to make it
deterministic and remove duplicates, and adds a regression
test in output_test.py
+ Ensure all inputs are listed, not only explicit ones.
+ Document the `inputs` tool in doc/manual.asciidoc.
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/output_test.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/misc/output_test.py b/misc/output_test.py index 45698f1..141716c 100755 --- a/misc/output_test.py +++ b/misc/output_test.py @@ -134,5 +134,23 @@ red output = run(Output.BUILD_SIMPLE_ECHO, flags='-C$PWD', pipe=True) self.assertEqual(output.splitlines()[0][:25], "ninja: Entering directory") + def test_tool_inputs(self): + plan = ''' +rule cat + command = cat $in $out +build out1 : cat in1 +build out2 : cat in2 out1 +build out3 : cat out2 out1 | implicit || order_only +''' + self.assertEqual(run(plan, flags='-t inputs out3'), +'''implicit +in1 +in2 +order_only +out1 +out2 +''') + + if __name__ == '__main__': unittest.main() |