Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Fix building integration tests #24

Merged
merged 3 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ If issues persist with ccache
export CCACHE_DISABLE=1
```

#### For building integration tests with mandel built from source (not installed)

Need to provide some environment variables to find necessary test dependencies
Currently need both while mandel repo is undergoing evolution in naming.

```sh
export mandel_DIR=${mandel_root}/build/lib/cmake/eosio
export eosio_DIR=${mandel_root}/build/lib/cmake/eosio
```

### Guided Installation or Building from Scratch
```sh
git clone --recursive https://github.com/eosnetworkfoundation/mandel.cdt
Expand All @@ -57,6 +67,22 @@ Or you can install globally by running this command:
sudo make install
```

### Running Tests

#### Unit Tests
```sh
cd build

ctest
```

#### Running Integration Tests (if built)
```sh
cd build/tests/integration

ctest
```

### Uninstall after manual installation

```sh
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ set(EOSIO_VERSION_SOFT_MAX "3.0")

find_package(eosio)

find_path(GMP_INCLUDE_DIR NAMES gmp.h)
find_library(GMP_LIBRARY gmp)

### Check the version of eosio
set(VERSION_MATCH_ERROR_MSG "")
EOSIO_CHECK_VERSION(VERSION_OUTPUT "${EOSIO_VERSION}"
Expand All @@ -32,6 +35,8 @@ file(GLOB INT_TESTS "*.cpp" "*.hpp")

add_eosio_test_executable( integration_tests ${INT_TESTS} )

target_link_libraries( integration_tests ${GMP_LIBRARY} )

foreach(TEST_SUITE ${INT_TESTS}) # create an independent target for each test suite
execute_process(COMMAND bash -c "grep -E 'BOOST_AUTO_TEST_SUITE\\s*[(]' ${TEST_SUITE} | grep -vE '//.*BOOST_AUTO_TEST_SUITE\\s*[(]' | cut -d ')' -f 1 | cut -d '(' -f 2" OUTPUT_VARIABLE SUITE_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) # get the test suite name from the *.cpp file
if (NOT "" STREQUAL "${SUITE_NAME}") # ignore empty lines
Expand Down