You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmonero/tests
moneroexamples 79e207a821
tests/README.md updated
6 years ago
..
res outputs_testnet_9wq792k9.csv added 6 years ago
CMakeLists.txt txsearch_tests.cpp initialized 6 years ago
README.md tests/README.md updated 6 years ago
bcstatus_tests.cpp txsearch_tests.cpp initialized 6 years ago
helpers.h CMakeList.txt updated 6 years ago
microcore_tests.cpp CurrentBlockchainStatus::monitor_blockchain tested 6 years ago
mocks.h fix: csv path in a test 6 years ago
mysql_tests.cpp CurrentBlockchainStatus::monitor_blockchain added 6 years ago
txsearch_tests.cpp fix: csv path in a test 6 years ago

README.md

Testing openmonero

Googletest and googlemock frameworks are used for unit testing of openmonero. There is no need to install them, as they are provided with openmonero.

MySQL setup

Testing openmonero's operations on MySQL database are performed using actuall mysql database. For this purpose a testing database with some pre-populated data is used: openmonero_test. Thus before tests are run, make sure that openmonero_test database is initilized using openmonero/sql/openmonero_test.sql file, and database_test contains information on conneting to the test database in openmonero/config/config.json.

Compile and run openmonero tests

# go into build folder of openmonero
cd openmonero/build

# indicate that test should be build
cmake .. -DBUILD_TEST=ON

# compile openmonero with tests
make

# run all tests
make test

# the above command will produce summary of test results (shown below).
# for verbouse output, the following command can use
# make test ARGS=-V

# individual tests executables can also be run. they are located in
# openmonero/build/tests

Example test output is:

mwo@arch:build$ make test
Running tests...
Test project /home/mwo/openmonero/build
    Start 1: mysql_tests
1/4 Test #1: mysql_tests ......................   Passed   60.64 sec
    Start 2: microcore_tests
2/4 Test #2: microcore_tests ..................   Passed    1.67 sec
    Start 3: bcstatus_tests
3/4 Test #3: bcstatus_tests ...................   Passed   25.39 sec
    Start 4: txsearch_tests
4/4 Test #4: txsearch_tests ...................   Passed    1.04 sec

100% tests passed, 0 tests failed out of 4

Total Test time (real) =  88.79 sec