summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorEli Ribble <eliribble@google.com>2021-05-06 16:31:11 (GMT)
committerEli Ribble <eliribble@google.com>2021-05-06 16:31:11 (GMT)
commitf926cd4503f8d70d116752c3f5f3db9ea3d47eca (patch)
treea7f5b523b9bfb2bd2a2a1b27ba3082732ba2e34a /misc
parent770459d26f9985e4dbe4bdb1223bd21834458d4e (diff)
downloadNinja-f926cd4503f8d70d116752c3f5f3db9ea3d47eca.zip
Ninja-f926cd4503f8d70d116752c3f5f3db9ea3d47eca.tar.gz
Ninja-f926cd4503f8d70d116752c3f5f3db9ea3d47eca.tar.bz2
Add test for status suppression under '--quiet'.
This just tests that the flag works.
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/output_test.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/misc/output_test.py b/misc/output_test.py
index b63520f..6858e21 100755
--- a/misc/output_test.py
+++ b/misc/output_test.py
@@ -48,6 +48,15 @@ def run(build_ninja, flags='', pipe=False, env=default_env):
@unittest.skipIf(platform.system() == 'Windows', 'These test methods do not work on Windows')
class Output(unittest.TestCase):
+ BUILD_SIMPLE_ECHO = '\n'.join((
+ 'rule echo',
+ ' command = printf "do thing"',
+ ' description = echo $out',
+ '',
+ 'build a: echo',
+ '',
+ ))
+
def test_issue_1418(self):
self.assertEqual(run(
'''rule echo
@@ -111,5 +120,14 @@ red
def test_status(self):
self.assertEqual(run(''), 'ninja: no work to do.\n')
+ def test_ninja_status_default(self):
+ 'Do we show the default status by default?'
+ self.assertEqual(run(Output.BUILD_SIMPLE_ECHO), '[1/1] echo a\x1b[K\ndo thing\n')
+
+ def test_ninja_status_quiet(self):
+ 'Do we suppress the status information when --quiet is specified?'
+ output = run(Output.BUILD_SIMPLE_ECHO, flags='--quiet')
+ self.assertEqual(output, 'do thing\n')
+
if __name__ == '__main__':
unittest.main()