1
0
Fork 0
Commit graph

280 commits

Author SHA1 Message Date
Julian Smith
f62e5b9ce3 CompositeViewer: Support for multiple view windows using osgViewer::CompositeViewer.
Overview:

    Previously Flightgear always used a single osgViewer::Viewer(), which
    inherits from both osgViewer::ViewerBase and osgViewer::View, giving a
    single view window.

    If CompositeViewer is enabled, we instead use a osgViewer::CompositeViewer
    which contains a list of osgViewer::View's. Each of these View's can have
    its own eye position, so we can have multiple different views of the same
    scene.

    Enable at runtime with: --composite-viewer=1

Changes to allow use of osgViewer::CompositeViewer:

    Previously FGRenderer had this method:

        osgViewer::Viewer* getViewer();

    This has been replaced by these two new methods:

        osgViewer::ViewerBase* getViewerBase();
        osgViewer::View* getView();

    If CompositeViewer is not enabled (the default), the actual runtime state
    is unchanged, and getViewerBase() and getView() both return a pointer to
    the singleton osgViewer::Viewer() object.

    If CompositeViewer is enabled, getViewerBase() returns a pointer to a
    singleton osgViewer::CompositeViewer object, and getView() returns a
    pointer to the first osgViewer::View in the osgViewer::CompositeViewer's
    list.

    The other significant change to FGRenderer() is the new method:

        osg::FrameStamp* getFrameStamp()

    If CompositeViewer is not enabled, this simply returns
    getView()->getFrameStamp(). If CompositeViewer is enabled it returns
    getViewerBase()->getFrameStamp(). It is important that code that previously
    called getView()->getFrameStamp() is changed to use the new method, because
    when CompositeViewer is enabled individual osgViewer::View's appear to
    return an osg::FrameStamp with zero frame number).

    All code that uses FGRenderer has been patched up to use the new methods so
    that things work as before regardless of whether CompositeViewer is enabled
    or not.

    We make FGRenderer::update() call SviewUpdate() which updates any extra
    views.

Extra view windows:

    If CompositeViewer is enabled, one can create top-level extra view windows
    by calling SviewCreate(). See src/Viewer/sview.hxx for details.

    Each extra view window has its own simgear::compositor::Compositor
    instance.

    Currently SviewCreate() can create extra view windows that clone the
    current view, or view from one point to another (e.g. from one multiplayer
    aircraft to the user's aircradt) or keep two aircraft in view, one at a
    fixed distance in the foreground.

    SviewCreate() can be called from nasal via new nasal commands "view-clone",
    "view-last-pair", "view-last-pair-double" and "view-push". Associated
    changes to fgdata gives access to these via the View menu. The "view-push"
    command tags the current view for later use by "view-last-pair" and
    "view-last-pair-double".

    Extra view windows created by SviewCreate() use a new view system called
    Sview, which allows views to be constructed at runtime instead of being
    hard-coded in *-set.xml files. This is work in progress and views aren't
    all fully implemented. For example Pilot view gets things slightly wrong
    with large roll values, Tower View AGL is not implemented, and we don't
    implement damping. See top of src/Viewer/sview.cxx for an overview.

OpenSceneGraph-3.4 issues:

    OSG-3.4's event handling seems to be incorrect with CompositeViewer -
    events get sent for the wrong window which causes issues with resize and
    closing. It doesn't seem to be possible to work around this, so closing
    extra view windows can end up closing the main window for example.

    OSG-3.6 seems to fix the problems.

    We warn if CompositeViewer is enabled and OpenSceneGraph is 3.4.
2020-11-21 13:27:02 +00:00
James Turner
423c754009 Reposition: tolerate more scenarios in ATC_mgr
When starting at an airport, but not at parking or a runway, create
an empty AIFlightPlan, and ensure the AIManager code doesn’t choke on
empty FPs.

Add a unit-test which simulates the C172 tutorial reposition logic,
which is a little gnarly.
2020-10-27 18:32:18 +00:00
legoboyvdlp R
b00520ffdb Add test case for issue with routepath at Paro. Also add support for approaches to the TestDelegate. 2020-10-13 09:32:11 +01:00
James Turner
830a890eff Tests: skeleton ViewManager/Views tests 2020-09-08 12:31:42 +01:00
James Turner
5da15c3773 TestSuite: Fix include paths for logging 2020-09-08 11:37:13 +01:00
James Turner
e46c6f587b AIFlightPlan: remove ‘erase’ option from Decrement
Thankfully, the erase option to DecrementWaypoint was never used, so
remove it, since it’s … mental.
2020-09-05 11:16:36 +01:00
James Turner
02cfaeabba Tests: AIFlightPlan Increment/Decrement
Capture the current behaviour of Increment/DecrementWaypoint in
AI flightplans, prior to making some simplifications. Especially try
to test the behaviour of the ‘increment and erase’ logic.
2020-09-05 11:14:00 +01:00
James Turner
f5b5828bd0 AIFlightPlan: add test for XML parsing
This meant some slight refactoring to expose some easier APIs for
testing, but the normal methods should be unaffected.
2020-09-05 10:44:43 +01:00
James Turner
3a3ff07883 Start testing FGAIFlightPlan 2020-09-05 10:44:43 +01:00
James Turner
1f6b43c38f More AI tests 2020-09-03 17:51:40 +01:00
James Turner
d1fc4b58cb Start creating tests of AIModel code
First test just creates the manager, and ensures the user aircraft
updates in sync with the real aircraft.
2020-09-03 17:51:40 +01:00
James Turner
37d820120d Unit-testing: tests for Nasal SGCommand API
Test adding/removing/invoking commands, and error handles when
duplicate adding and removing a command name.
2020-08-26 17:20:58 +01:00
James Turner
5dbab6e90e CMake: overhaul how we find 3rd-party files
Handle the standard windows-3rd-party setup (used by fgmeta) with no
extra options, and also handle the slightly odd setup we use on Jenkins.
Try to tolerate all permutations of setting MSVC_3RDPARTY_ROOT to 
different places in the hierarchy.

We no longer try to guess Boost_INCLUDEDIR by looking at parent dirs of
MSVC_3RDPARTY_ROOT, since this seemed kind of bad to me. Let’s try 
it and see.
2020-08-26 13:57:24 +01:00
James Turner
178d1beb80 Cmake: Remove version.h machinery
Merge this file into config.h, this means we can save an include path
everywhere.
2020-08-24 15:04:24 +01:00
James Turner
fef50310bf Cmake: fix some issues Scott spotted. 2020-08-23 18:15:07 +01:00
James Turner
218df89b29 Embedded resources: better cmake command
Use add_custom_command and an intermediate OBJECT library to avoid
rerunning fgrcc unless the XML input file has actually changed.
2020-08-23 11:31:37 +01:00
James Turner
47ff3e9f67 Improve CMake strucutre 2020-08-23 11:31:37 +01:00
Edward d'Auvergne
04ee8c34a4 TestSuite: Execution of multiple tests or suites using comma separated lists.
This enables options such as '-u AeroElementTests,YASimAtmosphereTests'.  It
should help tracking down bugs whereby a test failure or error is triggered
solely due to a previous test.
2020-08-17 20:14:32 +02:00
James Turner
a297c89144 Flightplans: add clearAll, rename clear -> clearLegs
Improve naming of clear() methods, and expose the new ones to Nasal.
this will allow RouteManager dialog ‘clear’ button to clear all, soon.

See ticket:
https://sourceforge.net/p/flightgear/codetickets/2064/
2020-08-17 16:11:10 +01:00
James Turner
7eb52fa081 Add another timer test
Trying to trace down https://sourceforge.net/p/flightgear/codetickets/2257/
2020-08-07 11:39:07 +01:00
legoboyvdlp R
d6b7eaf60f Fix that tp_type will return nil for transitions 2020-07-30 12:26:04 +01:00
legoboyvdlp R
02c7b37122 Add test case for issue with last waypoint being a runway 2020-07-30 12:25:17 +01:00
legoboyvdlp R
668b499ff4 Correct restrictions above and below. Add test case. Fix contributed by Tobias Dammers 2020-07-30 12:25:02 +01:00
James Turner
1e403ae6dd Fix an assert running aero tests
FGLocale needs to be init-ed, before calling splash progress.
2020-07-22 11:49:14 +01:00
legoboyvdlp R
3255105190 Ensure that cruise parameters are set when cloning flightplan 2020-07-22 11:31:07 +01:00
James Turner
2f4b2153ef Fix test: find airways.
Fix handling of ‘both’ level option in several places, and amend
the test to make it explicit that we want Clacton VOR, not NDB.
2020-07-16 11:28:50 +01:00
James Turner
f0d3663102 Nasal unit-testing: allow deep struct equality.
Add a deep comparison of vecs and hashes, when deciding equality in
test assertions.
2020-07-08 15:22:27 +01:00
James Turner
c3fce7e436 Tests: load loadprioirty.xml
Otherwise we screw up Nasal load order.
2020-07-02 12:19:19 +01:00
legoboyvdlp R
cd5a0ffe0b Expose totalDistanceNm to Nasal flightplan ghost
Requested by Tobias Dammers, includes associated test. 
May be cherry-picked to 2020.2.
2020-06-30 13:30:35 +01:00
legoboyvdlp R
585c821bde Extend wp.hidden unit test to ensure path is empty after a hidden waypoint 2020-06-19 09:47:16 +01:00
legoboyvdlp R
f05c10e13a Add test for airway() nasal function 2020-06-18 09:22:03 +01:00
James Turner
9326c88f9b Move Qt root path variable to top-level CMakeList 2020-06-10 17:59:09 +01:00
legoboyvdlp R
b210f9e253 Add test for cloning flightplan with approach transitions 2020-06-10 17:18:23 +01:00
James Turner
2f1852ee83 Add test-case for timer restart
Test rescheduling of timer during activation. See:
https://sourceforge.net/p/flightgear/codetickets/2257/
2020-05-31 14:20:01 +01:00
James Turner
ea40f3d424 Adjust LBEL SID departure test work work 2020-05-31 12:16:59 +01:00
James Turner
03563a1601 Fix DME intercept handling in route/GPS
Both the route-path cade and the RNAV code were using some bad logic
to compute the intersection point. All fixed now, but requires a
new helper in Simgear.
2020-05-30 15:59:07 +01:00
James Turner
e51a0c55b5 Fly-by support for Radial intercepts
In the common case, avoid an overshoot when doing radial
intercepts.
2020-05-30 15:59:07 +01:00
James Turner
176ccfa8dc Test updates for new GPS fly-by 2020-05-30 15:59:07 +01:00
James Turner
eb55cd4a8c Test pilot changes for data logging 2020-05-30 15:59:07 +01:00
James Turner
5a73859b62 Add missing license 2020-05-30 15:59:07 +01:00
James Turner
e8bf4220a8 Add test-data logger 2020-05-30 15:58:59 +01:00
legoboyvdlp R
e76787fa62 Add test for Heathrow ILS 27L
To try and diagnose user problems intercepting glideslope at 4000 feet
+ 12 miles.
2020-05-29 16:42:41 +01:00
James Turner
58d7454976 Explicit support for approach transitions
Make the handling of approach transitions consistent with SID and STAR
transitions, including the Nasal API. Add some tests to cover the
new features.
2020-05-27 21:44:59 +01:00
James Turner
55ce199535 Fixes for cloning FPs with procedures 2020-05-27 16:09:18 +01:00
legoboyvdlp R
1a94f4858b Test for cloning plan with procedures 2020-05-25 09:42:52 +01:00
legoboyvdlp R
14c729027c Tests for cloning flightplan.
Two initial tests: basic flightplan and with fgfp-loaded flightplan
2020-05-25 09:42:44 +01:00
James Turner
54f660764e Tests: change how we find+load data files
Avoid encoding test-data as strings, since this exceeds MSVC limits
on string literals, and tests don’t need to be relocatable anyway,
so we can just hard-code the source location into config.h
2020-05-24 14:14:35 +01:00
James Turner
ce6bd859b3 Add Nasal source location to unit-tests 2020-05-22 17:35:24 +01:00
James Turner
d66edf42f5 Expose new index-of-interest FP methods to Nasal
Add some test checks for the Nasal API as well
2020-05-22 15:52:54 +01:00
James Turner
1eef7300be PosInit: fix a crash with invalid park-pos.
Add test-cases for this,
2020-05-21 23:19:39 +01:00
James Turner
fffcd14362 Fix FlightPlan procedure transition handling
Overhaul how transitions are stored in FlightPlan XML, and how
they’re exposed to Nasal. Simplify the Nasal access by making
‘sid_trans’ and ‘star_trans’ writeable.

Extend the unit-tests a lot to cover this, both from C++ and also
from Nasal

As part of this, overhaul the ownership of FlightPlan delegate
factories, to make it safer (use ref-counting of the factories,
and allow the factory to customise delegate clean-up behaviour)
2020-05-21 22:32:28 +01:00
James Turner
8af20fbcab Fix for loading of FGFP plans.
Where the plan does not contain departure / arrival WPs, fire the
corresponding delegate methods after load, to run the selection logic.

Also, add a ‘loaded’ delegate callback, to give delegates a chance to
perform validation and fix-up after all flight-plan loads.
2020-05-19 22:01:42 +01:00
James Turner
63fe5237c6 Improve interaction of —parkpos and repositioning
Re-work how position-init and ATC-manager work together to do
parking assignment and fallback (when the parking is unavailable).
Improve the logic for the reposition case, and teach ATC-manager about
reposition explicitly.

When the parking is unavailable, explicitly fall back to best-runway
selection in finalizePosition.

Add many additional position-init tests, to cover all of this.
2020-05-19 18:00:34 +01:00
legoboyvdlp R
d8b778a59e Add (failing) test for indexOfWP function with procedures 2020-05-18 09:35:16 +01:00
legoboyvdlp R
67d5757133 Add test case for LARPA2F procedure at Barcelona. Potential bug with (500) waypoint. Also, the test pilot decided to fly off on runway heading - my error, or his? 2020-05-14 11:49:03 +01:00
legoboyvdlp R
bdf969e802 Add test for STAR transitions (failing) 2020-05-14 11:32:49 +01:00
legoboyvdlp R
5747b51df3 Add test for fgfp procedures (failing) 2020-05-14 11:32:49 +01:00
legoboyvdlp R
f088734dea Add RNAV test for transitions (failing) 2020-05-14 11:32:49 +01:00
Stuart Buchanan
24c21bf876 Double posinit test
Testcase for running posinit twice.

posinit sets various properties which it then reads, so there's
a possibility that it could write a value which causes unexpected
behaviour when run later.

Unclear if this should be a unit test or a system test, but it's
simple enough to be a unit test.
2020-05-10 14:32:04 +01:00
James Turner
522c742419 Draft version of Nasal unit-testing API
Only the in-sim version works for now, the test-suite mode is not
implemented yet. Also the test API will evolve, but should stay close
to what CppUnit defines.

Run a test file by specifying a path to nasal-test : examples will be
added to FGData shortly.
2020-05-06 15:20:26 +01:00
James Turner
ee3958f971 Skeleton work on Nasal GC test
Incomplete, but the goal is to stess the Nasal GC system by creating
and destroying large number of objects continously.
2020-05-06 15:20:26 +01:00
James Turner
9d2e50fa56 Addon-config: don’t overwrite autosaved props
Fix for: https://sourceforge.net/p/flightgear/codetickets/2059/

When copying addon-config into the main property tree, skip props
which already exist and which are marked ARCHIVE, on the assumption
they came from autosave.xml.
2020-05-03 12:23:54 +01:00
James Turner
134685b527 Fix FP delegate when loading GPXs
When load a GPX route, run normal departure/arrival airport callbacks
on the delegates. (They are blocked for ‘native’ XML routes to avoid
losing SIDs and STARs)

https://sourceforge.net/p/flightgear/codetickets/2227/
2020-05-03 08:30:18 +01:00
Edward d'Auvergne
032f65e643 TestSuite: Documentation for the FG_ROOT environmental variable. 2020-05-02 14:18:43 +02:00
James Turner
6baa55b36b Waypoint hiding support (for the A320, etc)
To support FMS which delete ‘past’ waypoints, add some helpers:
 - waypoints can be flagged as hidden, this property is exposed to Nasal
 - currentWP() accepts an offset parameter, allowing FlightPlan indexing
   to treat the current WP as index 0
 - a ‘numRemainingWaypoints()’ function on flightPlan in Nasal, again
   to range how many waypoints are left, starting from the current WP

Add some basic tests of these new features to the route-manager tests.
2020-05-01 09:28:42 +01:00
Edward d'Auvergne
d7d6aebfa3 TestSuite: Fix for the running the CanvasTests as CTests.
These are in the simgear unit test category, not the normal unit test category.
2020-04-27 21:29:56 +02:00
Edward d'Auvergne
0f6524802b TestSuite: All tests can now be run via CTest again. 2020-04-24 23:04:48 +02:00
James Turner
b85048db2d GPS/FLightPlan test updates
- fix reseting of the NavData each test
- improve the test-pilot’s GPS following (reduce turn range close
   to the desired course)
- test DME intercepts
2020-04-21 15:48:41 +01:00
James Turner
b016c4b489 GPS/FP radial-intercept tests
By Jonathan Redpath, with some additions from me. Starting to exercise
both GPS and route-path for radial intercepts
2020-04-20 11:03:35 +01:00
James Turner
492c6daeca Bugfix for DISCON GPS test
Relocate before starting the GPS, to avoid confusion when we teleport
2020-04-19 17:04:46 +01:00
James Turner
17774dbe4c FlightPlan: DISCON works with pointAlongRoute
Add some tests for the default GPS / route-manager handling of
DISCON in flight-plans. Especially check behaviour when sequencing
a DISCON, and resuming with a Direct-to after one. 

This requires a corresponding FGData update to the default GPS Nasal.
2020-04-19 16:44:49 +01:00
James Turner
1a925b152d FlightPlan: don’t assert on invalid waypoints
When there is no first anchor waypoint (eg a runway or navaid), avoid
asserts from the RoutePath code.
2020-04-19 12:27:50 +01:00
James Turner
faee5dbabf Code changes for crash reporting with Sentry. 2020-04-17 17:55:34 +01:00
James Turner
79221a6225 Tests: HdgToAlt, with a nasty turn. 2020-04-16 16:56:58 +01:00
James Turner
444fbd7af4 Tests: add RNAV Heading-to-Alt basic test 2020-04-16 16:41:12 +01:00
James Turner
4c0965e3c1 Some initial tests for route discontinuities.
Probably many more to add, but this is some basic testing at least of
inserting, querying and removing discontinuities.
2020-04-15 16:11:33 +01:00
Stuart Buchanan
b561cc8fac Unit tests for initial position (Main/positioninit.cxx)
Various unit tests for
- airports
- runways
- vor
- ndb
- fix
- lat/lon
- carrier
- offsets from the above (except carriers)
2020-04-12 21:46:50 +01:00
James Turner
c12824bc94 Basic Canvas tests, including image pixel ops 2020-03-11 17:14:38 +00:00
James Turner
3f14d53286 FlightPlans: fix save/load of restrictions, deleting legs from Nasal
- 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.
2020-03-10 14:00:40 +00:00
legoboyvdlp R
b920a09fcf Correct whitespace in NasalPositioned.cxx; fix segfault in NasalPositioned by adding null check in the legGhostGetMember method; add test case for segfault 2020-01-27 16:27:46 +00:00
Edward d'Auvergne
1a7783c358 TestSuite: Reactivation of the ENABLE_AUTOTESTING CMake variable.
This was accidentally disabled by 22de9d30b5.
2020-01-09 12:38:45 +01:00
Scott Giese
a9365cd34e Embedded Resources: Fix for Ninja 1.9
Refactor to break circular references.
New custom target generates the resource files.
FGFS and Test_Suite targets declare a dependency to the generated files.
2019-12-26 01:26:44 -06:00
Edward d'Auvergne
85c889f13d TestSuite: FGData existence and version validation check prior to running tests.
This mimics the validation normally performed by Options::setupRoot().
2019-11-08 13:59:17 +01:00
Edward d'Auvergne
4fb149eeb2 TestSuite: Support for running more of the tests via CTest. 2019-11-07 10:13:55 +01:00
James Turner
45fbdaa9c9 Starting tests for RNAV/procedures
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.
2019-10-16 23:28:52 +01:00
James Turner
22de9d30b5 Make the test_suite happier under MSBuild/VS
Use the  CMake target as the command to invoke, so various things
get set automatically, and set the MSVCIDE_RUN_PATH so DLLs
are found correctly.
2019-09-26 13:00:23 +01:00
Edward d'Auvergne
3e834ebb65 TestSuite: Improved output formatting on MS Windows.
For some reason, this OS needs a few more newlines output than other OSes.
2019-09-26 12:34:25 +02:00
Edward d'Auvergne
0bb968543b TestSuite: Renamed the run_test_suite binary to fgfs_test_suite.
This is on James' suggestion.  The 'fgfs_test_suite' or 'fgfs_test_suite.exe'
binary file name is significantly more obvious as to its purpose.
2019-09-25 14:59:11 +02:00
Edward d'Auvergne
3d13c16973 TestSuite: CMake fix for variables missing from the parent scope.
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.
2019-09-25 10:38:19 +02:00
James Turner
847275e65a Tweaks to test helper APIs
Incorporate some feedback from Edward.
2019-09-24 11:39:56 +01:00
James Turner
36f88f6f07 Rename test globals to testGlobals [.cxx|.hxx] 2019-09-24 11:39:34 +01:00
James Turner
18c19885c6 Improvements to Nasal hold API
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.
2019-09-24 11:29:05 +01:00
James Turner
fafc9e3e64 Fix windows build, hopefully. 2019-09-23 23:14:32 +01:00
James Turner
5ce8a942bf RNAV / GPS hold support
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.
2019-09-23 23:01:12 +01:00
Edward d'Auvergne
b9a4101f61 Merge branch 'test_suite/log_options/r4' into fg-next 2019-09-20 20:08:19 +02:00
Edward d'Auvergne
4f5b0c8291 TestSuite: Environmental variables support for controlling the test suite.
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.
2019-09-20 19:45:33 +02:00
Edward d'Auvergne
c5dd4d3715 TestSuite: Simplification of the command line option processing.
Most of the code has been shifted into separate functions.  This will allow for
its reuse when environmental variable support is added.
2019-09-20 19:45:28 +02:00
Edward d'Auvergne
f9f201b830 TestSuite: Renamed the 'verbose' command line option to 'timings'.
This is to better reflect what the option does.  The -v or --verbose options are
now called -t or --timings respectively.
2019-09-20 19:42:57 +02:00
Edward d'Auvergne
aee367e8c2 TestSuite: Addition of the --log-class option for selecting SG_LOG classes.
This option mimics the fgfs option of the same name but additionally supports
the "particles", "headless", "osg", "undefined", and "all" classes.
2019-09-20 19:41:51 +02:00
Edward d'Auvergne
b58a63543e TestSuite: Implementation of the --log-split command line option. 2019-09-20 19:37:29 +02:00
Edward d'Auvergne
8b777a74c9 TestSuite: Addition of the --log-level option for setting the logging priority.
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.
2019-09-20 19:36:48 +02:00
Edward d'Auvergne
d448b8ceb4 TestSuite: Command line option processing simplification by using std::string. 2019-09-20 19:36:22 +02:00
James Turner
45df8f51b2 Move GPS sequencing into Nasal (optionally)
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.
2019-09-20 13:05:57 +01:00
James Turner
833cc61293 GPS intercept tests 2019-09-20 09:50:55 +01:00
James Turner
19af6994fb GPS : Offset flight test 2019-09-19 17:27:13 +01:00
James Turner
05e99d3a3b More GPS sequencing tests
Also extended the test helpers in various ways.
2019-09-19 17:27:13 +01:00
James Turner
fdb2120b68 GPS: tests for long great-circle legs
Check that everything behaves as expected with legs spanning very
large distances.
2019-09-19 17:27:13 +01:00
James Turner
2434c037c8 Improve Leg mode course/track computation 2019-09-19 17:27:13 +01:00
James Turner
21e9f3d5e9 Disable KML logging in Route-manager test 2019-09-18 23:47:13 +01:00
James Turner
1c09704903 Fix tests until GPS course changes land 2019-09-18 23:42:39 +01:00
James Turner
a2e9374c54 GPS tests 2019-09-18 23:42:39 +01:00
James Turner
1c58de62ed Route-manager unit-tests
Also contains large extensions to the TestPilot helper
2019-09-18 23:42:39 +01:00
James Turner
604a23166b Working on Direct-to tests 2019-09-18 23:42:38 +01:00
James Turner
21a8e89a0a Basic flight-plan/leg tests for GPS 2019-09-18 23:42:38 +01:00
James Turner
e15d67e637 TestPilot helper in the test API
Use this in the GPS tests.
2019-09-18 23:40:36 +01:00
James Turner
24f4de4681 Initial GPS unit test coverage 2019-09-18 23:40:36 +01:00
Edward d'Auvergne
f6efeb3f34 Test Suite: Workaround for aberrant MS Windows CMake behaviour.
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.
2019-09-17 21:50:52 +02:00
Edward d'Auvergne
827dfbc2b1 TestSuite: Added a testing category for FGData. 2019-09-13 11:55:09 +02:00
Edward d'Auvergne
42459c05d1 TestSuite: Activation of a few unit tests not being run as CTests. 2019-07-30 15:54:25 +02:00
James Turner
8428cd2a44 Revert "CommRadio: fix tuning 25Khz and 75Khz channels"
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.
2019-07-01 06:29:05 +01:00
James Turner
9f8b6f50f9 Fix navRadio tests for revised power supply paths 2019-06-27 15:46:09 +01:00
James Turner
91cc83abb5 CommRadio: fix tuning 25Khz and 75Khz channels
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.
2019-06-27 15:45:53 +01:00
Edward d'Auvergne
128c3f0c03 TestSuite: Allow the test_suite target to build again.
Previously it could only be built if the ALL target was built first.
2019-06-14 15:04:17 +02:00
James Turner
64eaf6fe03 Fix for route-path when leg 0 is not a runway
Avoid doing turn-computation for the first waypoint, even if it’s not
a runway. Add a unit-test to cover this case.

Reported by Josh Davidson
2019-03-26 22:50:46 +01:00
James Turner
12eac24039 Tests: NavRadio GS tests
Also includes false GS lobe tests
2018-12-10 17:44:09 +00:00
James Turner
a9475bd0fa Basic nav-radio ILS testing
Complex cases still to be added, but this tests the basic reception.
2018-12-04 09:39:36 +01:00
James Turner
c7b28a1960 UNit-tests for the NavRadio
Still needs ILS and GS tests, but starting to be useful already.
2018-11-25 13:12:50 +00:00
James Turner
1cbcae9795 Bugfix: fix range/ident priority of loaded wpts
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/
2018-10-08 16:40:25 +01:00
James Turner
69dbfc0a27 Core airway and flight-plan enhancements
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.
2018-08-28 12:23:01 +01:00
James Turner
e3d032942e Move aircraft-performance code into a public API
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.
2018-08-26 14:39:42 +01:00
Edward d'Auvergne
401a0dd22d TestSuite: Silence some warnings. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
688f0b5ea0 TestSuite: Minor output formatting changes and disabling of the GUI tests.
The GUI tests are disabled as there are no such tests yet.
2018-07-26 15:52:07 +02:00
Edward d'Auvergne
ab36c9760d TestSuite: Command line option for disabling the summary printout. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
f8c2cb5284 TestSuite: Migration of the old Navaids tests to the CppUnit framework.
This test suffers from significant bit-rot (it is designed for operation prior
to the NavDataCache), so it is deactivated.
2018-07-26 15:52:07 +02:00
Edward d'Auvergne
02c3c6dc97 TestSuite: Migration of the old GPS tests to the CppUnit framework.
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.
2018-07-26 15:52:07 +02:00
Edward d'Auvergne
fff923d2f4 TestSuite: Migration of the HIDInput tests to the CppUnit framework.
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.
2018-07-26 15:52:07 +02:00
Edward d'Auvergne
8d0db45c51 TestSuite: Shifted the non-functional src/GUI/layout-test.cxx file to the attic. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
0ea357b04c TestSuite: Improved memory management for the event manager.
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.
2018-07-26 15:52:07 +02:00
Edward d'Auvergne
dbe7c90115 TestSuite: Shifted the YASim atmosphere test into the CppUnit framework. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
ba5b472705 TestSuite: Elimination of the now unused ENABLE_TESTS CMake variable. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
feb854946e TestSuite: Complete removal of FG_TESTLIB. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
77b1ec5928 TestSuite: Move of all ancient non-functional tests into test_suite/attic/. 2018-07-26 15:52:06 +02:00
Edward d'Auvergne
2aa8d8ccbf TestSuite: Activation of the runtime headless mode whenever globals are set up. 2018-07-26 15:52:06 +02:00
Edward d'Auvergne
99a50508a7 TestSuite: Spun out the NavDataCache initialisation code.
Not all tests will require the NavDataCache, so it is no longer set up with the
dummy globals data structure.
2018-07-26 15:52:06 +02:00
Edward d'Auvergne
b0c5a5481d TestSuite: Migration of the autosaveMigration tests into the CppUnit infrastructure. 2018-07-26 15:52:06 +02:00
Edward d'Auvergne
63d751c15e TestSuite: Always capture OSG logging.
The NotifyLogger class from src/Viewer/fg_os_osgviewer.cxx has been shifted into
a simgear header file so that it can be reused within the test suite.
2018-07-26 15:52:06 +02:00
Edward d'Auvergne
acb3307a1a TestSuite: Migration of the AeroMesh tests into the CppUnit infrastructure. 2018-07-26 15:52:06 +02:00
Edward d'Auvergne
7aa034bc80 TestSuite: Migration of the AeroElement tests into the CppUnit infrastructure. 2018-07-26 15:52:06 +02:00
Edward d'Auvergne
88179ec9c1 TestSuite: Implementation of FGTestApi.
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.
2018-07-26 15:52:06 +02:00
Edward d'Auvergne
112d64f828 TestSuite: Helper functions for setting up a dummy renderer and FGScenery. 2018-06-07 11:17:04 +02:00