|
|
| Line 109: |
Line 109: |
| development branch :) | | development branch :) |
|
| |
|
| === Structure of a CPPUnit test ===
| | For a step by step description of how to add new tests |
| | see: [[Software Testing/Adding CPPUnit Tests]] |
|
| |
|
| ==== Definitions ====
| | For a detailed explanation of everything in the flightgear/test_suite folder, top to bottom level, |
| | | see: [[Software Testing/Flightgear Test Suite Details]] |
| =====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 Test 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 folder====
| |
| | |
| '''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:
| |
| | |
| # flightgear/test_suite Folder.
| |
| # Test-category folders ex: unit_tests, system_tests, simgear_tests
| |
| # 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
| |
| | |
| # '''test_suite/CMakeLists.txt''' & test_suite/testSuite.cxx
| |
| # '''test_suite/[test-category]/CMakeLists.txt'''
| |
| # '''test_suite/[test-category]/[app-component]/CMakeLists.txt''' and '''Test_suite.cxx'''
| |
| | |
| | |
| | |
| More to follow {{WIP}}
| |
|
| |
|
| ===Headless testing=== | | ===Headless testing=== |