Index: utils/lit/tests/Inputs/shtest-shell/lit.cfg =================================================================== --- utils/lit/tests/Inputs/shtest-shell/lit.cfg +++ utils/lit/tests/Inputs/shtest-shell/lit.cfg @@ -4,3 +4,4 @@ config.test_format = lit.formats.ShTest() config.test_source_root = None config.test_exec_root = None +config.substitutions.append(('%{python}', sys.executable)) Index: utils/lit/tests/Inputs/shtest-shell/redirects.txt =================================================================== --- utils/lit/tests/Inputs/shtest-shell/redirects.txt +++ utils/lit/tests/Inputs/shtest-shell/redirects.txt @@ -17,13 +17,13 @@ # Check stderr redirect (2> and 2>>). # # RUN: echo "not-present" > %t.stderr-write -# RUN: %S/write-to-stderr.sh 2> %t.stderr-write +# RUN: %{python} %S/write-to-stderr.py 2> %t.stderr-write # RUN: FileCheck --check-prefix=STDERR-WRITE < %t.stderr-write %s # # STDERR-WRITE-NOT: not-present # STDERR-WRITE: a line on stderr # -# RUN: %S/write-to-stderr.sh 2>> %t.stderr-write +# RUN: %{python} %S/write-to-stderr.py 2>> %t.stderr-write # RUN: FileCheck --check-prefix=STDERR-APPEND < %t.stderr-write %s # # STDERR-APPEND: a line on stderr @@ -33,7 +33,7 @@ # Check combined redirect (&>). # # RUN: echo "not-present" > %t.combined -# RUN: %S/write-to-stdout-and-stderr.sh &> %t.combined +# RUN: %{python} %S/write-to-stdout-and-stderr.py &> %t.combined # RUN: FileCheck --check-prefix=COMBINED-WRITE < %t.combined %s # # COMBINED-WRITE-NOT: not-present Index: utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py =================================================================== --- /dev/null +++ utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +import sys + + +sys.stderr.write('a line on stderr\n') Index: utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh =================================================================== --- utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -echo "a line on stderr" 1>&2 Index: utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py =================================================================== --- /dev/null +++ utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python + +import sys + + +sys.stdout.write('a line on stdout\n') +sys.stderr.write('a line on stderr\n') Index: utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh =================================================================== --- utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -echo "a line on stdout" -echo "a line on stderr" 1>&2