aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-12-15 19:16:32 +0800
committerchriseth <c@ethdev.com>2016-12-15 19:16:56 +0800
commit822622cf5bf23e79a6e2292cb837d1a39ca1c419 (patch)
treee668cf9a257bab10e77469ba725e630bc8f3b0a5 /scripts
parent2dabbdf06f414750ef0425c664f861aeb3e470b8 (diff)
parent3a692e3df9b62852c951adece42f6d12b2d4a44a (diff)
downloaddexon-solidity-822622cf5bf23e79a6e2292cb837d1a39ca1c419.tar.gz
dexon-solidity-822622cf5bf23e79a6e2292cb837d1a39ca1c419.tar.zst
dexon-solidity-822622cf5bf23e79a6e2292cb837d1a39ca1c419.zip
Merge remote-tracking branch 'origin/develop' into release
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Dockerfile12
-rwxr-xr-xscripts/install_deps.sh6
-rwxr-xr-xscripts/isolateTests.py24
-rwxr-xr-xscripts/isolate_tests.py44
-rwxr-xr-xscripts/tests.sh9
-rwxr-xr-xscripts/travis-emscripten/build_emscripten.sh4
6 files changed, 67 insertions, 32 deletions
diff --git a/scripts/Dockerfile b/scripts/Dockerfile
new file mode 100644
index 00000000..20140556
--- /dev/null
+++ b/scripts/Dockerfile
@@ -0,0 +1,12 @@
+FROM alpine
+MAINTAINER chriseth <chris@ethereum.org>
+
+RUN \
+ apk --no-cache --update add build-base cmake boost-dev git && \
+ sed -i -E -e 's/include <sys\/poll.h>/include <poll.h>/' /usr/include/boost/asio/detail/socket_types.hpp && \
+ git clone --depth 1 --recursive -b release https://github.com/ethereum/solidity && \
+ cd /solidity && cmake -DCMAKE_BUILD_TYPE=Release -DTESTS=0 -DSTATIC_LINKING=1 && \
+ cd /solidity && make solc && install -s solc/solc /usr/bin && \
+ cd / && rm -rf solidity && \
+ apk del sed build-base git make cmake gcc g++ musl-dev curl-dev boost-dev && \
+ rm -rf /var/cache/apk/*
diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh
index c9f82769..255176ab 100755
--- a/scripts/install_deps.sh
+++ b/scripts/install_deps.sh
@@ -83,12 +83,6 @@ case $(uname -s) in
;;
10.12)
echo "Installing solidity dependencies on macOS 10.12 Sierra."
- echo ""
- echo "NOTE - You are in unknown territory with this preview OS."
- echo "Even Homebrew doesn't have official support yet, and there are"
- echo "known issues (see https://github.com/ethereum/webthree-umbrella/issues/614)."
- echo "If you would like to partner with us to work through these issues, that"
- echo "would be fantastic. Please just comment on that issue. Thanks!"
;;
*)
echo "Unsupported macOS version."
diff --git a/scripts/isolateTests.py b/scripts/isolateTests.py
deleted file mode 100755
index fed779d3..00000000
--- a/scripts/isolateTests.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/python
-#
-# This script reads C++ source files and writes all
-# multi-line strings into individual files.
-# This can be used to extract the Solidity test cases
-# into files for e.g. fuzz testing as
-# scripts/isolateTests.py tests/libsolidity/SolidityEndToEndTest.cpp
-
-import sys
-lines = sys.stdin.read().split('\n')
-inside = False
-tests = []
-for l in lines:
- if inside:
- if l.strip().endswith(')";'):
- inside = False
- else:
- tests[-1] += l + '\n'
- else:
- if l.strip().endswith('R"('):
- inside = True
- tests += ['']
-for i in range(len(tests)):
- open('test%d.sol' % i, 'w').write(tests[i])
diff --git a/scripts/isolate_tests.py b/scripts/isolate_tests.py
new file mode 100755
index 00000000..91900aa6
--- /dev/null
+++ b/scripts/isolate_tests.py
@@ -0,0 +1,44 @@
+#!/usr/bin/python
+#
+# This script reads C++ source files and writes all
+# multi-line strings into individual files.
+# This can be used to extract the Solidity test cases
+# into files for e.g. fuzz testing as
+# scripts/isolate_tests.py test/libsolidity/*
+
+import sys
+
+
+def extract_cases(path):
+ lines = open(path).read().splitlines()
+
+ inside = False
+ tests = []
+
+ for l in lines:
+ if inside:
+ if l.strip().endswith(')";'):
+ inside = False
+ else:
+ tests[-1] += l + '\n'
+ else:
+ if l.strip().endswith('R"('):
+ inside = True
+ tests += ['']
+
+ return tests
+
+
+def write_cases(tests, start=0):
+ for i, test in enumerate(tests, start=start):
+ open('test%d.sol' % i, 'w').write(test)
+
+
+if __name__ == '__main__':
+ files = sys.argv[1:]
+
+ i = 0
+ for path in files:
+ cases = extract_cases(path)
+ write_cases(cases, start=i)
+ i += len(cases)
diff --git a/scripts/tests.sh b/scripts/tests.sh
index 5da427d4..dfbda734 100755
--- a/scripts/tests.sh
+++ b/scripts/tests.sh
@@ -65,9 +65,14 @@ $ETH_PATH --test -d /tmp/test &
# The node needs to get a little way into its startup sequence before the IPC
# is available and is ready for the unit-tests to start talking to it.
while [ ! -S /tmp/test/geth.ipc ]; do sleep 2; done
+echo "--> IPC available."
-# And then run the Solidity unit-tests, pointing to that IPC endpoint.
-"$REPO_ROOT"/build/test/soltest -- --ipcpath /tmp/test/geth.ipc
+# And then run the Solidity unit-tests (once without optimization, once with),
+# pointing to that IPC endpoint.
+echo "--> Running tests without optimizer..."
+ "$REPO_ROOT"/build/test/soltest -- --ipcpath /tmp/test/geth.ipc && \
+ echo "--> Running tests WITH optimizer..." && \
+ "$REPO_ROOT"/build/test/soltest -- --optimize --ipcpath /tmp/test/geth.ipc
ERROR_CODE=$?
pkill eth || true
sleep 4
diff --git a/scripts/travis-emscripten/build_emscripten.sh b/scripts/travis-emscripten/build_emscripten.sh
index f5374a33..a6eb01a0 100755
--- a/scripts/travis-emscripten/build_emscripten.sh
+++ b/scripts/travis-emscripten/build_emscripten.sh
@@ -95,4 +95,8 @@ emmake make -j 4
cd ..
cp build/solc/soljson.js ./
+OUTPUT_SIZE=`ls -la build/solc/soljson.js`
+
+echo "Emscripten output size: ${OUTPUT_SIZE}"
+
echo -en 'travis_fold:end:compiling_solidity\\r'