From 64ef9d581bb2d526dac1a3f21b7b22b21673eee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 1 Jun 2023 16:42:45 +0200 Subject: [PATCH] Command-line test for equivalence of optimizer options on the CLI and in Standard JSON --- scripts/common_cmdline.sh | 39 ++++++++++++ .../test.sh | 61 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100755 test/cmdlineTests/~cli_and_standard_json_equivalence/test.sh diff --git a/scripts/common_cmdline.sh b/scripts/common_cmdline.sh index 1b40f50d5..5e32a76dc 100644 --- a/scripts/common_cmdline.sh +++ b/scripts/common_cmdline.sh @@ -104,6 +104,45 @@ function compileFull fi } +function singleContractOutputViaStandardJSON +{ + (( $# == 4 )) || assertFail + local language="$1" + local selected_output="$2" + local extra_settings="$3" + local input_file="$4" + [[ $selected_output != "*" ]] || assertFail + + json_output=$( + "$SOLC" --standard-json --allow-paths "$(basename "$input_file")" - <