Commit Graph

12 Commits

Author SHA1 Message Date
Tomasz Grabiec
3a211c4db5 tests: Move seatar-boost test framework to a separate compilation unit
So that it's compiled only once and not for every test. This change
reduced recompilation time for a dummy test module from 40 seconds to
4 on my laptop.

This change also makes it now possible to pass seastar framework command
line arguments to every test using this framework.
2015-04-10 19:34:04 +02:00
Shlomi Livne
cbf972c135 tests: set BOOST_TEST_SUITE to the test file name instead of the generic "seastar-tests"
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-03-29 11:54:01 +03:00
Shlomi Livne
83c0196255 tests: make sure each SEASTAR_TEST_CASE has at least a single BOOST_XXX check
SEASTAR_TEST_CASE that did not execute a single BOOST_XXX check was
maakred as "[Message] - Test case .... did not check any assertions" and
is placed in /usr/include/boost/test/impl/results_collector instead of
the correct test file.

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-03-12 15:21:29 +02:00
Avi Kivity
7f8d88371a Add LICENSE, NOTICE, and copyright headers to all source files.
The two files imported from the OSv project retain their original licenses.
2015-02-19 16:52:34 +02:00
Tomasz Grabiec
661bb3d478 tests: Use test_runner to run boost tests 2015-01-29 10:30:14 +02:00
Gleb Natapov
7a92efe8d1 core: add local engine accessor function
Do not use thread local engine variable directly, but use accessor
instead.
2015-01-27 14:46:49 +02:00
Tomasz Grabiec
11a501d884 tests: fix assertion failure at test program exit
Seastar's allocator has an assertion which checks that the memory
block is freed on the same CPU on which it was allocated. This is
reasonable because all allocations in seastar need to be CPU-local.

The problem is that boost libraries (program_options,
unit_testing_framework) make heavy use of lazily-allocated static
variables, for instance:

    const variable_value&
    variables_map::get(const std::string& name) const
    {
        static variable_value empty;
        // ...
    }

Such variable will be allocated in in the current threads but freed in
the main thread when exit handlers are executed.

This results in:

output_stream_test: core/memory.cc:415: void memory::cpu_pages::free(void*):
Assertion `((reinterpret_cast<uintptr_t>(ptr) >> cpu_id_shift) & 0xff) == cpu_id' failed.

This change works around the problem by forcing initialization in the
main thread.

See issue #10.
2014-12-04 13:37:02 +01:00
Avi Kivity
6b5973af70 app-template: don't alias boost::program_options as bpo in a header file
We only have one global namespace, let's work together to keep it free
of pollution.
2014-12-01 17:56:34 +02:00
Tomasz Grabiec
9c9f3d21bf tests: make option defaults be effective in tests 2014-11-20 10:40:03 +02:00
Tomasz Grabiec
825b3608a4 tests: configure reactor for tests
Commit 405f3ea8c3 changed reactor so
that _network_stack is no longer default initialized to POSIX but to
nullptr. This caused tests to segfault, becayse they are not using
application template which takes care of configuration.

The fix is to call configure() so that netwrok stack will be set to
POSIX.
2014-11-15 11:58:07 -08:00
Tomasz Grabiec
5f3352b7e3 tests: integrate with BOOST UTF
Asynchronous test cases can be delared using SEASTAR_TEST_CASE macro,
which is equivalent to BOOST_AUTO_TEST_CASE, but the function body is
run inside a reactor and can returns a future<> which resolves when
the test is done.
2014-10-15 15:50:28 +02:00
Tomasz Grabiec
9a0ab2f1a4 tests: introduce some basic utilities used by tests 2014-10-01 13:21:09 +02:00