225
225
if jq ' has("ethdebug")' " $stdout_path " --exit-status > /dev/null; then
226
226
local temporary_file
227
227
temporary_file=$( mktemp -t cmdline-ethdebug-XXXXXX.tmp)
228
- if [[ -e ${tdir} / strip-ethdebug ]]; then
228
+ if [[ -e strip-ethdebug ]]; then
229
229
jq --indent 4 '
230
230
(. | .. | objects | select(has("ethdebug"))) |= (.ethdebug = "<ETHDEBUG DEBUG DATA REMOVED>")
231
231
' " $stdout_path " > " $temporary_file "
@@ -350,9 +350,11 @@ test_solc_behaviour "${0}" "ctx:=/some/remapping/target" "" "" 1 "" "Error: Inva
350
350
351
351
printTask " Running general commandline tests..."
352
352
(
353
- cd " $REPO_ROOT " /test/cmdlineTests/
354
353
for tdir in " ${selected_tests[@]} "
355
354
do
355
+ # go back to the test root dir
356
+ cd " $REPO_ROOT " /test/cmdlineTests/
357
+
356
358
if ! [[ -d $tdir ]]
357
359
then
358
360
fail " Test directory not found: $tdir "
@@ -377,10 +379,13 @@ printTask "Running general commandline tests..."
377
379
fi
378
380
fi
379
381
380
- scriptFiles=" $( ls -1 " ${tdir} /test." * 2> /dev/null || true) "
382
+ # jump into test dir
383
+ cd " ${tdir} "
384
+
385
+ scriptFiles=" $( ls -1 " ./test." * 2> /dev/null || true) "
381
386
scriptCount=" $( echo " ${scriptFiles} " | wc -w) "
382
387
383
- inputFiles=" $( ls -1 " ${tdir} /input." * 2> /dev/null || true) "
388
+ inputFiles=" $( ls -1 " . /input." * 2> /dev/null || true) "
384
389
inputCount=" $( echo " ${inputFiles} " | wc -w) "
385
390
(( inputCount <= 1 )) || fail " Ambiguous input. Found input files in multiple formats:" $' \n ' " ${inputFiles} "
386
391
(( scriptCount <= 1 )) || fail " Ambiguous input. Found script files in multiple formats:" $' \n ' " ${scriptFiles} "
@@ -399,38 +404,38 @@ printTask "Running general commandline tests..."
399
404
# Use printf to get rid of the trailing newline
400
405
inputFile=$( printf " %s" " ${inputFiles} " )
401
406
402
- if [ " ${inputFile} " = " ${tdir} /input.json" ]
407
+ if [ " ${inputFile} " = " . /input.json" ]
403
408
then
404
- ! [ -e " ${tdir} /stdin" ] || fail " Found a file called 'stdin' but redirecting standard input in JSON mode is not allowed."
409
+ ! [ -e " . /stdin" ] || fail " Found a file called 'stdin' but redirecting standard input in JSON mode is not allowed."
405
410
406
411
stdin=" ${inputFile} "
407
412
inputFile=" "
408
- stdout=" $( cat " ${tdir} /output.json" 2> /dev/null || true) "
409
- stdoutExpectationFile=" ${tdir} /output.json"
413
+ stdout=" $( cat " . /output.json" 2> /dev/null || true) "
414
+ stdoutExpectationFile=" . /output.json"
410
415
prettyPrintFlags=" "
411
- if [[ ! -f " ${tdir} /no-pretty-print" ]]
416
+ if [[ ! -f " . /no-pretty-print" ]]
412
417
then
413
418
prettyPrintFlags=" --pretty-json --json-indent 4"
414
419
fi
415
420
416
- command_args=" --standard-json ${prettyPrintFlags} " $( cat " ${tdir} /args" 2> /dev/null || true)
421
+ command_args=" --standard-json ${prettyPrintFlags} " $( cat " . /args" 2> /dev/null || true)
417
422
else
418
- if [ -e " ${tdir} /stdin" ]
423
+ if [ -e " . /stdin" ]
419
424
then
420
- stdin=" ${tdir} /stdin"
421
- [ -f " ${tdir} /stdin" ] || fail " 'stdin' is not a regular file."
425
+ stdin=" . /stdin"
426
+ [ -f " . /stdin" ] || fail " 'stdin' is not a regular file."
422
427
else
423
428
stdin=" "
424
429
fi
425
430
426
- stdout=" $( cat " ${tdir} /output" 2> /dev/null || true) "
427
- stdoutExpectationFile=" ${tdir} /output"
428
- command_args=$( cat " ${tdir} /args" 2> /dev/null || true)
431
+ stdout=" $( cat " . /output" 2> /dev/null || true) "
432
+ stdoutExpectationFile=" . /output"
433
+ command_args=$( cat " . /args" 2> /dev/null || true)
429
434
fi
430
- exitCodeExpectationFile=" ${tdir} /exit"
435
+ exitCodeExpectationFile=" . /exit"
431
436
exitCode=$( cat " $exitCodeExpectationFile " 2> /dev/null || true)
432
- err=" $( cat " ${tdir} /err" 2> /dev/null || true) "
433
- stderrExpectationFile=" ${tdir} /err"
437
+ err=" $( cat " . /err" 2> /dev/null || true) "
438
+ stderrExpectationFile=" . /err"
434
439
test_solc_behaviour " $inputFile " \
435
440
" $command_args " \
436
441
" $stdin " \
0 commit comments