mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
scripts/ImportExportTest.sh: Add direct import/export tests.
This commit is contained in:
parent
e25a1a3879
commit
00f034362b
@ -145,6 +145,40 @@ function testImportExportEquivalence {
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if ! $SOLC --combined-json asm --pretty-json --import-asm-json expected.asm > obtained_direct_import_export.json 2> obtained_direct_import_export.error
|
||||||
|
then
|
||||||
|
printf "\n"
|
||||||
|
echo "$nth_input_file"
|
||||||
|
cat obtained_direct_import_export.error
|
||||||
|
FAILED=$((FAILED + 1))
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
for obtained_contract in $(jq '.contracts | keys | .[]' obtained_direct_import_export.json 2> /dev/null)
|
||||||
|
do
|
||||||
|
jq --raw-output ".contracts.${obtained_contract}.\"asm\"" obtained_direct_import_export.json > obtained_direct_import_export.asm
|
||||||
|
set +e
|
||||||
|
DIFF="$(diff expected.asm obtained_direct_import_export.asm)"
|
||||||
|
set -e
|
||||||
|
if [ "$DIFF" != "" ]
|
||||||
|
then
|
||||||
|
if [ "$DIFFVIEW" == "" ]
|
||||||
|
then
|
||||||
|
echo -e "ERROR: JSONS differ for $1: \n $DIFF \n"
|
||||||
|
echo "Expected:"
|
||||||
|
cat expected.asm
|
||||||
|
echo "Obtained:"
|
||||||
|
cat obtained_direct_import_export.asm
|
||||||
|
else
|
||||||
|
# Use user supplied diff view binary
|
||||||
|
$DIFFVIEW expected.asm obtained_direct_import_export.asm
|
||||||
|
fi
|
||||||
|
_TESTED=
|
||||||
|
FAILED=$((FAILED + 1))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
rm obtained.json
|
rm obtained.json
|
||||||
rm -f obtained.error
|
rm -f obtained.error
|
||||||
for type in "${types[@]}"
|
for type in "${types[@]}"
|
||||||
|
Loading…
Reference in New Issue
Block a user