cmdlineTests: Remove superfluous output from script-based tests and adjust the rest

This commit is contained in:
Kamil Śliwak 2023-06-01 20:10:42 +02:00
parent c1df8ed563
commit 00c2f511d3
14 changed files with 7 additions and 23 deletions

View File

@ -24,7 +24,6 @@ function test_solc_assembly_output
fi
}
printTask "Testing assemble, yul, strict-assembly and optimize..."
echo '{}' | msg_on_error --silent "$SOLC" - --assemble
echo '{}' | msg_on_error --silent "$SOLC" - --yul
echo '{}' | msg_on_error --silent "$SOLC" - --strict-assembly

View File

@ -4,5 +4,4 @@ set -euo pipefail
# shellcheck source=scripts/common.sh
source "${REPO_ROOT}/scripts/common.sh"
printTask "Testing AST export with stop-after=parsing..."
"$REPO_ROOT/test/stopAfterParseTests.sh"

View File

@ -4,7 +4,6 @@ set -euo pipefail
# shellcheck source=scripts/common.sh
source "${REPO_ROOT}/scripts/common.sh"
printTask "Testing AST import/export..."
SOLTMPDIR=$(mktemp -d)
cd "$SOLTMPDIR"
if ! "$REPO_ROOT/scripts/ASTImportTest.sh" ast

View File

@ -6,11 +6,10 @@ source "${REPO_ROOT}/scripts/common.sh"
# shellcheck source=scripts/common_cmdline.sh
source "${REPO_ROOT}/scripts/common_cmdline.sh"
printTask "Compiling various other contracts and libraries..."
cd "$REPO_ROOT"/test/compilationTests/
for dir in */
do
echo " - $dir"
echo " - $dir"
cd "$dir"
# shellcheck disable=SC2046 # These file names are not supposed to contain spaces.
compileFull --expect-warnings $(find . -name '*.sol')

View File

@ -6,7 +6,6 @@ source "${REPO_ROOT}/scripts/common.sh"
# shellcheck source=scripts/common_cmdline.sh
source "${REPO_ROOT}/scripts/common_cmdline.sh"
printTask "Compiling all examples from the documentation..."
SOLTMPDIR=$(mktemp -d)
set -e
@ -24,7 +23,7 @@ do
then
continue
fi
echo "$f"
echo " - Compiling example $f"
opts=()
# We expect errors if explicitly stated, or if imports
@ -49,4 +48,3 @@ do
compileFull "${opts[@]}" "$SOLTMPDIR/$f"
done
rm -r "$SOLTMPDIR"
echo "Done."

View File

@ -4,7 +4,6 @@ set -euo pipefail
# shellcheck source=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 '' | "$SOLC" - --link --libraries a=0x80f20564390eAe531E810af625A22f51385Cd222 &>/dev/null && \
fail "solc --link did not reject a library address with an invalid checksum."

View File

@ -4,5 +4,4 @@ set -euo pipefail
# shellcheck source=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

View File

@ -4,7 +4,6 @@ set -euo pipefail
# shellcheck source=scripts/common.sh
source "${REPO_ROOT}/scripts/common.sh"
printTask "Testing linking itself..."
SOLTMPDIR=$(mktemp -d)
cd "$SOLTMPDIR"
@ -18,6 +17,7 @@ grep -q '//' C.bin && grep -q '__' C.bin
grep -q -v '[/_]' L.bin
# Now link
printf " "
msg_on_error "$SOLC" --link --libraries x.sol:L=0x90f20564390eAe531E810af625A22f51385Cd222 C.bin
# Now the placeholder and explanation should be gone.

View File

@ -4,7 +4,6 @@ set -euo pipefail
# shellcheck source=scripts/common.sh
source "${REPO_ROOT}/scripts/common.sh"
printTask "Testing overwriting files..."
SOLTMPDIR=$(mktemp -d)
# First time it works

View File

@ -4,7 +4,6 @@ set -euo pipefail
# shellcheck source=scripts/common.sh
source "${REPO_ROOT}/scripts/common.sh"
printTask "Testing soljson via the fuzzer..."
SOLTMPDIR=$(mktemp -d)
set -e

View File

@ -4,7 +4,6 @@ set -euo pipefail
# shellcheck source=scripts/common.sh
source "${REPO_ROOT}/scripts/common.sh"
printTask "Testing standard input..."
SOLTMPDIR=$(mktemp -d)
set +e
output=$("$SOLC" --bin 2>&1)

View File

@ -4,15 +4,12 @@ set -euo pipefail
# shellcheck source=scripts/common.sh
source "${REPO_ROOT}/scripts/common.sh"
printTask "Testing unknown options..."
set +e
output=$("$SOLC" --allow=test 2>&1)
failed=$?
set -e
if [ "$output" == "unrecognised option '--allow=test'" ] && [ $failed -ne 0 ]
if [[ $output != "unrecognised option '--allow=test'" ]] || (( failed == 0 ))
then
echo "Passed"
else
fail "Incorrect response to unknown options: $output"
fi

View File

@ -5,7 +5,6 @@ set -euo pipefail
source "${REPO_ROOT}/scripts/common.sh"
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"
"${REPO_ROOT}/scripts/update_bugs_by_version.py"

View File

@ -15,7 +15,7 @@ function test_via_ir_equivalence()
[[ $optimize_flag == --optimize || $optimize_flag == "" ]] || assertFail "The second argument must be --optimize if present."
local output_file_prefix
output_file_prefix=$(basename "$1" .sol)
output_file_prefix=$(basename "$solidity_file" .sol)
local optimizer_flags=()
[[ $optimize_flag == "" ]] || optimizer_flags+=("$optimize_flag")
@ -65,7 +65,6 @@ function test_via_ir_equivalence()
rm -r "$SOLTMPDIR"
}
printTask "Testing the eqivalence of --via-ir and a two-stage compilation..."
externalContracts=(
externalTests/solc-js/DAO/TokenCreation.sol
libsolidity/semanticTests/externalContracts/_prbmath/PRBMathSD59x18.sol
@ -87,10 +86,10 @@ for contractFile in "${externalContracts[@]}"
do
if ! [[ "${requiresOptimizer[*]}" =~ $contractFile ]]
then
printTask " - ${contractFile}"
printTask " - ${contractFile}"
test_via_ir_equivalence "${REPO_ROOT}/test/${contractFile}"
fi
printTask " - ${contractFile} (optimized)"
printTask " - ${contractFile} (optimized)"
test_via_ir_equivalence "${REPO_ROOT}/test/${contractFile}" --optimize
done