-
rbrunnerI am learning how to execute tests with Monero. I already found out that I can run a certain set of tests by running 'ctest' in a suitable directory, e.g. /tests/unit_tests
-
rbrunnerBut how would I run a single test in one of the many files that go into "unit_tests", e.g. this one:
-
rbrunnerTEST(bulletproofs_plus, valid_zero)
-
moneromooo./build/wherever/unit_tests/unit_tests --gtest_filter=bulletproofs_plus.valid_zero
-
rbrunnerAh, I see. So I run the test binary, not 'ctest'
-
rbrunnerAnd I guess I could also debug this in the normal way if I want to step through a test?
-
moneromoooWay too much reliance on implicit knowledge for me to answer that.
-
moneromoooPersonally, I add lots of logs, run and read.
-
moneromoooAlso, running with asan can be nice.
-
rbrunnerAlright, thanks. I guess it should be no problem to take that 'unit_tests' binary into a debugger; will just experiment a little.
-
rbrunnerAh, that 'unit_tests' even has a --help option :)
-
selstarbrunner: yes you can use it normally with a debugger
-
selstalldb unit_tests -- --gtest_filter=test_epee_connection.test_lifetime
-
selstaI assume gdb syntax is similar
-
rbrunnerYup, it runs without problems also under control of VSCode, with breakpoints, interactive stepping through, looking at variable values, and all. For once something that is simple.
-
rbrunnerIf you just know how to start the damned things :)
-
MeowingCatmeow