summaryrefslogtreecommitdiff
path: root/tests/libqtest.h
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>2018-06-13 17:07:21 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2019-03-07 17:28:24 +0100
commitfc281c802022cb3a73a53386d761daa32dce5cf9 (patch)
tree1a3ee082e892ccca06dc2528fe68940d2eadb863 /tests/libqtest.h
parenteb5937bad691ed18a401079a0604aa11fea0ecdd (diff)
downloadqemu-fc281c802022cb3a73a53386d761daa32dce5cf9.zip
tests: qgraph API for the qtest driver framework
Add qgraph API that allows to add/remove nodes and edges from the graph, implementation of Depth First Search to discover the paths and basic unit test to check correctness of the API. Included also a main executable that takes care of starting the framework, create the nodes, set the available drivers/machines, discover the path and run tests. graph.h provides the public API to manage the graph nodes/edges graph_extra.h provides a more private API used successively by the gtest integration part qos-test.c provides the main executable Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> [Paolo's changes compared to the Google Summer of Code submission: * added subprocess to test options * refactored object creation to support live migration tests * removed driver .before callback (unused) * removed test .after callbacks (replaced by GTest destruction queue)] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/libqtest.h')
-rw-r--r--tests/libqtest.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/libqtest.h b/tests/libqtest.h
index 5937f91912..1a2f87ef0b 100644
--- a/tests/libqtest.h
+++ b/tests/libqtest.h
@@ -598,6 +598,9 @@ static inline QTestState *qtest_start(const char *args)
*/
static inline void qtest_end(void)
{
+ if (!global_qtest) {
+ return;
+ }
qtest_quit(global_qtest);
global_qtest = NULL;
}