only run catch2 tests in gdb and add assert to unit test

pull/1306/head
Jeff Becker 4 years ago
parent 1ac7da294f
commit b6a7b5ccfb
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -46,7 +46,7 @@ local debian_pipeline(name, image,
(if lto then '' else '-DWITH_LTO=OFF ') + (if lto then '' else '-DWITH_LTO=OFF ') +
cmake_extra, cmake_extra,
'ninja clean && ninja -v', 'ninja clean && ninja -v',
'../contrib/ci/drone-gdb.sh ./test/testAll --gtest_color=yes', './test/testAll --gtest_color=yes',
'../contrib/ci/drone-gdb.sh ./test/catchAll --use-colour yes', '../contrib/ci/drone-gdb.sh ./test/catchAll --use-colour yes',
] + extra_cmds, ] + extra_cmds,
} }

@ -6,11 +6,12 @@
#include <llarp.hpp> #include <llarp.hpp>
#include <catch2/catch.hpp> #include <catch2/catch.hpp>
static llarp_main* llarp_main*
make_context() make_context()
{ {
// make config // make config
auto config = llarp_default_relay_config(); auto config = llarp_default_relay_config();
REQUIRE(config != nullptr);
// set testing defaults // set testing defaults
config->impl.network.m_endpointType = "null"; config->impl.network.m_endpointType = "null";
config->impl.bootstrap.skipBootstrap = true; config->impl.bootstrap.skipBootstrap = true;
@ -23,6 +24,7 @@ make_context()
link.port = 0; link.port = 0;
// configure // configure
auto ptr = llarp_main_init_from_config(config, true); auto ptr = llarp_main_init_from_config(config, true);
REQUIRE(ptr != nullptr);
llarp_config_free(config); llarp_config_free(config);
return ptr; return ptr;
} }

Loading…
Cancel
Save