1
0
Fork 0
Commit graph

8 commits

Author SHA1 Message Date
Edward d'Auvergne
112d64f828 TestSuite: Helper functions for setting up a dummy renderer and FGScenery. 2018-06-07 11:17:04 +02:00
Edward d'Auvergne
a22c53a807 TestSuite: Temporary fix for CTests yet to be ported into the CppUnit framework. 2018-06-05 14:33:01 +02:00
Edward d'Auvergne
9583e2d7ad TestSuite: Addition of a test data store singleton.
This is for currently for storing the path to FGData for use in any tests
requiring it.
2018-04-13 10:17:30 +02:00
Edward d'Auvergne
28a77ed1d9 TestSuite: Only include Qt components if FG_TESTLIB is not set.
This is a fix for abc4cdb4c0 that allows fgfs to
build, without having to expand the fgtestlib to include Qt GUI sources.
2018-03-29 17:19:13 +02:00
Florent Rougon
abc4cdb4c0 TestSuite: call flightgear::shutdownQtApp() from fgtest::shutdownTestGlobals()
Some of the unit tests defined with the new test infrastructure[1]
initialize the QApplication; for these tests, it is necessary to ensure
that the QApplication instance is destroyed before exit() begins,
otherwise we get a segfault when run_test_suite terminates (see [2]).

In order to prevent this segfault from happening, call
flightgear::shutdownQtApp() unconditionally from
fgtest::shutdownTestGlobals() as long as Qt support is compiled in
(flightgear::shutdownQtApp() is safe to call even if the QApplication
hasn't been initialized).

[1] Currently, the three PosInitTests::* tests.
[2] https://bugreports.qt.io/browse/QTBUG-48709
2018-03-29 00:39:38 +02:00
Edward d'Auvergne
32d74493c4 TestSuite: The fatal exit() call has been removed from the globals setup.
The exceptions that occur after this call can be handled by CppUnit, but the
exit() results in the test suite silently exiting without restoring stdout and
stderr.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
2786b6b678 TestSuite: Better memory management for globals by using std::unique_ptr. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
0f96032487 TestSuite: Shift of the globals unit test helper functions into the test suite.
The setting of the SG log levels and developer mode has been removed as this
clashes with the output control set by the test suite main() function.
2018-03-23 17:26:05 +01:00