From b81636681210b56caa0b9ad2d84118c8f355a186 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 14 Aug 2020 17:32:01 +0200 Subject: Add empty syntax type for suppressing output --- wscript | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'wscript') diff --git a/wscript b/wscript index cb930677..8b30fea5 100644 --- a/wscript +++ b/wscript @@ -672,9 +672,16 @@ def test(tst): check([serdi, '-h']) check([serdi, '-k', '512', '-s', ' a <#Thingie> .']) check([serdi, os.devnull]) + with tempfile.TemporaryFile(mode='r') as stdin: check([serdi, '-'], stdin=stdin) + with tempfile.TemporaryFile(mode='w') as stdout: + cmd = [serdi, '-o', 'empty', '%s/serd.ttl' % srcdir] + check(cmd, stdout=stdout) + stdout.seek(0, 2) # Seek to end + check(lambda: stdout.tell() == 0, name='empty output') + with tst.group('BadCommands', expected=1, stderr=autowaf.NONEMPTY) as check: -- cgit v1.2.1