aboutsummaryrefslogtreecommitdiffstats
path: root/test/cmdlineTests.sh
diff options
context:
space:
mode:
authorliangdzou <liang.d.zou@gmail.com>2018-09-11 03:22:13 +0800
committerliangdzou <liang.d.zou@gmail.com>2018-09-13 09:55:54 +0800
commit558a4ac49c40761697580e0915490714c4370767 (patch)
tree6a58a384b8a3600a5186a303f93405fa27a26000 /test/cmdlineTests.sh
parent9214c7c34f5e4501a50cb29de964bbf04131f9a3 (diff)
downloaddexon-solidity-558a4ac49c40761697580e0915490714c4370767.tar.gz
dexon-solidity-558a4ac49c40761697580e0915490714c4370767.tar.zst
dexon-solidity-558a4ac49c40761697580e0915490714c4370767.zip
give more information (at most 35 chars before and after) for too long lines
add tests for giving more informations for too long lines add edge tests for giving more informations for too long lines avoid printing out tailing white space update test case after avoiding printing out trailing whitespace update test case for removing the pre-release warning from reference refactor the code to if-else flavor rename folder to cmdlineErrorReports under test rename folder to cmdlineErrorReports under test ignore whitespace for reference files avoiding to modify the file stderr_path by call sed without -i option print ' ...' instead of ' ... ' at the end of a line
Diffstat (limited to 'test/cmdlineTests.sh')
-rwxr-xr-xtest/cmdlineTests.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh
index 6f8a8ac1..f7577cb3 100755
--- a/test/cmdlineTests.sh
+++ b/test/cmdlineTests.sh
@@ -117,6 +117,8 @@ test_solc_file_input_failures() {
exitCode=$?
set -e
+ stderr=`sed 's/.*This is a pre-release compiler version, please do not use it in production.*$//' $stderr_path`
+
if [[ $exitCode -eq 0 ]]; then
printError "Incorrect exit code. Expected failure (non-zero) but got success (0)."
rm -f $stdout_path $stderr_path
@@ -133,12 +135,12 @@ test_solc_file_input_failures() {
exit 1
fi
- if [[ "$(cat $stderr_path)" != "${stderr_expected}" ]]; then
+ if [[ "$stderr" != "${stderr_expected}" ]]; then
printError "Incorrect output on stderr received. Expected:"
echo -e "${stderr_expected}"
printError "But got:"
- cat $stderr_path
+ echo $stderr
rm -f $stdout_path $stderr_path
exit 1
fi
@@ -156,6 +158,16 @@ printTask "Testing passing empty remappings..."
test_solc_file_input_failures "${0}" "=/some/remapping/target" "" "Invalid remapping: \"=/some/remapping/target\"."
test_solc_file_input_failures "${0}" "ctx:=/some/remapping/target" "" "Invalid remapping: \"ctx:=/some/remapping/target\"."
+printTask "Testing passing location printing..."
+(
+cd "$REPO_ROOT"/test/cmdlineErrorReports/
+for file in *.sol
+do
+ ret=`cat $file.ref`
+ test_solc_file_input_failures "$file" "" "" "$ret"
+done
+)
+
printTask "Compiling various other contracts and libraries..."
(
cd "$REPO_ROOT"/test/compilationTests/