Skip to content

Commit 9e641e6

Browse files
committed
externalTests/solc-js: Allow using a local checkout of solc-js
1 parent b925250 commit 9e641e6

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

test/externalTests/common.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,23 @@ function setup_solc
7171
local binary_path="$3"
7272
local solcjs_branch="${4:-master}"
7373
local install_dir="${5:-solc/}"
74+
local solcjs_dir="$6"
7475

7576
[[ $binary_type == native || $binary_type == solcjs ]] || assertFail
77+
[[ $binary_type == solcjs || $solcjs_dir == "" ]] || assertFail
7678

7779
cd "$test_dir"
7880

7981
if [[ $binary_type == solcjs ]]
8082
then
8183
printLog "Setting up solc-js..."
82-
git clone --depth 1 -b "$solcjs_branch" https://github.com/ethereum/solc-js.git "$install_dir"
84+
if [[ $solcjs_dir == "" ]]; then
85+
printLog "Cloning branch ${solcjs_branch}..."
86+
git clone --depth 1 -b "$solcjs_branch" https://github.com/ethereum/solc-js.git "$install_dir"
87+
else
88+
printLog "Using local solc-js from ${solcjs_dir}..."
89+
cp -ra "$solcjs_dir" solc
90+
fi
8391

8492
pushd "$install_dir"
8593
npm install

test/externalTests/solc-js/solc-js.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,17 @@ source test/externalTests/common.sh
2626

2727
SOLJSON="$1"
2828
VERSION="$2"
29+
SOLCJS_CHECKOUT="$3" # optional
2930

30-
[[ $SOLJSON != "" && -f "$SOLJSON" && $VERSION != "" ]] || fail "Usage: $0 <path to soljson.js> <version>"
31+
[[ $SOLJSON != "" && -f "$SOLJSON" && $VERSION != "" ]] || fail "Usage: $0 <path to soljson.js> <version> [<path to solc-js>]"
3132

3233
function solcjs_test
3334
{
3435
TEST_DIR=$(pwd)
3536
SOLCJS_INPUT_DIR="$TEST_DIR"/test/externalTests/solc-js
3637

3738
# set up solc-js on the branch specified
38-
setup_solc "$DIR" solcjs "$SOLJSON" master solc/
39+
setup_solc "$DIR" solcjs "$SOLJSON" master solc/ "$SOLCJS_CHECKOUT"
3940
cd solc/
4041

4142
printLog "Updating index.js file..."

0 commit comments

Comments
 (0)