2017-03-21 20:43:42 +00:00
|
|
|
|
|
|
|
set(sources
|
|
|
|
Main/options.cxx
|
|
|
|
Main/fg_commands.cxx
|
|
|
|
Main/fg_props.cxx
|
|
|
|
Main/globals.cxx
|
|
|
|
Main/locale.cxx
|
|
|
|
Main/util.cxx
|
2017-03-27 14:37:54 +00:00
|
|
|
Main/positioninit.cxx
|
2017-03-21 20:43:42 +00:00
|
|
|
Aircraft/controls.cxx
|
|
|
|
Aircraft/FlightHistory.cxx
|
|
|
|
Aircraft/flightrecorder.cxx
|
|
|
|
Aircraft/replay.cxx
|
|
|
|
Autopilot/route_mgr.cxx
|
|
|
|
Airports/airport.cxx
|
|
|
|
Airports/airport.hxx
|
|
|
|
Airports/apt_loader.cxx
|
|
|
|
Airports/airportdynamicsmanager.cxx
|
|
|
|
Airports/airportdynamicsmanager.hxx
|
|
|
|
Airports/dynamicloader.cxx
|
|
|
|
Airports/dynamics.cxx
|
|
|
|
Airports/xmlloader.cxx
|
|
|
|
Airports/runwaybase.cxx
|
|
|
|
Airports/pavement.cxx
|
|
|
|
Airports/parking.cxx
|
|
|
|
Airports/groundnetwork.cxx
|
|
|
|
Airports/gnnode.cxx
|
|
|
|
Airports/runways.cxx
|
|
|
|
Airports/runwayprefs.cxx
|
|
|
|
Airports/runwayprefloader.cxx
|
|
|
|
ATC/CommStation.cxx
|
|
|
|
# ATC/GroundController.cxx
|
|
|
|
# ATC/atc_mgr.cxx
|
|
|
|
Environment/atmosphere.cxx
|
|
|
|
Environment/environment.cxx
|
|
|
|
Environment/environment_mgr.cxx
|
|
|
|
Environment/environment_ctrl.cxx
|
|
|
|
Environment/presets.cxx
|
|
|
|
Environment/gravity.cxx
|
|
|
|
Environment/ridge_lift.cxx
|
|
|
|
Environment/magvarmanager.cxx
|
|
|
|
Navaids/airways.cxx
|
|
|
|
Navaids/fixlist.cxx
|
|
|
|
Navaids/markerbeacon.cxx
|
|
|
|
Navaids/NavDataCache.cxx
|
|
|
|
Navaids/navdb.cxx
|
|
|
|
Navaids/navlist.cxx
|
|
|
|
Navaids/navrecord.cxx
|
|
|
|
Navaids/poidb.cxx
|
|
|
|
Navaids/procedure.cxx
|
|
|
|
Navaids/positioned.cxx
|
|
|
|
Navaids/PositionedOctree.cxx
|
|
|
|
Navaids/routePath.cxx
|
|
|
|
Navaids/route.cxx
|
|
|
|
Navaids/waypoint.cxx
|
|
|
|
Navaids/FlightPlan.cxx
|
|
|
|
Navaids/LevelDXML.cxx
|
|
|
|
Network/HTTPClient.cxx
|
|
|
|
Time/TimeManager.cxx
|
|
|
|
Time/bodysolver.cxx
|
|
|
|
Scripting/NasalSys.cxx
|
|
|
|
Scripting/NasalCondition.cxx
|
|
|
|
Scripting/NasalAircraft.cxx
|
|
|
|
Scripting/NasalString.cxx
|
|
|
|
Scripting/NasalPositioned.cxx
|
|
|
|
Scripting/NasalPositioned_cppbind.cxx
|
|
|
|
Scripting/nasal-props.cxx
|
|
|
|
Scripting/NasalSGPath.cxx
|
|
|
|
Scripting/NasalHTTP.cxx
|
|
|
|
Viewer/view.cxx
|
|
|
|
Viewer/viewmgr.cxx
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach(s ${sources})
|
|
|
|
set_property(DIRECTORY APPEND PROPERTY fgtestlib_sources "${CMAKE_SOURCE_DIR}/src/${s}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
set_property(DIRECTORY APPEND PROPERTY fgtestlib_sources "${CMAKE_SOURCE_DIR}/3rdparty/cjson/cJSON.c")
|
|
|
|
|
|
|
|
get_property(fgtestlib_sources DIRECTORY PROPERTY fgtestlib_sources)
|
|
|
|
|
|
|
|
add_library(fgtestlib SHARED ${fgtestlib_sources}
|
|
|
|
unitTestHelpers.cxx
|
|
|
|
testStubs.cxx
|
|
|
|
fake_sgSky.cxx
|
|
|
|
fake_sgPrecipitation.cxx
|
|
|
|
fake_sound.cxx)
|
|
|
|
|
|
|
|
set_target_properties (fgtestlib
|
|
|
|
PROPERTIES
|
|
|
|
COMPILE_DEFINITIONS "FG_TESTLIB"
|
|
|
|
)
|
|
|
|
|
2017-03-26 10:10:15 +00:00
|
|
|
if(FG_HAVE_GPERFTOOLS)
|
2017-03-27 14:37:54 +00:00
|
|
|
target_include_directories(fgtestlib PRIVATE ${GooglePerfTools_INCLUDE_DIR})
|
2017-03-26 10:10:15 +00:00
|
|
|
target_link_libraries(fgtestlib ${GooglePerfTools_LIBRARIES})
|
|
|
|
endif()
|
2017-03-26 11:15:29 +00:00
|
|
|
target_link_libraries(fgtestlib SimGearCore ${PLATFORM_LIBS} ${SQLITE3_LIBRARY})
|
2017-03-21 20:43:42 +00:00
|
|
|
|
|
|
|
add_executable(fgtest fgTestDriver.cxx)
|
|
|
|
target_link_libraries(fgtest fgtestlib)
|
|
|
|
|
2017-03-26 11:15:29 +00:00
|
|
|
macro(flightgear_test name sources)
|
|
|
|
add_executable(${name} ${sources})
|
2017-03-27 14:37:54 +00:00
|
|
|
target_include_directories(${name} PRIVATE ${CMAKE_SOURCE_DIR}/tests)
|
2017-03-26 11:15:29 +00:00
|
|
|
target_link_libraries(${name} fgtestlib)
|
|
|
|
add_test(${name} ${EXECUTABLE_OUTPUT_PATH}/${name})
|
|
|
|
endmacro()
|
2017-03-21 20:43:42 +00:00
|
|
|
|
2017-03-26 11:15:29 +00:00
|
|
|
flightgear_test(test_navs test_navaids2.cxx)
|
|
|
|
flightgear_test(test_flightplan test_flightplan.cxx)
|