cmdlineTests: Allow providing content of the standard input when not testing via Standard JSON

This commit is contained in:
Kamil Śliwak 2021-04-10 21:56:22 +02:00
parent 4e4f46cde5
commit 59ef75cf5a
4 changed files with 17 additions and 1 deletions

View File

@ -304,13 +304,22 @@ printTask "Running general commandline tests..."
if [ "${inputFile}" = "${tdir}/input.json" ]
then
! [ -e "${tdir}/stdin" ] || { printError "Found a file called 'stdin' but redirecting standard input in JSON mode is not allowed."; exit 1; }
stdin="${inputFile}"
inputFile=""
stdout="$(cat "${tdir}/output.json" 2>/dev/null || true)"
stdoutExpectationFile="${tdir}/output.json"
command_args="--standard-json "$(cat "${tdir}/args" 2>/dev/null || true)
else
stdin=""
if [ -e "${tdir}/stdin" ]
then
stdin="${tdir}/stdin"
[ -f "${tdir}/stdin" ] || { printError "'stdin' is not a regular file."; exit 1; }
else
stdin=""
fi
stdout="$(cat "${tdir}/output" 2>/dev/null || true)"
stdoutExpectationFile="${tdir}/output"
command_args=$(cat "${tdir}/args" 2>/dev/null || true)

View File

@ -0,0 +1 @@
-

View File

@ -0,0 +1,5 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> <stdin>
Warning: Source file does not specify required compiler version!
--> <stdin>

View File

@ -0,0 +1 @@
contract C {}