From: Martin Quinson Date: Sun, 12 Nov 2023 14:00:51 +0000 (+0100) Subject: Fix tesh autotests after recent change to display the command ASAP X-Git-Tag: v3.35~78 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2e2c91eaa94e8fa79a41bbcdd443f55ad2a37f19 Fix tesh autotests after recent change to display the command ASAP --- diff --git a/tools/tesh/IO-orders.tesh b/tools/tesh/IO-orders.tesh index e2c0a25d71..c7bbc672ee 100644 --- a/tools/tesh/IO-orders.tesh +++ b/tools/tesh/IO-orders.tesh @@ -7,6 +7,7 @@ p Order: in, out, cmd < $ cat > Test suite from stdin > [(stdin):3] cat +> > Test suite from stdin OK $ ${bindir:=.}/tesh @@ -16,6 +17,7 @@ p Order: out, in, cmd < $ cat > Test suite from stdin > [(stdin):3] cat +> > Test suite from stdin OK $ ${bindir:=.}/tesh @@ -25,6 +27,7 @@ p Order: out, cmd, in < < TOTO > Test suite from stdin > [(stdin):2] cat +> > Test suite from stdin OK $ ${bindir:=.}/tesh @@ -34,6 +37,7 @@ p Order: in, cmd, out < > TOTO > Test suite from stdin > [(stdin):2] cat +> > Test suite from stdin OK $ ${bindir:=.}/tesh @@ -43,6 +47,7 @@ p Order: cmd, out, in < < TOTO > Test suite from stdin > [(stdin):1] cat +> > Test suite from stdin OK $ ${bindir:=.}/tesh @@ -52,5 +57,6 @@ p Order: cmd, in, out < > TOTO > Test suite from stdin > [(stdin):1] cat +> > Test suite from stdin OK $ ${bindir:=.}/tesh diff --git a/tools/tesh/set-output-sort.tesh b/tools/tesh/set-output-sort.tesh index e560f56b0f..92b3400be2 100644 --- a/tools/tesh/set-output-sort.tesh +++ b/tools/tesh/set-output-sort.tesh @@ -75,19 +75,33 @@ $ ${bindir:=.}/tesh --ignore-jenkins > Test suite from stdin > [(stdin):1] Test sorting and filtering of output > [(stdin):3] true +> > [(stdin):6] true +> > [(stdin):8] printf 'profiling: foo\n' +> > [(stdin):10] printf 'profiling: foo' +> > [(stdin):13] printf 'profiling: foo\n' +> > [(stdin):16] printf 'profiling: foo' +> > [(stdin):18] printf 'a\nb\nc\nd\n' +> > [(stdin):24] printf 'a\nb\nc\nd' +> > [(stdin):31] printf 'c\nd\nb\na\n' +> > [(stdin):38] printf 'c\nd\nb\na' +> > [(stdin):44] printf 'a\nprofiling: foo\nprofiling: bar\nb\nc\nd\nprofiling: baz\n' +> > [(stdin):50] printf 'a\nprofiling: foo\nprofiling: bar\nb\nc\nd\nprofiling: baz' +> > [(stdin):57] printf 'c\nprofiling: foo\nprofiling: bar\nd\nb\na\nprofiling: baz\n' +> > [(stdin):64] printf 'c\nprofiling: foo\nprofiling: bar\nd\nb\na\nprofiling: baz' +> > Test suite from stdin OK p Check the Right Prefix Length (19) for "output sort" diff --git a/tools/tesh/tesh.py b/tools/tesh/tesh.py index bf95860e22..a1375b9aa4 100755 --- a/tools/tesh/tesh.py +++ b/tools/tesh/tesh.py @@ -354,8 +354,11 @@ class Cmd: self.args += TeshState().args_suffix logs = list() - print("[{file}:{number}] {args}".format(file=FileReader().filename, - number=self.linenumber, args=self.args), flush=True) + msg = "[{file}:{number}] {args}".format(file=FileReader().filename, number=self.linenumber, args=self.args) + if self.background: + logs.append(msg) + else: + print(msg, flush=True) args = shlex.split(self.args)