diff options
-rw-r--r-- | circle.yml | 108 | ||||
-rw-r--r-- | docs/abi-spec.rst | 8 | ||||
-rw-r--r-- | libevmasm/ConstantOptimiser.h | 1 | ||||
-rw-r--r-- | libevmasm/PeepholeOptimiser.h | 2 | ||||
-rw-r--r-- | libjulia/optimiser/ASTCopier.h | 3 | ||||
-rw-r--r-- | libjulia/optimiser/ASTWalker.h | 2 | ||||
-rw-r--r-- | libsolidity/ast/AST.h | 4 | ||||
-rw-r--r-- | libsolidity/ast/ASTVisitor.h | 2 | ||||
-rw-r--r-- | libsolidity/ast/Types.h | 1 | ||||
-rw-r--r-- | libsolidity/formal/SolverInterface.h | 1 | ||||
-rw-r--r-- | libsolidity/formal/SymbolicVariable.h | 1 | ||||
-rwxr-xr-x | scripts/tests.sh | 29 | ||||
-rw-r--r-- | test/ExecutionFramework.h | 1 | ||||
-rw-r--r-- | test/libsolidity/AnalysisFramework.h | 1 |
14 files changed, 123 insertions, 41 deletions
@@ -4,6 +4,32 @@ defaults: filters: tags: only: /.*/ + - setup_prerelease_commit_hash: &setup_prerelease_commit_hash + name: Store commit hash and prerelease + command: | + if [ "$CIRCLE_BRANCH" = release -o -n "$CIRCLE_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi + echo -n "$CIRCLE_SHA1" > commit_hash.txt + - run_build: &run_build + name: Build + command: | + mkdir -p build + cd build + cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo + make -j4 + - run_tests: &run_tests + name: Tests + command: scripts/tests.sh --junit_report test_results + environment: + TERM: dumb + - solc_artifact: &solc_artifact + path: build/solc/solc + destination: solc + - all_artifacts: &all_artifacts + root: build + paths: + - solc/solc + - test/soltest + - test/tools/solfuzzer version: 2 jobs: @@ -87,7 +113,7 @@ jobs: command: | . /usr/local/nvm/nvm.sh test/externalTests.sh /tmp/workspace/soljson.js || test/externalTests.sh /tmp/workspace/soljson.js - build_x86: + build_x86_linux: docker: - image: buildpack-deps:artful steps: @@ -97,29 +123,31 @@ jobs: command: | apt-get -qq update apt-get -qy install cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libz3-dev + - run: *setup_prerelease_commit_hash + - run: *run_build + - store_artifacts: *solc_artifact + - persist_to_workspace: *all_artifacts + + build_x86_mac: + macos: + xcode: "9.0" + steps: + - checkout - run: - name: Store commit hash and prerelease - command: | - if [ "$CIRCLE_BRANCH" = release -o -n "$CIRCLE_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi - echo -n "$CIRCLE_SHA1" > commit_hash.txt - - run: - name: Build + name: Install build dependencies command: | - mkdir -p build - cd build - cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo - make -j4 - - store_artifacts: - path: build/solc/solc - destination: solc - - persist_to_workspace: - root: build - paths: - - solc/solc - - test/soltest - - test/tools/solfuzzer + brew update + brew upgrade + brew unlink python + brew install z3 + brew install boost + brew install cmake + - run: *setup_prerelease_commit_hash + - run: *run_build + - store_artifacts: *solc_artifact + - persist_to_workspace: *all_artifacts - test_x86: + test_x86_linux: docker: - image: buildpack-deps:artful steps: @@ -132,9 +160,26 @@ jobs: apt-get -qq update apt-get -qy install libz3-dev libleveldb1v5 - run: mkdir -p test_results + - run: *run_tests + - store_test_results: + path: test_results/ + + test_x86_mac: + macos: + xcode: "9.0" + steps: + - checkout + - attach_workspace: + at: build - run: - name: Tests - command: scripts/tests.sh --junit_report test_results + name: Install dependencies + command: | + brew update + brew upgrade + brew unlink python + brew install z3 + - run: mkdir -p test_results + - run: *run_tests - store_test_results: path: test_results/ @@ -148,11 +193,7 @@ jobs: command: | apt-get -qq update apt-get -qy install python-sphinx - - run: - name: Store commit hash and prerelease - command: | - if [ "$CIRCLE_BRANCH" = release -o -n "$CIRCLE_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi - echo -n "$CIRCLE_SHA1" > commit_hash.txt + - run: *setup_prerelease_commit_hash - run: name: Build documentation command: ./scripts/docs.sh @@ -173,9 +214,14 @@ workflows: <<: *build_on_tags requires: - build_emscripten - - build_x86: *build_on_tags - - test_x86: + - build_x86_linux: *build_on_tags + - build_x86_mac: *build_on_tags + - test_x86_linux: + <<: *build_on_tags + requires: + - build_x86_linux + - test_x86_mac: <<: *build_on_tags requires: - - build_x86 + - build_x86_mac - docs: *build_on_tags diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst index 98301fdc..b0b16e28 100644 --- a/docs/abi-spec.rst +++ b/docs/abi-spec.rst @@ -77,7 +77,7 @@ of them inside parentheses, separated by commas: - ``(T1,T2,...,Tn)``: tuple consisting of the types ``T1``, ..., ``Tn``, ``n >= 0`` -It is possible to form tuples of tuples, arrays of tuples and so on. +It is possible to form tuples of tuples, arrays of tuples and so on. It is also possible to form zero-tuples (where ``n == 0``). .. note:: Solidity supports all the types presented above with the same names with the exception of tuples. The ABI tuple type is utilised for encoding Solidity ``structs``. @@ -117,7 +117,7 @@ on the type of ``X`` being - ``(T1,...,Tk)`` for ``k >= 0`` and any types ``T1``, ..., ``Tk`` - ``enc(X) = head(X(1)) ... head(X(k-1)) tail(X(0)) ... tail(X(k-1))`` + ``enc(X) = head(X(1)) ... head(X(k)) tail(X(1)) ... tail(X(k))`` where ``X(i)`` is the ``ith`` component of the value, and ``head`` and ``tail`` are defined for ``Ti`` being a static type as @@ -126,7 +126,7 @@ on the type of ``X`` being and as - ``head(X(i)) = enc(len(head(X(0)) ... head(X(k-1)) tail(X(0)) ... tail(X(i-1))))`` + ``head(X(i)) = enc(len( head(X(1)) ... head(X(k)) tail(X(1)) ... tail(X(i-1)) ))`` ``tail(X(i)) = enc(X(i))`` otherwise, i.e. if ``Ti`` is a dynamic type. @@ -137,7 +137,7 @@ on the type of ``X`` being - ``T[k]`` for any ``T`` and ``k``: - ``enc(X) = enc((X[0], ..., X[k-1]))`` + ``enc(X) = enc((X[1], ..., X[k]))`` i.e. it is encoded as if it were a tuple with ``k`` elements of the same type. diff --git a/libevmasm/ConstantOptimiser.h b/libevmasm/ConstantOptimiser.h index 9b60b26b..f0deb387 100644 --- a/libevmasm/ConstantOptimiser.h +++ b/libevmasm/ConstantOptimiser.h @@ -67,6 +67,7 @@ public: explicit ConstantOptimisationMethod(Params const& _params, u256 const& _value): m_params(_params), m_value(_value) {} + virtual ~ConstantOptimisationMethod() = default; virtual bigint gasNeeded() const = 0; /// Executes the method, potentially appending to the assembly and returns a vector of /// assembly items the constant should be relpaced with in one sweep. diff --git a/libevmasm/PeepholeOptimiser.h b/libevmasm/PeepholeOptimiser.h index a74cc8b3..a651143d 100644 --- a/libevmasm/PeepholeOptimiser.h +++ b/libevmasm/PeepholeOptimiser.h @@ -34,6 +34,7 @@ using AssemblyItems = std::vector<AssemblyItem>; class PeepholeOptimisationMethod { public: + virtual ~PeepholeOptimisationMethod() = default; virtual size_t windowSize() const; virtual bool apply(AssemblyItems::const_iterator _in, std::back_insert_iterator<AssemblyItems> _out); }; @@ -42,6 +43,7 @@ class PeepholeOptimiser { public: explicit PeepholeOptimiser(AssemblyItems& _items): m_items(_items) {} + virtual ~PeepholeOptimiser() = default; bool optimise(); diff --git a/libjulia/optimiser/ASTCopier.h b/libjulia/optimiser/ASTCopier.h index 36a1ced5..8681f2e0 100644 --- a/libjulia/optimiser/ASTCopier.h +++ b/libjulia/optimiser/ASTCopier.h @@ -37,6 +37,7 @@ namespace julia class ExpressionCopier: public boost::static_visitor<Expression> { public: + virtual ~ExpressionCopier() = default; virtual Expression operator()(Literal const& _literal) = 0; virtual Expression operator()(Identifier const& _identifier) = 0; virtual Expression operator()(FunctionalInstruction const& _instr) = 0; @@ -46,6 +47,7 @@ public: class StatementCopier: public boost::static_visitor<Statement> { public: + virtual ~StatementCopier() = default; virtual Statement operator()(ExpressionStatement const& _statement) = 0; virtual Statement operator()(Instruction const& _instruction) = 0; virtual Statement operator()(Label const& _label) = 0; @@ -66,6 +68,7 @@ public: class ASTCopier: public ExpressionCopier, public StatementCopier { public: + virtual ~ASTCopier() = default; virtual Expression operator()(Literal const& _literal) override; virtual Statement operator()(Instruction const& _instruction) override; virtual Expression operator()(Identifier const& _identifier) override; diff --git a/libjulia/optimiser/ASTWalker.h b/libjulia/optimiser/ASTWalker.h index 97891381..f09c2ff1 100644 --- a/libjulia/optimiser/ASTWalker.h +++ b/libjulia/optimiser/ASTWalker.h @@ -42,6 +42,7 @@ namespace julia class ASTWalker: public boost::static_visitor<> { public: + virtual ~ASTWalker() = default; virtual void operator()(Literal const&) {} virtual void operator()(Instruction const&) { solAssert(false, ""); } virtual void operator()(Identifier const&) {} @@ -82,6 +83,7 @@ protected: class ASTModifier: public boost::static_visitor<> { public: + virtual ~ASTModifier() = default; virtual void operator()(Literal&) {} virtual void operator()(Instruction&) { solAssert(false, ""); } virtual void operator()(Identifier&) {} diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index a53987bf..fa0d6921 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -146,6 +146,7 @@ private: class Scopable { public: + virtual ~Scopable() = default; /// @returns the scope this declaration resides in. Can be nullptr if it is the global scope. /// Available only after name and type resolution step. ASTNode const* scope() const { return m_scope; } @@ -307,6 +308,7 @@ private: class VariableScope { public: + virtual ~VariableScope() = default; void addLocalVariable(VariableDeclaration const& _localVariable) { m_localVariables.push_back(&_localVariable); } std::vector<VariableDeclaration const*> const& localVariables() const { return m_localVariables; } @@ -320,6 +322,7 @@ private: class Documented { public: + virtual ~Documented() = default; explicit Documented(ASTPointer<ASTString> const& _documentation): m_documentation(_documentation) {} /// @return A shared pointer of an ASTString. @@ -336,6 +339,7 @@ protected: class ImplementationOptional { public: + virtual ~ImplementationOptional() = default; explicit ImplementationOptional(bool _implemented): m_implemented(_implemented) {} /// @return whether this node is fully implemented or not diff --git a/libsolidity/ast/ASTVisitor.h b/libsolidity/ast/ASTVisitor.h index b1389f0f..6c0ce6f8 100644 --- a/libsolidity/ast/ASTVisitor.h +++ b/libsolidity/ast/ASTVisitor.h @@ -43,6 +43,7 @@ namespace solidity class ASTVisitor { public: + virtual ~ASTVisitor() = default; virtual bool visit(SourceUnit& _node) { return visitNode(_node); } virtual bool visit(PragmaDirective& _node) { return visitNode(_node); } virtual bool visit(ImportDirective& _node) { return visitNode(_node); } @@ -147,6 +148,7 @@ protected: class ASTConstVisitor { public: + virtual ~ASTConstVisitor() = default; virtual bool visit(SourceUnit const& _node) { return visitNode(_node); } virtual bool visit(PragmaDirective const& _node) { return visitNode(_node); } virtual bool visit(ImportDirective const& _node) { return visitNode(_node); } diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h index a9536657..ca6822c9 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -138,6 +138,7 @@ private: class Type: private boost::noncopyable, public std::enable_shared_from_this<Type> { public: + virtual ~Type() = default; enum class Category { Integer, RationalNumber, StringLiteral, Bool, FixedPoint, Array, diff --git a/libsolidity/formal/SolverInterface.h b/libsolidity/formal/SolverInterface.h index e127bb55..16796684 100644 --- a/libsolidity/formal/SolverInterface.h +++ b/libsolidity/formal/SolverInterface.h @@ -193,6 +193,7 @@ DEV_SIMPLE_EXCEPTION(SolverError); class SolverInterface { public: + virtual ~SolverInterface() = default; virtual void reset() = 0; virtual void push() = 0; diff --git a/libsolidity/formal/SymbolicVariable.h b/libsolidity/formal/SymbolicVariable.h index e4e4ea8d..e29ded26 100644 --- a/libsolidity/formal/SymbolicVariable.h +++ b/libsolidity/formal/SymbolicVariable.h @@ -40,6 +40,7 @@ public: Declaration const& _decl, smt::SolverInterface& _interface ); + virtual ~SymbolicVariable() = default; smt::Expression operator()(int _seq) const { diff --git a/scripts/tests.sh b/scripts/tests.sh index 38073bf3..d63c1fe4 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -30,6 +30,17 @@ set -e REPO_ROOT="$(dirname "$0")"/.. +IPC_ENABLED=true +if [[ "$OSTYPE" == "darwin"* ]] +then + SMT_FLAGS="--no-smt" + if [ "$CIRCLECI" ] + then + IPC_ENABLED=false + IPC_FLAGS="--no-ipc" + fi +fi + if [ "$1" = --junit_report ] then if [ -z "$2" ] @@ -98,8 +109,11 @@ function run_eth() sleep 2 } -download_eth -ETH_PID=$(run_eth /tmp/test) +if [ "$IPC_ENABLED" = true ]; +then + download_eth + ETH_PID=$(run_eth /tmp/test) +fi progress="--show-progress" if [ "$CIRCLECI" ] @@ -131,7 +145,7 @@ do log=--logger=JUNIT,test_suite,$log_directory/noopt_$vm.xml $testargs_no_opt fi fi - "$REPO_ROOT"/build/test/soltest $progress $log -- --testpath "$REPO_ROOT"/test "$optimize" --evm-version "$vm" --ipcpath /tmp/test/geth.ipc + "$REPO_ROOT"/build/test/soltest $progress $log -- --testpath "$REPO_ROOT"/test "$optimize" --evm-version "$vm" $SMT_FLAGS $IPC_FLAGS --ipcpath /tmp/test/geth.ipc done done @@ -141,6 +155,9 @@ then exit 1 fi -pkill "$ETH_PID" || true -sleep 4 -pgrep "$ETH_PID" && pkill -9 "$ETH_PID" || true +if [ "$IPC_ENABLED" = true ] +then + pkill "$ETH_PID" || true + sleep 4 + pgrep "$ETH_PID" && pkill -9 "$ETH_PID" || true +fi diff --git a/test/ExecutionFramework.h b/test/ExecutionFramework.h index ee8da322..4525cbf9 100644 --- a/test/ExecutionFramework.h +++ b/test/ExecutionFramework.h @@ -53,6 +53,7 @@ class ExecutionFramework public: ExecutionFramework(); + virtual ~ExecutionFramework() = default; virtual bytes const& compileAndRunWithoutCheck( std::string const& _sourceCode, diff --git a/test/libsolidity/AnalysisFramework.h b/test/libsolidity/AnalysisFramework.h index 05490a42..a904617d 100644 --- a/test/libsolidity/AnalysisFramework.h +++ b/test/libsolidity/AnalysisFramework.h @@ -52,6 +52,7 @@ protected: bool _insertVersionPragma = true, bool _allowMultipleErrors = false ); + virtual ~AnalysisFramework() = default; SourceUnit const* parseAndAnalyse(std::string const& _source); bool success(std::string const& _source); |