112 lines · python
1# Check that -a/-v/-vv makes the line number of the failing RUN command clear.2 3 4# RUN: not %{lit} -a %{inputs}/shtest-run-at-line | %{filter-lit} | FileCheck %s5# RUN: not %{lit} -v %{inputs}/shtest-run-at-line | %{filter-lit} | FileCheck %s6# RUN: not %{lit} -vv %{inputs}/shtest-run-at-line | %{filter-lit} | FileCheck %s7# END.8 9 10# CHECK: Testing: 8 tests11 12 13# In the case of the external shell, we check for only RUN lines in stderr in14# case some shell implementations format "set -x" output differently.15 16# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/basic.txt17 18# CHECK: Command Output (stderr)19# CHECK-NEXT: --20# CHECK-NEXT: {{^}}true # RUN: at line 4{{$}}21# CHECK-NEXT: true22# CHECK-NEXT: {{^}}false # RUN: at line 5{{$}}23# CHECK-NEXT: false24# CHECK-EMPTY:25# CHECK-NEXT: --26 27# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/empty-run-line.txt28 29# CHECK: Command Output (stderr)30# CHECK-NEXT: --31# CHECK-NEXT: {{^}}RUN: at line 2 has no command after substitutions{{$}}32# CHECK-NEXT: {{^}}false # RUN: at line 3{{$}}33# CHECK-NEXT: false34# CHECK-EMPTY:35# CHECK-NEXT: --36 37# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/line-continuation.txt38 39# The execution trace from an external sh-like shell might print the commands40# from a pipeline in any order, so this time just check that lit suppresses the41# trace of the echo command for each 'RUN: at line N: cmd-line'.42 43# CHECK: Command Output (stderr)44# CHECK-NEXT: --45# CHECK-NEXT: {{^}}echo 'foo bar' | FileCheck {{.*}} # RUN: at line 4 46# CHECK-NOT: RUN47# CHECK: {{^}}echo 'foo baz' | FileCheck {{.*}} # RUN: at line 6 48# CHECK-NOT: RUN49# CHECK: --50 51# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/run-line-with-newline.txt52 53# CHECK: Command Output (stderr)54# CHECK-NEXT: --55# CHECK-NEXT: {{^}}echo abc |56# CHECK-NEXT: FileCheck {{.*}} &&57# CHECK-NEXT: false # RUN: at line 158# CHECK-NOT: RUN59 60 61# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/basic.txt62 63# CHECK: Command Output (stdout)64# CHECK-NEXT: --65# CHECK-NEXT: # RUN: at line 166# CHECK-NEXT: true67# CHECK-NEXT: # executed command: true68# CHECK-NEXT: # RUN: at line 269# CHECK-NEXT: false70# CHECK-NEXT: # executed command: false71# CHECK-NOT: RUN72 73# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/empty-run-line.txt74 75# CHECK: Command Output (stdout)76# CHECK-NEXT: --77# CHECK-NEXT: # RUN: at line 2 has no command after substitutions78# CHECK-NEXT: # RUN: at line 379# CHECK-NEXT: false80# CHECK-NEXT: # executed command: false81# CHECK-NOT: RUN82 83# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/line-continuation.txt84 85# CHECK: Command Output (stdout)86# CHECK-NEXT: --87# CHECK-NEXT: # RUN: at line 188# CHECK-NEXT: : first line continued to second line89# CHECK-NEXT: # executed command: : first line continued to second line90# CHECK-NEXT: # RUN: at line 391# CHECK-NEXT: echo 'foo bar' | FileCheck {{.*}}92# CHECK-NEXT: # executed command: echo 'foo bar'93# CHECK-NEXT: # executed command: FileCheck {{.*}}94# CHECK-NEXT: # RUN: at line 595# CHECK-NEXT: echo 'foo baz' | FileCheck {{.*}}96# CHECK-NEXT: # executed command: echo 'foo baz'97# CHECK-NEXT: # executed command: FileCheck {{.*}}98# CHECK-NOT: RUN99 100# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/run-line-with-newline.txt101 102# CHECK: Command Output (stdout)103# CHECK-NEXT: --104# CHECK-NEXT: # RUN: at line 1105# CHECK-NEXT: echo abc |106# CHECK-NEXT: FileCheck {{.*}} &&107# CHECK-NEXT: false108# CHECK-NEXT: # executed command: echo abc109# CHECK-NEXT: # executed command: FileCheck {{.*}}110# CHECK-NEXT: # executed command: false111# CHECK-NOT: RUN112