-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix minor bugs in shell scripts #10584
Changes from 5 commits
1f2ffa9
ac12274
81668eb
f712662
893a5b6
4a16b13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ do | |
NSOURCES=$((NSOURCES - 1)) | ||
for i in $OUTPUT; | ||
do | ||
testImportExportEquivalence $i $OUTPUT | ||
testImportExportEquivalence "$i" "$OUTPUT" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If This means that we were never really testing the equivalence. |
||
NSOURCES=$((NSOURCES + 1)) | ||
done | ||
elif [ ${SPLITSOURCES_RC} == 1 ] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,6 @@ function compileFull() | |
fi | ||
|
||
local files="$*" | ||
local output | ||
|
||
local stderr_path=$(mktemp) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,9 +109,9 @@ do | |
then | ||
if [ -n "$optimize" ] | ||
then | ||
log=--logger=JUNIT,error,$log_directory/opt_$vm.xml $testargs | ||
log=--logger=JUNIT,error,$log_directory/opt_$vm.xml | ||
else | ||
log=--logger=JUNIT,error,$log_directory/noopt_$vm.xml $testargs_no_opt | ||
log=--logger=JUNIT,error,$log_directory/noopt_$vm.xml | ||
Comment on lines
-112
to
+114
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These variables were at some point present in the file and contained the |
||
fi | ||
fi | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#!/bin/bash | ||
|
||
TAG="$1" | ||
SOLJSON_JS="$2" | ||
|
||
# If we ever want to patch the binaries e.g. for compatibility with older solc-js versions, | ||
# we can do that here. | ||
# | ||
# This script gets the following parameters: | ||
# - TAG | ||
# - SOLJSON_JS |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,7 +206,7 @@ function test_solc_assembly_output() | |
local expected_object="object \"object\" { code "${expected}" }" | ||
|
||
output=$(echo "${input}" | "$SOLC" - ${solc_args} 2>/dev/null) | ||
empty=$(echo $output | sed -ne '/'"${expected_object}"'/p') | ||
empty=$(echo "$output" | tr '\n' ' ' | tr -s ' ' | sed -ne "/${expected_object}/p") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is interesting.
Not quoting it means that any Quoting it fixes the problem but also breaks the regex because a convenient side-effect of not quoting it was that it got squashed into a single line with multiple spaces replaced by a single one. I added the |
||
if [ -z "$empty" ] | ||
then | ||
printError "Incorrect assembly output. Expected: " | ||
|
@@ -436,15 +436,18 @@ SOLTMPDIR=$(mktemp -d) | |
# The contract should be compiled | ||
if [[ "$result" != 0 ]] | ||
then | ||
printError "Failed to compile a simple contract from standard input" | ||
exit 1 | ||
fi | ||
|
||
# This should not fail | ||
set +e | ||
output=$(echo '' | "$SOLC" --ast - 2>/dev/null) | ||
output=$(echo '' | "$SOLC" --ast-json - 2>/dev/null) | ||
result=$? | ||
set -e | ||
if [[ $? != 0 ]] | ||
if [[ $result != 0 ]] | ||
Comment on lines
-444
to
+448
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no I suspect this was supposed to be either |
||
then | ||
printError "Incorrect response to --ast-json option with empty stdin" | ||
exit 1 | ||
fi | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>2
means "write to a file called2
", not "write to stderr".