From 5121a6235463f97d60fd91f0ae40e0899142db6c Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 21 Jul 2013 22:16:50 +0100 Subject: Make --quiet win over --verbose --- yarn | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/yarn b/yarn index 6845345..97d5354 100755 --- a/yarn +++ b/yarn @@ -89,11 +89,12 @@ class YarnRunner(cliapp.Application): self.ts.error(msg) def process_args(self, args): - # Do we have tty? If not, turn on --verbose. - try: - open('/dev/tty', 'w') - except IOError: - self.settings['verbose'] = True + # Do we have tty? If not, turn on --verbose, unless --quiet. + if not self.settings['quiet']: + try: + open('/dev/tty', 'w') + except IOError: + self.settings['verbose'] = True self.ts = ttystatus.TerminalStatus(period=0.001) if not self.settings['quiet'] and not self.settings['verbose']: -- cgit v1.2.1 From f02f04190d1973b04790fd60968190b92ba67ef3 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 21 Jul 2013 22:36:48 +0100 Subject: Make test suite invoke yarn with --quiet --- yarn.tests/multi.script | 2 +- yarn.tests/multi.stdout | 1 - yarn.tests/simple.script | 2 +- yarn.tests/simple.stderr | 6 ------ 4 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 yarn.tests/multi.stdout diff --git a/yarn.tests/multi.script b/yarn.tests/multi.script index 35818fa..5e08cba 100755 --- a/yarn.tests/multi.script +++ b/yarn.tests/multi.script @@ -19,5 +19,5 @@ cat < "$DATADIR/2.yarn" true EOF -./yarn "$DATADIR/1.yarn" "$DATADIR/2.yarn" | +./yarn -q "$DATADIR/1.yarn" "$DATADIR/2.yarn" | sed 's/, in .* seconds$//' diff --git a/yarn.tests/multi.stdout b/yarn.tests/multi.stdout deleted file mode 100644 index 22c4303..0000000 --- a/yarn.tests/multi.stdout +++ /dev/null @@ -1 +0,0 @@ -Scenario test suite PASS, with 1 scenarios diff --git a/yarn.tests/simple.script b/yarn.tests/simple.script index 3382af7..9cd3398 100755 --- a/yarn.tests/simple.script +++ b/yarn.tests/simple.script @@ -2,4 +2,4 @@ set -eu -./yarn simple.scenario +./yarn -q simple.scenario diff --git a/yarn.tests/simple.stderr b/yarn.tests/simple.stderr index 3df1113..df917a0 100644 --- a/yarn.tests/simple.stderr +++ b/yarn.tests/simple.stderr @@ -1,7 +1 @@ -ERROR: In scenario "a simple scenario" -step "THEN not all is well" failed, -with exit code 1: -Standard output from shell command: -Standard error from shell command: - ERROR: Test suite FAILED in 1 scenarios -- cgit v1.2.1 From b85ce2b1ee32503cd251f3d45548d22057a66837 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 22 Jul 2013 08:06:54 +0100 Subject: Run yarn in tests without user's config --- yarn.tests/assuming-failure.script | 2 +- yarn.tests/assuming.script | 2 +- yarn.tests/finally.script | 2 +- yarn.tests/multi.script | 2 +- yarn.tests/no-act.script | 2 +- yarn.tests/selected-test.script | 2 +- yarn.tests/shell-lib.script | 2 +- yarn.tests/simple.script | 2 +- yarn.tests/snapshot.script | 2 +- yarn.tests/warn-if-empty.script | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/yarn.tests/assuming-failure.script b/yarn.tests/assuming-failure.script index f630294..9752e39 100755 --- a/yarn.tests/assuming-failure.script +++ b/yarn.tests/assuming-failure.script @@ -17,7 +17,7 @@ cat < "$DATADIR/test.yarn" touch "$DATADIR/cleanup-flag" EOF -./yarn -q "$DATADIR/test.yarn" +./run-yarn "$DATADIR/test.yarn" [ ! -e "$DATADIR/then-flag" ] [ ! -e "$DATADIR/cleanup-flag" ] diff --git a/yarn.tests/assuming.script b/yarn.tests/assuming.script index 9471280..52eee36 100755 --- a/yarn.tests/assuming.script +++ b/yarn.tests/assuming.script @@ -17,7 +17,7 @@ cat < "$DATADIR/test.yarn" touch "$DATADIR/cleanup-flag" EOF -./yarn -q "$DATADIR/test.yarn" +./run-yarn "$DATADIR/test.yarn" [ -e "$DATADIR/then-flag" ] [ -e "$DATADIR/cleanup-flag" ] diff --git a/yarn.tests/finally.script b/yarn.tests/finally.script index 2d383a0..4e05d2e 100755 --- a/yarn.tests/finally.script +++ b/yarn.tests/finally.script @@ -22,5 +22,5 @@ cat < "$DATADIR/finally.yarn" touch "$DATADIR/finally.has.run" EOF -./yarn -q "$DATADIR/finally.yarn" +./run-yarn "$DATADIR/finally.yarn" test -e "$DATADIR/finally.has.run" diff --git a/yarn.tests/multi.script b/yarn.tests/multi.script index 5e08cba..c8131da 100755 --- a/yarn.tests/multi.script +++ b/yarn.tests/multi.script @@ -19,5 +19,5 @@ cat < "$DATADIR/2.yarn" true EOF -./yarn -q "$DATADIR/1.yarn" "$DATADIR/2.yarn" | +./run-yarn "$DATADIR/1.yarn" "$DATADIR/2.yarn" | sed 's/, in .* seconds$//' diff --git a/yarn.tests/no-act.script b/yarn.tests/no-act.script index 983f115..cc924da 100755 --- a/yarn.tests/no-act.script +++ b/yarn.tests/no-act.script @@ -19,4 +19,4 @@ cat < "$DATADIR/fail.yarn" false EOF -./yarn -q -n "$DATADIR/fail.yarn" +./run-yarn -n "$DATADIR/fail.yarn" diff --git a/yarn.tests/selected-test.script b/yarn.tests/selected-test.script index 69c1679..2c4521d 100755 --- a/yarn.tests/selected-test.script +++ b/yarn.tests/selected-test.script @@ -13,6 +13,6 @@ cat << EOF > "$DATADIR/test.yarn" touch "$DATADIR/\$MATCH_1" EOF -./yarn -q "$DATADIR/test.yarn" --run 'foo test' +./run-yarn "$DATADIR/test.yarn" --run 'foo test' test -e "$DATADIR/foo" ! test -e "$DATADIR/bar" diff --git a/yarn.tests/shell-lib.script b/yarn.tests/shell-lib.script index fb820d4..68e4eb1 100755 --- a/yarn.tests/shell-lib.script +++ b/yarn.tests/shell-lib.script @@ -2,4 +2,4 @@ set -eu -./yarn -q --shell-library shell-lib.sh shell-lib.yarn +./run-yarn --shell-library shell-lib.sh shell-lib.yarn diff --git a/yarn.tests/simple.script b/yarn.tests/simple.script index 9cd3398..70d6103 100755 --- a/yarn.tests/simple.script +++ b/yarn.tests/simple.script @@ -2,4 +2,4 @@ set -eu -./yarn -q simple.scenario +./run-yarn simple.scenario diff --git a/yarn.tests/snapshot.script b/yarn.tests/snapshot.script index e8947ad..def73a8 100755 --- a/yarn.tests/snapshot.script +++ b/yarn.tests/snapshot.script @@ -23,7 +23,7 @@ cat << EOF > "$DATADIR/foo.yarn" touch "\$DATADIR/\$MATCH_1.then" EOF -./yarn -q --snapshot --tempdir "$DATADIR/tmp" "$DATADIR/foo.yarn" +./run-yarn --snapshot --tempdir "$DATADIR/tmp" "$DATADIR/foo.yarn" test -e "$DATADIR/tmp/bar" test -e "$DATADIR/tmp/bar/datadir" diff --git a/yarn.tests/warn-if-empty.script b/yarn.tests/warn-if-empty.script index 3594929..03be52d 100755 --- a/yarn.tests/warn-if-empty.script +++ b/yarn.tests/warn-if-empty.script @@ -6,5 +6,5 @@ touch "$DATADIR/empty.yarn" # The grep below will fail unless the string exists, thereby failing the # entire test. -./yarn --log=/dev/stdout "$DATADIR/empty.yarn" 2>&1 | +./run-yarn --no-quiet --log=/dev/stdout "$DATADIR/empty.yarn" 2>&1 | grep 'No scenario code blocks' > /dev/null -- cgit v1.2.1 From bd08b2ffd465dbaeca826d7f30933e3843beaf58 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 22 Jul 2013 08:28:57 +0100 Subject: Add the run-yarn script --- run-yarn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 run-yarn diff --git a/run-yarn b/run-yarn new file mode 100755 index 0000000..596996f --- /dev/null +++ b/run-yarn @@ -0,0 +1,5 @@ +#!/bin/sh + +set -eu + +./yarn --no-default-config --quiet "$@" -- cgit v1.2.1