From d5a50d8aee007a2d1310ead9c9430c9eb14e9279 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 13 Dec 2018 13:31:12 +0100 Subject: [PATCH] Remove pre-release warning from standard json cmdline tests. --- test/cmdlineTests.sh | 9 +++++++-- test/cmdlineTests/standard.json.stdout | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 951768149..bb71e0123 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -130,8 +130,13 @@ test_solc_behaviour() { exitCode=$? set -e - sed -i -e '/^Warning: This is a pre-release compiler version, please do not use it in production./d' "$stderr_path" - sed -i -e 's/ Consider adding "pragma .*$//' "$stderr_path" + if [[ "$solc_args" == *"--standard-json"* ]]; then + sed -i -e 's/{[^{]*Warning: This is a pre-release compiler version[^}]*},\{0,1\}//' "$stdout_path" + sed -i -e 's/,"errors":\[\]//' "$stdout_path" + else + sed -i -e '/^Warning: This is a pre-release compiler version, please do not use it in production./d' "$stderr_path" + sed -i -e 's/ Consider adding "pragma .*$//' "$stderr_path" + fi if [[ $exitCode -ne "$exit_code_expected" ]]; then printError "Incorrect exit code. Expected $exit_code_expected but got $exitCode." diff --git a/test/cmdlineTests/standard.json.stdout b/test/cmdlineTests/standard.json.stdout index ba4099e59..490e1f80b 100644 --- a/test/cmdlineTests/standard.json.stdout +++ b/test/cmdlineTests/standard.json.stdout @@ -1 +1 @@ -{"contracts":{"A":{"C":{"evm":{}}}},"errors":[{"component":"general","formattedMessage":"Warning: This is a pre-release compiler version, please do not use it in production.\n","message":"This is a pre-release compiler version, please do not use it in production.","severity":"warning","type":"Warning"}],"sources":{"A":{"id":0}}} +{"contracts":{"A":{"C":{"evm":{}}}},"sources":{"A":{"id":0}}}