Software Testing/Flightgear Test Suite Details

From FlightGear wiki
Jump to navigation Jump to search

Definitions

Test Case

A single assertion about one or two variable values that is testable.

Test Fixture

In CppUnit, a group of tests is called a TestFixture. A TestFixture provides a common environment for multiple test cases.

App Component

Major parts of the application, usually corresponding to folders in flightgear/src or simgear/simgear

Test Category

The type of testing: unit, system and simgear (library) tests

Test Suite

All the tests and everything needed to support them

Top Level flightgear/test_suite folder

Take a look at the flightgear/test_suite folder in a file browser preferably one that allows you to see the folders on multiple levels such as a code editor like VsCode. Start in the top level of flightgear's repo sources look for a directory named test_suite. Note that test_suite is not part of flightgear/src.

flightgear/test_suite contains two kinds of testing resources.

  • Programs and data used in tests
  • Groups of CPPUnit tests

Programs and data used in test modules

  • individual files directly under test_suite
  • test_data folder
  • FGTestApi folder
  • Groups of CPPUnit tests

Test Categories

  • fgdata_tests - placeholder
  • gui_tests - placeholder
  • simgear_tests
  • system_tests
  • unit_tests

Each of the last three test_suite/*_tests folders contain sub-folders covering some part of Flightgear's code. They may roughly correspond to the folders under flightgear/src, but that is not a requirement. Some areas may be covered in more than one *_tests folder. FDM for example in unit_tests and system_tests.

Folder Levels

Note at this point that the maximum Folder depth is 3:

  1. flightgear/test_suite Folder.
  2. Test-category folders ex: unit_tests, system_tests, simgear_tests
  3. App Component folders ex: FDM, Network, canvas. These roughly correspond to specific flightgear/src folders,

Expand the unit_tests test category folder Expand the Network app component folder

CPPUNIT test fixtures are implemented in test_*.cxx and test_*.hhx files int the Component category folders.

CMakeLists.txt, testSuite.cxx and TestSuite.cxx files

CMakeLists.txt files exist at every level TestSuite.cxx files are in each application component folders (bottom level) testSuite.cxx is only at the top level

  1. test_suite/CMakeLists.txt & test_suite/testSuite.cxx
  2. test_suite/[test-category]/CMakeLists.txt
  3. test_suite/[test-category]/[app-component]/CMakeLists.txt and Test_suite.cxx


More to follow

WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.