tester: Add framework for serialized test execution
RFC PATCH v2 1/1 tester: Add framework for serialized test execution
This adds a framework for running series of noninteractive tests that are capable of executing more complex scenarios than a usual unit test.
The framework enables staging of a test case processing:
- test pre-setup: can be used to prepare an initial testing environment potentially common to between several test cases, e.g., put an emulator in a certain well known state.
- test setup: used to setup conditions specific for the test case
- test run: execute actual test case
- test teardown: Cleans up after test setup
- test post-teardown: Cleans up after test pre-setup
Additional command line options allow to run a selected group of tests based either on a group prefix of the test name or a substring in test description.
--- Makefile.am | 6 +- ell/ell.h | 1 + ell/ell.sym | 21 ++ ell/tester.c | 780 +++++++++++++++++++++++++++++++++++++++++++++++++++ ell/tester.h | 97 +++++++ 5 files changed, 903 insertions(+), 2 deletions(-) create mode 100644 ell/tester.c create mode 100644 ell/tester.h
Makefile.am +4 -2
@@ -58,7 +58,8 @@ pkginclude_HEADERS = ell/ell.h \ ell/gpio.h \ ell/path.h \ ell/icmp6.h \ - ell/acd.h + ell/acd.h \ + ell/tester.h lib_LTLIBRARIES = ell/libell.la
@@ -141,7 +142,8 @@ ell_libell_la_SOURCES = $(linux_headers) \ ell/path.c \ ell/icmp6.c \ ell/icmp6-private.h \ - ell/acd.c + ell/acd.c \ + ell/tester.c ell_libell_la_LDFLAGS = -Wl,--no-undefined \ -Wl,--version-script=$(top_srcdir)/ell/ell.sym \
ell/ell.h +1 -0
@@ -64,3 +64,4 @@#include <ell/gpio.h> #include <ell/path.h> #include <ell/acd.h> +#include <ell/tester.h>
ell/ell.sym +21 -0
@@ -665,6 +665,27 @@ global: l_acd_set_debug; l_acd_set_skip_probes; l_acd_set_defend_policy; + /* tester */ + l_tester_new; + l_tester_destroy; + l_tester_start; + l_tester_summarize; + l_tester_test_add; + l_tester_test_add_full; + l_tester_test_get_stage; + l_tester_get_data; + l_tester_pre_setup_complete; + l_tester_pre_setup_failed; + l_tester_setup_complete; + l_tester_setup_failed; + l_tester_test_passed; + l_tester_test_failed; + l_tester_test_abort; + l_tester_teardown_complete; + l_tester_teardown_failed; + l_tester_post_teardown_complete; + l_tester_post_teardown_failed; + l_tester_wait; local: *; };
ell/tester.c new file +780 -0
780 lines not on this page · raw message
ell/tester.h new file +97 -0
97 lines not on this page · raw message
Signature · 1 line
2.26.2
Hi Inga,
Quoted 23 lines · Inga Stotland
This adds a framework for running series of noninteractive tests that are capable of executing more complex scenarios than a usual unit test.
The framework enables staging of a test case processing:
- test pre-setup: can be used to prepare an initial testing environment potentially common to between several test cases, e.g., put an emulator in a certain well known state.
- test setup: used to setup conditions specific for the test case
- test run: execute actual test case
- test teardown: Cleans up after test setup
- test post-teardown: Cleans up after test pre-setupAdditional command line options allow to run a selected group of tests based either on a group prefix of the test name or a substring in test description.
--- Makefile.am | 6 +- ell/ell.h | 1 + ell/ell.sym | 21 ++ ell/tester.c | 780 +++++++++++++++++++++++++++++++++++++++++++++++++++ ell/tester.h | 97 +++++++ 5 files changed, 903 insertions(+), 2 deletions(-)
Quoted 3 lines
create mode 100644
ell/tester.c
create mode 100644ell/tester.h
I went ahead and applied this with a minor tweak to the includes (adding #include "useful.h") due to recent internal includes reorg.
Regards,
-Denis