- Fix Leg ownership to avoid segfaults when deleting them via Nasal
- Modify FP save/load code so restrictions and holds are correctly
saved and restored
Extend the tests to cover these cases.
Refactor to break circular references.
New custom target generates the resource files.
FGFS and Test_Suite targets declare a dependency to the generated files.
One test so far, attempting to reproduce a bug I see with the 737.
Note these tests are skipped unless you have procedures available
and set a magic env var to find them.
The test suite CMake target variables have been shifted back into
test_suite/CMakeLists.txt. These are now correctly constructed and placed into
the parent scope where the test_suite target now resides.
Ensure changes from Nasal are picked up by delegates (such as GPS) when
they are made. Add a route-manager test which sets and exits a hold
using Nasal.
As part of this, update the test API to make it easy to run Nasal from
a test.
The GPS/RNAV system can now fly holds, both left and right-handed.
The correct entry is selected, and hold count can be selected.
Also there's lots of lovely test cases.
This includes the addition of FG_TEST_LOG_LEVEL, FG_TEST_LOG_CLASS,
FG_TEST_LOG_SPLIT, FG_TEST_TIMINGS, and FG_TEST_DEBUG. These match the command
line option naming.
This option mimics the fgfs option of the same name. However for the test suite
option, additionally the SG_POPUP, SG_DEV_WARN and SG_DEV_ALERT priorities are
supported.
The default test suite output has been modified to only show the interleaved log
with the logging priority set to the command line supplied value or defaulting
to SG_INFO.
GPS now lets the delegate handle the sequencing behaviour, by
setting a new config property. The default GPS delegate (in Nasal)
now sets this property.
This requires a corresponding FGData update.
The add_custom_target() CMake function for the test_suite target has been
shifted from test_suite/CMakeLists.txt to the top level CMakeLists.txt file.
The variable setting CMake code required for this has also been shifted. This
allows for the same build command 'cmake --build . --target test_suite' to work
on all operating systems.
Revert this change - I will re-add the unit-tests again, but we need
a different approach for 8.3 stations, than what I did here.
This reverts commit 91cc83abb5.
In 8.3 mode, ensure that 25 and 75Khz channels can be tuned using the
abbreviated syntax (eg 118.02 for 118.025).
As part of this, add test coverage of the CommRadio for basic and 8.3-
mode operation.
When the lat-lon of a waypoint disagrees with the discovered ident by
more than a threshold, assume we have a DB mismatch, and just revert
to a basic wpt specified by lat-lon. This avoids inserting huge
legs by selecting a very distant navaid with matching ident
https://sourceforge.net/p/flightgear/codetickets/1814/
Add better airway support, fix various issues with VIA, and add
parsing / generation of ICAO route strings. Also fix the
serialisation of flight-plans with airway enroute segments, so these
can be restored correctly.
Upcoming flight-planning changes want to use the perf computation code
in route-path, so move it to a public class, and implement some of the
missing functionality, especially correct GS computation for altitude.
As this code has significant bit-rot and requires a lot of work to compile and
run again, it is currently deactivated.
The test also writes to the files "/Users/jmt/Desktop/airways.kml" and
"/Users/jmt/Desktop/procedures.kml" and would need to be modified to write to a
temporary directory and the file contents reread and checked by the test.
The extractBits(), signExtend(), and writeBits() functions of the anonymous
namespace in Input/FGHIDEventInput.cxx have been shifted out of the namespace
and are now exposed via the header. This is needed as
<Input/FGHIDEventInput.cxx> cannot be imported within the CppUnit
infrastructure, as it is already built into the run_test_suite binary.
In the initTestGlobals() helper function, the event manager is added to the subsystem manager (both
created by the FGGlobals ctor). This allows the event manager to be destroyed via the subsystem
manager in the FGGlobals dtor.
The test_suite/helpers directory has been renamed to test_suite/FGTestApi/ and
all the fgtest namespaces renamed to FGTestApi. The helper functions are now
also placed into either a setUp or tearDown namespace depending on their
function. And a new FGTestApi::PrivateAccessor::FDM namespace has been created
for holding friend classes used to access private or protected variables or
functions from solely within the test suite.
This allows the sources and headers in src/Main/ to be used by other targets.
They are grouped into the new "Main" flightgear component via the macro in the
FlightGearComponent CMake module. The bootstrap.cxx file with its main function
has been separated out into a separate variable MAIN_SOURCE for use by the fgfs
binary.
All these files have therefore been removed from the test_suite CMakeLists.txt
file, as they are added via FG_SOURCES and FG_HEADERS. The MSVC grouping code
also does not need to deal with the now deleted separate SOURCE and HEADER
variables for these files.
This is for simplifying the main src/Main/CMakeLists.txt file and allowing the
code to be shared with the test suite.
The generated source and header files have also been removed from the main
source list and placed in the CMake module as the global variables
EMBEDDED_RESOURCE_SOURCES and EMBEDDED_RESOURCE_HEADERS.
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
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.
This allows for finer control of the test suite execution. The default of ON
will cause the test-suite to be executed after compiling the test_suite target.
This includes the following help message detailing all of the new options:
"""
Usage: run_test_suite [options]
Options:
-h, --help show this help message and exit.
Test selection options:
-s, --system-tests execute the system/functional tests.
-u, --unit-tests execute the unit tests.
-g, --gui-tests execute the GUI tests.
-m, --simgear-tests execute the simgear tests.
The -s, -u, -g, and -m options accept an optional argument to perform a
subset of all tests. This argument should either be the name of a test
suite or the full name of an individual test.
Full test names consist of the test suite name, the separator '::' and then
the individual test name. The test names can revealed with the verbose
option.
Verbosity options:
-v, --verbose verbose output including names and timings for all
tests.
"""
The CppUnit source is built as a static library and linked to the run_test_suite
executable. The FlightGear CppUnit library is now build using CMake rather than
using the Autotools build system.