Make solc-js.sh run its tests directly

- Its structure has diverged a lot from other external tests and there's not point in keeping it abstracted like this.
This commit is contained in:
Kamil Śliwak 2022-01-28 19:14:29 +01:00
parent afc3d72e81
commit b925250705
2 changed files with 4 additions and 18 deletions

View File

@ -323,20 +323,6 @@ function hardhat_clean
rm -rf artifacts/ cache/
}
function run_test
{
local compile_fn="$1"
local test_fn="$2"
replace_version_pragmas
printLog "Running compile function..."
time $compile_fn
printLog "Running test function..."
$test_fn
}
function settings_from_preset
{
local preset="$1"

View File

@ -29,9 +29,6 @@ VERSION="$2"
[[ $SOLJSON != "" && -f "$SOLJSON" && $VERSION != "" ]] || fail "Usage: $0 <path to soljson.js> <version>"
function compile_fn { echo "Nothing to compile."; }
function test_fn { npm test; }
function solcjs_test
{
TEST_DIR=$(pwd)
@ -60,7 +57,10 @@ function solcjs_test
echo "Updating package.json to version $VERSION"
npm version --allow-same-version --no-git-tag-version "$VERSION"
run_test compile_fn test_fn
replace_version_pragmas
printLog "Running test function..."
npm test
}
external_test solc-js solcjs_test