mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6462 from rocky/soltest-enhancements
Soltest enhancements
This commit is contained in:
commit
a018147c66
@ -46,6 +46,8 @@ foo->bar(someLongVariableName,
|
|||||||
cout << "some very long string that contains completely irrelevant text that talks about this and that and contains the words \"lorem\" and \"ipsum\"" << endl;
|
cout << "some very long string that contains completely irrelevant text that talks about this and that and contains the words \"lorem\" and \"ipsum\"" << endl;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To set indentation and tab width settings uniformly, the repository contains an [EditorConfig](https://editorconfig.org/) [`.editorconfig`](https://github.com/ethereum/solidity/blob/develop/.editorconfig) file, which describes some of the styles used and which is recognized by many IDE's and editors.
|
||||||
|
|
||||||
## 1. Namespaces
|
## 1. Namespaces
|
||||||
|
|
||||||
1. No `using namespace` declarations in header files.
|
1. No `using namespace` declarations in header files.
|
||||||
|
@ -30,10 +30,9 @@ Bugfixes:
|
|||||||
libraries. This affected code generation.
|
libraries. This affected code generation.
|
||||||
* Yul: Properly register functions and disallow shadowing between function variables and variables in the outside scope.
|
* Yul: Properly register functions and disallow shadowing between function variables and variables in the outside scope.
|
||||||
|
|
||||||
|
|
||||||
Build System:
|
Build System:
|
||||||
* Soltest: Add commandline option `--test` / `-t` to isoltest which takes a string that allows filtering unit tests.
|
* Soltest: Add commandline option `--test` / `-t` to isoltest which takes a string that allows filtering unit tests.
|
||||||
|
* soltest.sh: allow environment variable ``SOLIDITY_BUILD_DIR`` to specify build folder and add ``--help`` usage.
|
||||||
|
|
||||||
### 0.5.7 (2019-03-26)
|
### 0.5.7 (2019-03-26)
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# CMAKE macros to set default CMAKE options and to show the
|
||||||
|
# resulting configuration.
|
||||||
|
|
||||||
macro(configure_project)
|
macro(configure_project)
|
||||||
set(NAME ${PROJECT_NAME})
|
set(NAME ${PROJECT_NAME})
|
||||||
|
|
||||||
@ -22,7 +25,7 @@ endmacro()
|
|||||||
macro(print_config NAME)
|
macro(print_config NAME)
|
||||||
message("")
|
message("")
|
||||||
message("------------------------------------------------------------------------")
|
message("------------------------------------------------------------------------")
|
||||||
message("-- Configuring ${NAME}")
|
message("-- Configuring ${NAME} ${PROJECT_VERSION}")
|
||||||
message("------------------------------------------------------------------------")
|
message("------------------------------------------------------------------------")
|
||||||
message("-- CMake Version ${CMAKE_VERSION}")
|
message("-- CMake Version ${CMAKE_VERSION}")
|
||||||
message("-- CMAKE_BUILD_TYPE Build type ${CMAKE_BUILD_TYPE}")
|
message("-- CMAKE_BUILD_TYPE Build type ${CMAKE_BUILD_TYPE}")
|
||||||
@ -36,6 +39,9 @@ endif()
|
|||||||
if (SUPPORT_TOOLS)
|
if (SUPPORT_TOOLS)
|
||||||
message("-- TOOLS Build tools ${TOOLS}")
|
message("-- TOOLS Build tools ${TOOLS}")
|
||||||
endif()
|
endif()
|
||||||
|
message("------------------------------------------------------------------ flags")
|
||||||
|
message("-- OSSFUZZ ${OSSFUZZ}")
|
||||||
|
message("-- LLL ${LLL}")
|
||||||
message("------------------------------------------------------------------------")
|
message("------------------------------------------------------------------------")
|
||||||
message("")
|
message("")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
@ -74,12 +74,18 @@ The ``./scripts/tests.sh`` script executes most Solidity tests and
|
|||||||
runs ``aleth`` automatically if it is in the path. The script does not download it,
|
runs ``aleth`` automatically if it is in the path. The script does not download it,
|
||||||
so you need to install it first. Please read on for the details.
|
so you need to install it first. Please read on for the details.
|
||||||
|
|
||||||
Solidity includes different types of tests, most of them bundled into the `C++ Boost Test Framework <https://www.boost.org/doc/libs/1_69_0/libs/test/doc/html/index.html>`_ application ``soltest``.
|
Solidity includes different types of tests, most of them bundled into the `Boost C++ Test Framework <https://www.boost.org/doc/libs/1_69_0/libs/test/doc/html/index.html>`_ application ``soltest``.
|
||||||
Some of them require the ``aleth`` client in testing mode, others require ``libz3``.
|
Some of them require the ``aleth`` client in testing mode, others require ``libz3``.
|
||||||
|
|
||||||
To run a basic set of tests that require neither ``aleth`` nor ``libz3``, run
|
To run a basic set of tests that require neither ``aleth`` nor ``libz3``, run
|
||||||
``./scripts/soltest.sh --no-ipc --no-smt``. This script runs ``./build/test/soltest``
|
``./scripts/soltest.sh --no-ipc --no-smt``.
|
||||||
internally. ``./build/test/soltest --help`` has extensive help on all of the options available. See especially `run_test <https://www.boost.org/doc/libs/1_69_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/run_test.html>`_ to list specific unit tests, and `report-level <https://www.boost.org/doc/libs/1_69_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/report_level.html>`_ give a more detailed report.
|
|
||||||
|
``./build/test/soltest --help`` has extensive help on all of the options available.
|
||||||
|
See especially:
|
||||||
|
|
||||||
|
- `show_progress (-p) <https://www.boost.org/doc/libs/1_69_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/show_progress.html>`_ to show test completion,
|
||||||
|
- `run_test (-t) <https://www.boost.org/doc/libs/1_69_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/run_test.html>`_ to run specific tests cases, and
|
||||||
|
- `report-level (-r) <https://www.boost.org/doc/libs/1_69_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/report_level.html>`_ give a more detailed report.
|
||||||
|
|
||||||
.. note ::
|
.. note ::
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
REPO_ROOT="$(dirname "$0")"/..
|
REPO_ROOT="$(dirname "$0")"/..
|
||||||
@ -7,6 +6,27 @@ USE_DEBUGGER=0
|
|||||||
DEBUGGER="gdb --args"
|
DEBUGGER="gdb --args"
|
||||||
BOOST_OPTIONS=
|
BOOST_OPTIONS=
|
||||||
SOLTEST_OPTIONS=
|
SOLTEST_OPTIONS=
|
||||||
|
SOLIDITY_BUILD_DIR=${SOLIDITY_BUILD_DIR:-build}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo 2>&1 "
|
||||||
|
Usage: $0 [options] [soltest-options]
|
||||||
|
Runs BOOST C++ unit test program, soltest.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--debug soltest invocation prefaced with: \"$DEBUGGER\"
|
||||||
|
--debugger *dbg-cmd* soltest prefaced with your own debugger command.
|
||||||
|
--run_test | -t *name* filters test unit(s) to include or exclude from test.
|
||||||
|
This option can be given several times.
|
||||||
|
--boost-options *x* Set BOOST option *x*.
|
||||||
|
--show-progress | -p Set BOOST option --show-progress.
|
||||||
|
|
||||||
|
Important environment variables:
|
||||||
|
|
||||||
|
SOLIDITY_BUILD_DIR: Sets directory under the repository root of where test/soltest should be found.
|
||||||
|
The default is \"${SOLIDITY_BUILD_DIR}\".
|
||||||
|
"
|
||||||
|
}
|
||||||
|
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
do
|
do
|
||||||
@ -23,7 +43,11 @@ do
|
|||||||
shift
|
shift
|
||||||
BOOST_OPTIONS="${BOOST_OPTIONS} $1"
|
BOOST_OPTIONS="${BOOST_OPTIONS} $1"
|
||||||
;;
|
;;
|
||||||
-t)
|
--help)
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--run_test | -t )
|
||||||
shift
|
shift
|
||||||
BOOST_OPTIONS="${BOOST_OPTIONS} -t $1"
|
BOOST_OPTIONS="${BOOST_OPTIONS} -t $1"
|
||||||
;;
|
;;
|
||||||
@ -40,4 +64,4 @@ if [ "$USE_DEBUGGER" -ne "0" ]; then
|
|||||||
DEBUG_PREFIX=${DEBUGGER}
|
DEBUG_PREFIX=${DEBUGGER}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${DEBUG_PREFIX} ${REPO_ROOT}/build/test/soltest ${BOOST_OPTIONS} -- --testpath ${REPO_ROOT}/test ${SOLTEST_OPTIONS}
|
exec ${DEBUG_PREFIX} ${REPO_ROOT}/${SOLIDITY_BUILD_DIR}/test/soltest ${BOOST_OPTIONS} -- --testpath ${REPO_ROOT}/test ${SOLTEST_OPTIONS}
|
||||||
|
Loading…
Reference in New Issue
Block a user