cmdlineTests.sh: When there's no input file assume input.sol instead of reporting an error

This commit is contained in:
Kamil Śliwak 2020-11-10 16:55:11 +01:00
parent eaba9a680a
commit 25badc4095

View File

@ -261,12 +261,6 @@ printTask "Running general commandline tests..."
inputFiles="$(find "${tdir}" -name 'input.*' -type f -exec printf "%s\n" "{}" \;)"
inputCount="$(echo "${inputFiles}" | wc -l)"
if (( ${inputCount} == 0 ))
then
printError "No input files found."
exit 1
fi
if (( ${inputCount} > 1 ))
then
printError "Ambiguous input. Found input files in multiple formats:"
@ -277,6 +271,11 @@ printTask "Running general commandline tests..."
# Use printf to get rid of the trailing newline
inputFile=$(printf "%s" "${inputFiles}")
# If no files specified, assume input.sol as the default
if [ -z "${inputFile}" ]; then
inputFile="${tdir}/input.sol"
fi
if [ "${inputFile}" = "${tdir}/input.json" ]
then
stdin="${inputFile}"