mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
cmdlineTests: Remove superfluous output from script-based tests and adjust the rest
This commit is contained in:
parent
c1df8ed563
commit
00c2f511d3
@ -24,7 +24,6 @@ function test_solc_assembly_output
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
printTask "Testing assemble, yul, strict-assembly and optimize..."
|
|
||||||
echo '{}' | msg_on_error --silent "$SOLC" - --assemble
|
echo '{}' | msg_on_error --silent "$SOLC" - --assemble
|
||||||
echo '{}' | msg_on_error --silent "$SOLC" - --yul
|
echo '{}' | msg_on_error --silent "$SOLC" - --yul
|
||||||
echo '{}' | msg_on_error --silent "$SOLC" - --strict-assembly
|
echo '{}' | msg_on_error --silent "$SOLC" - --strict-assembly
|
||||||
|
@ -4,5 +4,4 @@ set -euo pipefail
|
|||||||
# shellcheck source=scripts/common.sh
|
# shellcheck source=scripts/common.sh
|
||||||
source "${REPO_ROOT}/scripts/common.sh"
|
source "${REPO_ROOT}/scripts/common.sh"
|
||||||
|
|
||||||
printTask "Testing AST export with stop-after=parsing..."
|
|
||||||
"$REPO_ROOT/test/stopAfterParseTests.sh"
|
"$REPO_ROOT/test/stopAfterParseTests.sh"
|
||||||
|
@ -4,7 +4,6 @@ set -euo pipefail
|
|||||||
# shellcheck source=scripts/common.sh
|
# shellcheck source=scripts/common.sh
|
||||||
source "${REPO_ROOT}/scripts/common.sh"
|
source "${REPO_ROOT}/scripts/common.sh"
|
||||||
|
|
||||||
printTask "Testing AST import/export..."
|
|
||||||
SOLTMPDIR=$(mktemp -d)
|
SOLTMPDIR=$(mktemp -d)
|
||||||
cd "$SOLTMPDIR"
|
cd "$SOLTMPDIR"
|
||||||
if ! "$REPO_ROOT/scripts/ASTImportTest.sh" ast
|
if ! "$REPO_ROOT/scripts/ASTImportTest.sh" ast
|
||||||
|
@ -6,11 +6,10 @@ source "${REPO_ROOT}/scripts/common.sh"
|
|||||||
# shellcheck source=scripts/common_cmdline.sh
|
# shellcheck source=scripts/common_cmdline.sh
|
||||||
source "${REPO_ROOT}/scripts/common_cmdline.sh"
|
source "${REPO_ROOT}/scripts/common_cmdline.sh"
|
||||||
|
|
||||||
printTask "Compiling various other contracts and libraries..."
|
|
||||||
cd "$REPO_ROOT"/test/compilationTests/
|
cd "$REPO_ROOT"/test/compilationTests/
|
||||||
for dir in */
|
for dir in */
|
||||||
do
|
do
|
||||||
echo " - $dir"
|
echo " - $dir"
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
# shellcheck disable=SC2046 # These file names are not supposed to contain spaces.
|
# shellcheck disable=SC2046 # These file names are not supposed to contain spaces.
|
||||||
compileFull --expect-warnings $(find . -name '*.sol')
|
compileFull --expect-warnings $(find . -name '*.sol')
|
||||||
|
@ -6,7 +6,6 @@ source "${REPO_ROOT}/scripts/common.sh"
|
|||||||
# shellcheck source=scripts/common_cmdline.sh
|
# shellcheck source=scripts/common_cmdline.sh
|
||||||
source "${REPO_ROOT}/scripts/common_cmdline.sh"
|
source "${REPO_ROOT}/scripts/common_cmdline.sh"
|
||||||
|
|
||||||
printTask "Compiling all examples from the documentation..."
|
|
||||||
SOLTMPDIR=$(mktemp -d)
|
SOLTMPDIR=$(mktemp -d)
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@ -24,7 +23,7 @@ do
|
|||||||
then
|
then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo "$f"
|
echo " - Compiling example $f"
|
||||||
|
|
||||||
opts=()
|
opts=()
|
||||||
# We expect errors if explicitly stated, or if imports
|
# We expect errors if explicitly stated, or if imports
|
||||||
@ -49,4 +48,3 @@ do
|
|||||||
compileFull "${opts[@]}" "$SOLTMPDIR/$f"
|
compileFull "${opts[@]}" "$SOLTMPDIR/$f"
|
||||||
done
|
done
|
||||||
rm -r "$SOLTMPDIR"
|
rm -r "$SOLTMPDIR"
|
||||||
echo "Done."
|
|
||||||
|
@ -4,7 +4,6 @@ set -euo pipefail
|
|||||||
# shellcheck source=scripts/common.sh
|
# shellcheck source=scripts/common.sh
|
||||||
source "${REPO_ROOT}/scripts/common.sh"
|
source "${REPO_ROOT}/scripts/common.sh"
|
||||||
|
|
||||||
printTask "Testing library checksum..."
|
|
||||||
echo '' | msg_on_error --no-stdout "$SOLC" - --link --libraries a=0x90f20564390eAe531E810af625A22f51385Cd222
|
echo '' | msg_on_error --no-stdout "$SOLC" - --link --libraries a=0x90f20564390eAe531E810af625A22f51385Cd222
|
||||||
echo '' | "$SOLC" - --link --libraries a=0x80f20564390eAe531E810af625A22f51385Cd222 &>/dev/null && \
|
echo '' | "$SOLC" - --link --libraries a=0x80f20564390eAe531E810af625A22f51385Cd222 &>/dev/null && \
|
||||||
fail "solc --link did not reject a library address with an invalid checksum."
|
fail "solc --link did not reject a library address with an invalid checksum."
|
||||||
|
@ -4,5 +4,4 @@ set -euo pipefail
|
|||||||
# shellcheck source=scripts/common.sh
|
# shellcheck source=scripts/common.sh
|
||||||
source "${REPO_ROOT}/scripts/common.sh"
|
source "${REPO_ROOT}/scripts/common.sh"
|
||||||
|
|
||||||
printTask "Testing long library names..."
|
|
||||||
echo '' | msg_on_error --no-stdout "$SOLC" - --link --libraries aveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylonglibraryname=0x90f20564390eAe531E810af625A22f51385Cd222
|
echo '' | msg_on_error --no-stdout "$SOLC" - --link --libraries aveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylonglibraryname=0x90f20564390eAe531E810af625A22f51385Cd222
|
||||||
|
@ -4,7 +4,6 @@ set -euo pipefail
|
|||||||
# shellcheck source=scripts/common.sh
|
# shellcheck source=scripts/common.sh
|
||||||
source "${REPO_ROOT}/scripts/common.sh"
|
source "${REPO_ROOT}/scripts/common.sh"
|
||||||
|
|
||||||
printTask "Testing linking itself..."
|
|
||||||
SOLTMPDIR=$(mktemp -d)
|
SOLTMPDIR=$(mktemp -d)
|
||||||
cd "$SOLTMPDIR"
|
cd "$SOLTMPDIR"
|
||||||
|
|
||||||
@ -18,6 +17,7 @@ grep -q '//' C.bin && grep -q '__' C.bin
|
|||||||
grep -q -v '[/_]' L.bin
|
grep -q -v '[/_]' L.bin
|
||||||
|
|
||||||
# Now link
|
# Now link
|
||||||
|
printf " "
|
||||||
msg_on_error "$SOLC" --link --libraries x.sol:L=0x90f20564390eAe531E810af625A22f51385Cd222 C.bin
|
msg_on_error "$SOLC" --link --libraries x.sol:L=0x90f20564390eAe531E810af625A22f51385Cd222 C.bin
|
||||||
|
|
||||||
# Now the placeholder and explanation should be gone.
|
# Now the placeholder and explanation should be gone.
|
||||||
|
@ -4,7 +4,6 @@ set -euo pipefail
|
|||||||
# shellcheck source=scripts/common.sh
|
# shellcheck source=scripts/common.sh
|
||||||
source "${REPO_ROOT}/scripts/common.sh"
|
source "${REPO_ROOT}/scripts/common.sh"
|
||||||
|
|
||||||
printTask "Testing overwriting files..."
|
|
||||||
SOLTMPDIR=$(mktemp -d)
|
SOLTMPDIR=$(mktemp -d)
|
||||||
|
|
||||||
# First time it works
|
# First time it works
|
||||||
|
@ -4,7 +4,6 @@ set -euo pipefail
|
|||||||
# shellcheck source=scripts/common.sh
|
# shellcheck source=scripts/common.sh
|
||||||
source "${REPO_ROOT}/scripts/common.sh"
|
source "${REPO_ROOT}/scripts/common.sh"
|
||||||
|
|
||||||
printTask "Testing soljson via the fuzzer..."
|
|
||||||
SOLTMPDIR=$(mktemp -d)
|
SOLTMPDIR=$(mktemp -d)
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
@ -4,7 +4,6 @@ set -euo pipefail
|
|||||||
# shellcheck source=scripts/common.sh
|
# shellcheck source=scripts/common.sh
|
||||||
source "${REPO_ROOT}/scripts/common.sh"
|
source "${REPO_ROOT}/scripts/common.sh"
|
||||||
|
|
||||||
printTask "Testing standard input..."
|
|
||||||
SOLTMPDIR=$(mktemp -d)
|
SOLTMPDIR=$(mktemp -d)
|
||||||
set +e
|
set +e
|
||||||
output=$("$SOLC" --bin 2>&1)
|
output=$("$SOLC" --bin 2>&1)
|
||||||
|
@ -4,15 +4,12 @@ set -euo pipefail
|
|||||||
# shellcheck source=scripts/common.sh
|
# shellcheck source=scripts/common.sh
|
||||||
source "${REPO_ROOT}/scripts/common.sh"
|
source "${REPO_ROOT}/scripts/common.sh"
|
||||||
|
|
||||||
printTask "Testing unknown options..."
|
|
||||||
set +e
|
set +e
|
||||||
output=$("$SOLC" --allow=test 2>&1)
|
output=$("$SOLC" --allow=test 2>&1)
|
||||||
failed=$?
|
failed=$?
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "$output" == "unrecognised option '--allow=test'" ] && [ $failed -ne 0 ]
|
if [[ $output != "unrecognised option '--allow=test'" ]] || (( failed == 0 ))
|
||||||
then
|
then
|
||||||
echo "Passed"
|
|
||||||
else
|
|
||||||
fail "Incorrect response to unknown options: $output"
|
fail "Incorrect response to unknown options: $output"
|
||||||
fi
|
fi
|
||||||
|
@ -5,7 +5,6 @@ set -euo pipefail
|
|||||||
source "${REPO_ROOT}/scripts/common.sh"
|
source "${REPO_ROOT}/scripts/common.sh"
|
||||||
|
|
||||||
SOLTMPDIR=$(mktemp -d)
|
SOLTMPDIR=$(mktemp -d)
|
||||||
printTask "Checking that the bug list is up to date..."
|
|
||||||
|
|
||||||
cp "${REPO_ROOT}/docs/bugs_by_version.json" "${SOLTMPDIR}/original_bugs_by_version.json"
|
cp "${REPO_ROOT}/docs/bugs_by_version.json" "${SOLTMPDIR}/original_bugs_by_version.json"
|
||||||
"${REPO_ROOT}/scripts/update_bugs_by_version.py"
|
"${REPO_ROOT}/scripts/update_bugs_by_version.py"
|
||||||
|
@ -15,7 +15,7 @@ function test_via_ir_equivalence()
|
|||||||
[[ $optimize_flag == --optimize || $optimize_flag == "" ]] || assertFail "The second argument must be --optimize if present."
|
[[ $optimize_flag == --optimize || $optimize_flag == "" ]] || assertFail "The second argument must be --optimize if present."
|
||||||
|
|
||||||
local output_file_prefix
|
local output_file_prefix
|
||||||
output_file_prefix=$(basename "$1" .sol)
|
output_file_prefix=$(basename "$solidity_file" .sol)
|
||||||
|
|
||||||
local optimizer_flags=()
|
local optimizer_flags=()
|
||||||
[[ $optimize_flag == "" ]] || optimizer_flags+=("$optimize_flag")
|
[[ $optimize_flag == "" ]] || optimizer_flags+=("$optimize_flag")
|
||||||
@ -65,7 +65,6 @@ function test_via_ir_equivalence()
|
|||||||
rm -r "$SOLTMPDIR"
|
rm -r "$SOLTMPDIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
printTask "Testing the eqivalence of --via-ir and a two-stage compilation..."
|
|
||||||
externalContracts=(
|
externalContracts=(
|
||||||
externalTests/solc-js/DAO/TokenCreation.sol
|
externalTests/solc-js/DAO/TokenCreation.sol
|
||||||
libsolidity/semanticTests/externalContracts/_prbmath/PRBMathSD59x18.sol
|
libsolidity/semanticTests/externalContracts/_prbmath/PRBMathSD59x18.sol
|
||||||
@ -87,10 +86,10 @@ for contractFile in "${externalContracts[@]}"
|
|||||||
do
|
do
|
||||||
if ! [[ "${requiresOptimizer[*]}" =~ $contractFile ]]
|
if ! [[ "${requiresOptimizer[*]}" =~ $contractFile ]]
|
||||||
then
|
then
|
||||||
printTask " - ${contractFile}"
|
printTask " - ${contractFile}"
|
||||||
test_via_ir_equivalence "${REPO_ROOT}/test/${contractFile}"
|
test_via_ir_equivalence "${REPO_ROOT}/test/${contractFile}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printTask " - ${contractFile} (optimized)"
|
printTask " - ${contractFile} (optimized)"
|
||||||
test_via_ir_equivalence "${REPO_ROOT}/test/${contractFile}" --optimize
|
test_via_ir_equivalence "${REPO_ROOT}/test/${contractFile}" --optimize
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user