aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaweł Bylica <chfast@gmail.com>2017-09-12 20:39:30 +0800
committerPaweł Bylica <chfast@gmail.com>2017-09-13 04:11:21 +0800
commit622a2d8251b467ded5a3134349198005f44faf6a (patch)
treea1bbcbb897207e1f73aebd7a910a4ec7b3836e12 /scripts
parentdc8754b5955c48d0434d60382823c795b14c473e (diff)
downloaddexon-solidity-622a2d8251b467ded5a3134349198005f44faf6a.tar.gz
dexon-solidity-622a2d8251b467ded5a3134349198005f44faf6a.tar.zst
dexon-solidity-622a2d8251b467ded5a3134349198005f44faf6a.zip
Travis CI: Fix Emscripten build
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/test_emscripten.sh47
1 files changed, 24 insertions, 23 deletions
diff --git a/scripts/test_emscripten.sh b/scripts/test_emscripten.sh
index f1d44a1f..b01b33bb 100755
--- a/scripts/test_emscripten.sh
+++ b/scripts/test_emscripten.sh
@@ -29,28 +29,29 @@
set -e
REPO_ROOT=$(cd $(dirname "$0")/.. && pwd)
-
-cd $REPO_ROOT/build
-
-echo "Preparing solc-js..."
-rm -rf solc-js
-git clone https://github.com/ethereum/solc-js
-cd solc-js
-npm install
-
-# Replace soljson with current build
-echo "Replacing soljson.js"
-rm -f soljson.js
-# Make a copy because paths might not be absolute
-cp ../solc/soljson.js soljson.js
-
-# Update version (needed for some tests)
-VERSION=$(../../scripts/get_version.sh)
-echo "Updating package.json to version $VERSION"
-npm version $VERSION
-
-echo "Running solc-js tests..."
-npm run test
+SOLJSON="$REPO_ROOT/build/solc/soljson.js"
+
+DIR=$(mktemp -d)
+(
+ echo "Preparing solc-js..."
+ git clone --depth 1 https://github.com/ethereum/solc-js "$DIR"
+ cd "$DIR"
+ npm install
+
+ # Replace soljson with current build
+ echo "Replacing soljson.js"
+ rm -f soljson.js
+ cp "$SOLJSON" soljson.js
+
+ # Update version (needed for some tests)
+ VERSION=$("$REPO_ROOT/scripts/get_version.sh")
+ echo "Updating package.json to version $VERSION"
+ npm version --no-git-tag-version $VERSION
+
+ echo "Running solc-js tests..."
+ npm run test
+)
+rm -rf "$DIR"
echo "Running external tests...."
-"$REPO_ROOT"/test/externalTests.sh "$REPO_ROOT"/build/solc/soljson.js
+"$REPO_ROOT/test/externalTests.sh" "$SOLJSON"