tests.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/env bash
  2. #------------------------------------------------------------------------------
  3. # Bash script to execute the cpp-ethereum tests.
  4. #
  5. # The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org
  6. #
  7. # ------------------------------------------------------------------------------
  8. # This file is part of cpp-ethereum.
  9. #
  10. # cpp-ethereum is free software: you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation, either version 3 of the License, or
  13. # (at your option) any later version.
  14. #
  15. # cpp-ethereum is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>
  22. #
  23. # (c) 2016 cpp-ethereum contributors.
  24. #------------------------------------------------------------------------------
  25. set -e
  26. TESTS=$1
  27. # There is an implicit assumption here that we HAVE to run from build directory.
  28. BUILD_ROOT=$(pwd)
  29. if [[ "$TESTS" == "On" ]]; then
  30. # Clone the end-to-end test repo, and point environment variable at it.
  31. cd ../..
  32. git clone https://github.com/ethereum/tests.git
  33. export ETHEREUM_TEST_PATH=$(pwd)/tests/
  34. # Run the tests for the Interpreter
  35. cd cpp-ethereum/build
  36. $BUILD_ROOT/test/testeth
  37. # Run the tests for the JIT (but only for Ubuntu, not macOS)
  38. # The whole automation process is too slow for macOS, and we don't have
  39. # enough time to build LLVM, build EVMJIT and run the tests twice within
  40. # the 48 minute absolute maximum run time for TravisCI.
  41. if [[ "$OSTYPE" != "darwin"* ]]; then
  42. $BUILD_ROOT/test/testeth -t "VMTests*,StateTests*" -- --vm jit
  43. fi
  44. fi