aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/runner/test-runner.testscript
blob: 372330b80a3c347db979da7a8903004c74d2021b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# file      : tests/test/script/runner/test-runner.testscript
# license   : MIT; see accompanying LICENSE file

.include ../common.testscript

+if ($cxx.target.class == 'windows')
  exit
end

+cat <<EOI >=run
  #!/bin/sh
  if test "$1" = "--trace"; then
    shift
    echo "$*"
  fi
  "$@"
  EOI

+chmod u+x run

run=$~/run

: basic
:
$c <<EOI && $b "config.test.runner=$run --trace"
  +cat <'text' >'text'         # Non-test program.

  +$* -o 'text' >>~%EOO%       # Test program.
    %.+/driver -o text%
    text
    EOO

  {
    prog = $0
    test=cat

    +cat <'text' >>EOO         # Test program.
      cat
      text
      EOO

    +$prog -o 'text' >>~%EOO%  # Non-test program.
      text
      EOO

    test=$prog

    {
      cat <'text' >'text';     # Non-test program.

      $* -o 'text' >>~%EOO%    # Test program.
        %.+/driver -o text%
        text
        EOO
    }
  }
  EOI