aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-12-20 19:32:53 +0800
committerchriseth <chris@ethereum.org>2019-01-07 21:50:49 +0800
commit6e626ad95502549d6b156c3b294990a450c590e1 (patch)
treeeb4961fced4b231ac2d9ac57b23427c2127c5dc2 /test
parentb18c8a60ffc59e8664a298cc595e79951b54ebd9 (diff)
downloaddexon-solidity-6e626ad95502549d6b156c3b294990a450c590e1.tar.gz
dexon-solidity-6e626ad95502549d6b156c3b294990a450c590e1.tar.zst
dexon-solidity-6e626ad95502549d6b156c3b294990a450c590e1.zip
Unify json and non-json commandline tests.
Diffstat (limited to 'test')
-rwxr-xr-xtest/cmdlineTests.sh32
1 files changed, 14 insertions, 18 deletions
diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh
index f8cafc52..1ef1b320 100755
--- a/test/cmdlineTests.sh
+++ b/test/cmdlineTests.sh
@@ -215,31 +215,27 @@ printTask "Testing passing empty remappings..."
test_solc_behaviour "${0}" "=/some/remapping/target" "" "" 1 "Invalid remapping: \"=/some/remapping/target\"."
test_solc_behaviour "${0}" "ctx:=/some/remapping/target" "" "" 1 "Invalid remapping: \"ctx:=/some/remapping/target\"."
-printTask "Running standard JSON commandline tests..."
-(
- cd "$REPO_ROOT"/test/cmdlineTests/standard_json/
- for tdir in */
- do
- stdin="${tdir}/input.json"
- stdout=$(cat ${tdir}/output.json 2>/dev/null || true)
- exitCode=$(cat ${tdir}/exit 2>/dev/null || true)
- err=$(cat ${tdir}/err 2>/dev/null || true)
- printTask " - ${tdir}"
- test_solc_behaviour "" "--standard-json" "$stdin" "$stdout" "$exitCode" "$err"
- done
-)
-
printTask "Running general commandline tests..."
(
- cd "$REPO_ROOT"/test/cmdlineTests/regular_sol
+ cd "$REPO_ROOT"/test/cmdlineTests/
for tdir in */
do
- args=$(cat ${tdir}/args 2>/dev/null || true)
- stdout=$(cat ${tdir}/output 2>/dev/null || true)
+ if [ -e "${tdir}/input.json" ]
+ then
+ inputFile=""
+ stdin="${tdir}/input.json"
+ stdout=$(cat ${tdir}/output.json 2>/dev/null || true)
+ args="--standard-json "$(cat ${tdir}/args 2>/dev/null || true)
+ else
+ inputFile="${tdir}input.sol"
+ stdin=""
+ stdout=$(cat ${tdir}/output 2>/dev/null || true)
+ args=$(cat ${tdir}/args 2>/dev/null || true)
+ fi
exitCode=$(cat ${tdir}/exit 2>/dev/null || true)
err=$(cat ${tdir}/err 2>/dev/null || true)
printTask " - ${tdir}"
- test_solc_behaviour "${tdir}contracts.sol" "$args" "" "$stdout" "$exitCode" "$err"
+ test_solc_behaviour "$inputFile" "$args" "$stdin" "$stdout" "$exitCode" "$err"
done
)