When using win32 cmd.exe, turn off command echoing at the beginning of
the script (@echo off).
Replace a bash shell script with a python script for the
fail_with_bad_encoding test.
llvm-svn: 309399
mode += 'b' # Avoid CRLFs when writing bash scripts.
f = open(script, mode)
if isWin32CMDEXE:
+ f.write('@echo off\n')
f.write('\nif %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands))
else:
if test.config.pipefail:
# Run a command that fails with error on stdout.
#
-# RUN: %S/write-bad-encoding.sh
+# RUN: python %S/write-bad-encoding.py
# RUN: false
--- /dev/null
+#!/usr/bin/env python
+
+import sys
+
+sys.stdout.write(b"a line with bad encoding: \xc2.")
+sys.stdout.flush()
+++ /dev/null
-#!/bin/sh
-
-echo "a line with bad encoding: Â."