shtest-run-at-line.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Check that -vv makes the line number of the failing RUN command clear.
  2. # (-v is actually sufficient in the case of the internal shell.)
  3. #
  4. # RUN: env -u FILECHECK_OPTS not %{lit} -j 1 -vv %{inputs}/shtest-run-at-line > %t.out
  5. # RUN: FileCheck --input-file %t.out %s
  6. #
  7. # END.
  8. # CHECK: Testing: 4 tests
  9. # In the case of the external shell, we check for only RUN lines in stderr in
  10. # case some shell implementations format "set -x" output differently.
  11. # CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/basic.txt
  12. # CHECK: Script:
  13. # CHECK: RUN: at line 4{{.*}} true
  14. # CHECK-NEXT: RUN: at line 5{{.*}} false
  15. # CHECK-NEXT: RUN: at line 6{{.*}} true
  16. # CHECK: RUN: at line 4
  17. # CHECK: RUN: at line 5
  18. # CHECK-NOT: RUN
  19. # CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/line-continuation.txt
  20. # CHECK: Script:
  21. # CHECK: RUN: at line 4{{.*}} echo 'foo bar' | FileCheck
  22. # CHECK-NEXT: RUN: at line 6{{.*}} echo 'foo baz' | FileCheck
  23. # CHECK-NEXT: RUN: at line 9{{.*}} echo 'foo bar' | FileCheck
  24. # CHECK: RUN: at line 4
  25. # CHECK: RUN: at line 6
  26. # CHECK-NOT: RUN
  27. # CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/basic.txt
  28. # CHECK: Script:
  29. # CHECK: : 'RUN: at line 1'; true
  30. # CHECK-NEXT: : 'RUN: at line 2'; false
  31. # CHECK-NEXT: : 'RUN: at line 3'; true
  32. # CHECK: Command Output (stdout)
  33. # CHECK: $ ":" "RUN: at line 1"
  34. # CHECK-NEXT: $ "true"
  35. # CHECK-NEXT: $ ":" "RUN: at line 2"
  36. # CHECK-NEXT: $ "false"
  37. # CHECK-NOT: RUN
  38. # CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/line-continuation.txt
  39. # CHECK: Script:
  40. # CHECK: : 'RUN: at line 1'; : first line continued to second line
  41. # CHECK-NEXT: : 'RUN: at line 3'; echo 'foo bar' | FileCheck
  42. # CHECK-NEXT: : 'RUN: at line 5'; echo 'foo baz' | FileCheck
  43. # CHECK-NEXT: : 'RUN: at line 8'; echo 'foo bar' | FileCheck
  44. # CHECK: Command Output (stdout)
  45. # CHECK: $ ":" "RUN: at line 1"
  46. # CHECK-NEXT: $ ":" "first" "line" "continued" "to" "second" "line"
  47. # CHECK-NEXT: $ ":" "RUN: at line 3"
  48. # CHECK-NEXT: $ "echo" "foo bar"
  49. # CHECK-NEXT: $ "FileCheck" "{{.*}}"
  50. # CHECK-NEXT: $ ":" "RUN: at line 5"
  51. # CHECK-NEXT: $ "echo" "foo baz"
  52. # CHECK-NEXT: $ "FileCheck" "{{.*}}"
  53. # CHECK-NOT: RUN