1
0
Fork 0
Commit graph

13664 commits

Author SHA1 Message Date
James Turner
2c48914630 One more ATC text formatting fix
As requested by Wkitty on the mailing list.
2018-04-09 09:33:28 +01:00
James Turner
4878b28a22 Fix MSVC build 2018-04-09 01:29:01 +01:00
James Turner
205fadbff3 Stubbing out Add-ons controller
Also CatalogListModel stubs
2018-04-08 23:52:27 +01:00
Edward d'Auvergne
3b79530b06 CMake: Split the target links and includes into separate CMake modules. 2018-04-05 21:06:02 +02:00
Edward d'Auvergne
6a730b5820 CMake: The main sources/headers have been shifted into FG_{SOURCES,HEADERS}.
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.
2018-04-05 21:06:02 +02:00
Edward d'Auvergne
e88017eba3 CMake: Shifted the Mac bundle commands into its own CMake module. 2018-04-05 21:06:02 +02:00
Edward d'Auvergne
08386db6ff TestSuite: Comment rewording as the CMake file is no longer a copy from Main. 2018-04-05 21:06:02 +02:00
Edward d'Auvergne
93c4aab885 CMake: Shifted the MSVC grouping code into its own CMake module.
This is for simplifying the main src/Main/CMakeLists.txt file and allowing the
code to be shared with the test suite.
2018-04-05 21:05:54 +02:00
Edward d'Auvergne
f8e57f921d CMake: Shifted the FlightGear embedded resources code into its own CMake module.
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.
2018-04-05 21:05:30 +02:00
Edward d'Auvergne
bd3a3db50b CMake: Shifted the target setup code into its own CMake module.
This is for simplifying the main src/Main/CMakeLists.txt file and allowing the
code to be shared with the test suite.
2018-04-05 21:05:16 +02:00
James Turner
227dda4df5 ATC spacing improvements by WKitty 2018-04-05 13:07:44 +01:00
James Turner
9000185b92 Improve AI parking-pushback warning message
Specify the airport when a parking has no associated pushback route.
Improvement from WKitty42
2018-04-05 12:58:58 +01: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
11f591261e FGNasalSys::setTimer: Timer names now identify the file and line number.
This identifies the function for the callback and allows for better debugging of
the sim and real time SGTimerQueues in the event manager.
2018-03-23 20:07:49 +01: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
98debee29c TestSuite: Addition of the ENABLE_AUTOTESTING CMake option.
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.
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
Edward d'Auvergne
7616f1ec3e TestSuite: Migration of the posinit unit tests. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
85ad420be1 TestSuite: Migration of the Add-ons management unit tests. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
d51e21c667 TestSuite: Migration of the LaRCSim matrix computation unit tests. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
0030f655e0 TestSuite: Added a debugging command line option.
This is to enable full output from passing tests to help with debugging.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
f8e6295272 TestSuite: CTest support for running each test suite as a separate ctest.
The --ctest command line option has also been added to allow for a simplified
output from the test suite more suitable for the ctest verbose output.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
d63211409c TestSuite: Addition of command line options for fine control of the executable.
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.
"""
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
f539e03729 TestSuite: Added the Autotools auto-generated CppUnit config-auto.h file. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
e66db5ca3a TestSuite: Support for building the FlightGear bundled CppUnit library.
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.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
3c73600237 TestSuite: Addition of the SYSTEM_CPPUNIT option for distributors.
This is to allow for selecting between a system installed version of CppUnit or
the version bundled with flightgear.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
f4ee276472 TestSuite: Addition of a stripped down version of CppUnit 1.14.0.
This is the version maintained by the freedesktop.org organisation and is
documented at https://www.freedesktop.org/wiki/Software/cppunit/.  All
unnecessary files have been stripped out.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
73a9927c22 TestSuite: Migration of the Flightplan tests into the CppUnit infrastructure. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
f6b1ddfac6 TestSuite: Windows support for the run_test_suite custom cmake target.
A custom add_custom_target() function is required to allow the test suite to be
executed by cmake under MS Windows.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
c9122ff84b TestSuite: Converted the old tests/test-mktime.cxx program into a unit test.
This required many time related include files, functions, and variables to be
tested for via CMake, and converted to macros via #cmakedefine, so that they
would be automatically set for the test-mktime.cxx file.
2018-03-23 17:26:04 +01:00
Edward d'Auvergne
708bf948b3 TestSuite: Converted the old tests/test-up.cxx program into a simgear unit test.
This old standalone test, from Curt back in 2001, was converted to the format
required for the CppUnit test suite.  As most of simgear/math/sg_geodesy.hxx no
longer exists, the code was updated using SGGeod and SGGeoc.  Hardcoded values
are used to permanently lock in the values currently calculated by simgear.
2018-03-23 17:26:04 +01:00
Edward d'Auvergne
3bd60e96c8 TestSuite: Capture and reporting of all simgear logstream priorities.
Each of the global logstream priorities are captured into its own
std::ostringstream stream, all held together in the test suite global _iostreams
class instance.  This object can be obtained by calling getIOstreams().  The
streams are captured using the StreamLogCallback class, which is a simple
modification of the simgear FileLogCallback class, registered with the global
logstream's addCallback() function.

When tests fail, all of contents the different simgear logstreams are now
reported.  The failure report consists of the following sections:

  - Failure information.
  - SG_BULK simgear logstream (all messages).
  - SG_BULK only simgear logstream.
  - SG_DEBUG only simgear logstream.
  - SG_INFO only simgear logstream.
  - SG_WARN only simgear logstream.
  - SG_ALERT only simgear logstream.
  - Combined STDOUT and STDERR streams.

Any empty sections, except for SG_BULK, will not be shown.
2018-03-23 17:26:04 +01:00
Edward d'Auvergne
e88b6543b0 TestSuite: Custom output formatting.
A large number of improvements have been made by subclassing the CppUnit classes
and overriding the base functions, including CompilerOutputter, TestListener,
and TextTestRunner.  All IO has also been captured by the test runner.

The result is that during the test suite run, only the characters '.', 'F', and
'E' are output for a pass, failure and error state.  At the end of each test
suite category, all failures and errors are reported in full detail, including
the different captured IO streams.  A final synopsis is printed out, improving
the overview in the case of too many tests failing.

For the fgCompilerOutputter class, the printSuccess(), printFailureReport(),
printFailureDetail(), and printSuiteStats() functions have been replaced to
implement the above printout design.  The class also stores the std::vector of
TestIOCapt structures for the final printouts.

The fgTestListener class handles the events from the running of the test suite.
The startTest() and endTest() functions are used for IO capture.  The IO is
placed into a TestIOCapt data structure, with one std::string for holding the
combined STDOUT and STDERR IO, and another for the SG_LOG IO.  If failures
occur, the TestIOCapt structure is appended to the fgCompilerOutputter vector.
The startTest() and endTest() functions are also used for starting and stopping
a timer to allow the full test suite to be timed.  And the addFailure() function
simply registers test failures or errors.

The fgTestRunner class overrides the CppUnit::TextTestRunner::run() function,
simply to prevent the base method from spawning a second test listener, causing
the test output to be duplicated.

Some auxiliary formatting functions have been added to print out titles,
sections, and synopsis summary lines.
2018-03-23 17:26:04 +01:00
Edward d'Auvergne
941c5dc8f2 Main: Formatting standardization for the src/Main/CMakeLists.txt file.
This includes spacing, tab to space replacements, and alphabetical ordering.
2018-03-23 17:26:04 +01:00
Edward d'Auvergne
8b438cb97e TestSuite: Initial support for a FlightGear test suite based on CppUnit.
This includes the basic CMake infrastructure for building and executing the test
suite.  Four test categories have been added - unit, system/functional, GUI, and
simgear unit tests.  The test suite is run by typing 'make test_suite'.

All of the fgfs sources are included in the new run_test_suite executable,
excluding the bootstrap routine and its main() function.  The test suite
currently consists of a single dummy unit test for the NasalSys subsystem, and a
single demonstration simgear/props unit test.
2018-03-23 17:26:04 +01:00
James Turner
01f840487d Split launcher code to fix ownership issues
This avoids passing a QmainWindow into the QML engines, which don’t
seem to handle that very well.
2018-03-22 13:52:03 +00:00
James Turner
f75f413970 Ensure launcher AW toggle overrides the sim setting
Set the property value to false explicitly when BW is requested in
the launcher, otherwise the auto-saved value takes over.
2018-03-22 11:59:15 +00:00
James Turner
28d8317242 Work-arounds for launcher crashes on ‘fly’
Two are enabled, one is disabled for people to test.
2018-03-22 09:32:30 +00:00
James Turner
1c78c65b19 Popup an error box when QtQuick errors occur. 2018-03-20 16:32:31 +00:00
James Turner
010bfc8378 Fix a compile error reported by Edward 2018-03-19 22:33:17 +00:00
James Turner
cb4a823836 Missed some files fixing QQ2 version import 2018-03-19 22:32:23 +00:00
James Turner
4c2e52c2dc Standardise QtQuick version to 2.4
Will fix an issue reported on the forum where a 2.7 dep crept it.
2018-03-19 08:22:11 +00:00
James Turner
e894cb5188 Fix case-sensitivity 2018-03-19 00:36:49 +00:00
James Turner
d3299a1f71 Remove references to deleted files 2018-03-18 22:09:01 +00:00
James Turner
024ffa5e9d Remove obsolete launcher files
Clean-up now widget-based settings are gone
2018-03-18 17:00:54 +00:00
James Turner
19ae26164a Summary page converted to QtQuick 2018-03-18 16:39:17 +00:00
James Turner
eaf89ab23b Avoid use of Connections.enabled for Qt < 5.7 compat 2018-03-18 16:25:48 +00:00
James Turner
7339e261e9 Direct file dialog (no need for QtQuick Controls)
This should simplify the needed packages on Debian, Ubuntu, etc
2018-03-18 16:18:17 +00:00