From 08993a32829fe1871a4eb5b7e36dbd62abf2f911 Mon Sep 17 00:00:00 2001 From: Djordje Mijovic Date: Thu, 25 Mar 2021 12:31:34 +0100 Subject: [PATCH] Enabling running cmd line tests on currently unreleased version. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kamil ƚliwak --- test/cmdlineTests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 95c913989..fcd7198bf 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -352,6 +352,7 @@ SOLTMPDIR=$(mktemp -d) set -e cd "$SOLTMPDIR" "$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/docs/ docs + developmentVersion=$("$REPO_ROOT/scripts/get_version.sh") for f in *.sol do @@ -378,6 +379,10 @@ SOLTMPDIR=$(mktemp -d) then opts+=(-o) fi + + # Disable the version pragma in code snippets that only work with the current development version. + # It's necessary because x.y.z won't match `^x.y.z` or `>=x.y.z` pragmas until it's officially released. + sed -i.bak -E -e 's/pragma[[:space:]]+solidity[[:space:]]*(\^|>=)[[:space:]]*'"$developmentVersion"'/pragma solidity >0.0.1/' "$f" compileFull "${opts[@]}" "$SOLTMPDIR/$f" done )