Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't pass --log to tesh: the perl version ignores it anyway
[simgrid.git] / tools / tesh / set-output-sort.tesh
1 #! ./tesh
2
3 p This tests whether TESH correctly sorts command output
4
5 $ ${bindir:=.}/tesh --enable-coverage set-output-sort-1.tesh
6 > Enable coverage
7 > Test suite `set-output-sort-1'
8 > [set-output-sort-1:1] Test sorting and filtering of output
9 > [set-output-sort-1:3] true
10 > [set-output-sort-1:6] true
11 > [set-output-sort-1:8] printf 'profiling: foo\\n'
12 > [set-output-sort-1:10] printf 'profiling: foo'
13 > [set-output-sort-1:13] printf 'profiling: foo\\n'
14 > [set-output-sort-1:16] printf 'profiling: foo'
15 > [set-output-sort-1:18] printf 'a\\nb\\nc\\nd\\n'
16 > [set-output-sort-1:24] printf 'a\\nb\\nc\\nd'
17 > [set-output-sort-1:31] printf 'c\\nd\\nb\\na\\n'
18 > [set-output-sort-1:38] printf 'c\\nd\\nb\\na'
19 > [set-output-sort-1:44] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz\\n'
20 > [set-output-sort-1:50] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz'
21 > [set-output-sort-1:57] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz\\n'
22 > [set-output-sort-1:64] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz'
23 > Test suite `set-output-sort-1' OK
24
25 p Check the Right Prefix Length (19) for "output sort"
26 ! output sort 19
27 < 12345678901234567 B line
28 < 12345678901234567 A line
29 $ cat
30 > 12345678901234567 A line
31 > 12345678901234567 B line
32
33 ! output sort 19
34 < 123456789012345678 B line
35 < 123456789012345678 A line
36 $ cat
37 > 123456789012345678 B line
38 > 123456789012345678 A line
39
40 ! expect return 2
41 ! output ignore
42 < ! output sort 19
43 < < 123456789012345678 B line
44 < < 123456789012345678 A line
45 < $ cat
46 < > 123456789012345678 A line
47 < > 123456789012345678 B line
48 $ ${bindir:=.}/tesh --enable-coverage
49
50 p Check user-defined prefix length for "output sort"
51 ! output sort 5
52 < 000 B line
53 < 000 A line
54 $ cat
55 > 000 A line
56 > 000 B line
57
58 ! output sort 4
59 < 000 B line
60 < 000 A line
61 $ cat
62 > 000 B line
63 > 000 A line
64
65 ! expect return 2
66 ! output ignore
67 < ! output sort 4
68 < < 000 B line
69 < < 000 A line
70 < $ cat
71 < > 000 A line
72 < > 000 B line
73 $ ${bindir:=.}/tesh --enable-coverage