Merge pull request #10248 from ethereum/cmdline-tests-fix-input-file-count

cmdlineTests.sh: Fix buggy calculation of the number of input files
This commit is contained in:
chriseth 2020-11-11 14:47:20 +01:00 committed by GitHub
commit be7b2c3725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -256,11 +256,11 @@ printTask "Running general commandline tests..."
do do
printTask " - ${tdir}" printTask " - ${tdir}"
# Strip trailing slash from $tdir. `find` on MacOS X won't strip it and will produce double slashes. # Strip trailing slash from $tdir.
tdir=$(basename "${tdir}") tdir=$(basename "${tdir}")
inputFiles="$(find "${tdir}" -name 'input.*' -type f -exec printf "%s\n" "{}" \;)" inputFiles="$(ls -1 ${tdir}/input.* 2> /dev/null || true)"
inputCount="$(echo "${inputFiles}" | wc -l)" inputCount="$(echo ${inputFiles} | wc -w)"
if (( ${inputCount} > 1 )) if (( ${inputCount} > 1 ))
then then
printError "Ambiguous input. Found input files in multiple formats:" printError "Ambiguous input. Found input files in multiple formats:"