diff --git a/Tudat/Astrodynamics/Aerodynamics/CMakeLists.txt b/Tudat/Astrodynamics/Aerodynamics/CMakeLists.txt index ffdd00821f..72b829ce0f 100644 --- a/Tudat/Astrodynamics/Aerodynamics/CMakeLists.txt +++ b/Tudat/Astrodynamics/Aerodynamics/CMakeLists.txt @@ -58,59 +58,86 @@ if(USE_NRLMSISE00) "${SRCROOT}${AERODYNAMICSDIR}/nrlmsise00InputFunctions.h") endif( ) -# Add static libraries. +# Add static libraries add_library(tudat_aerodynamics STATIC ${AERODYNAMICS_SOURCES} ${AERODYNAMICS_HEADERS}) setup_tudat_library_target(tudat_aerodynamics "${SRCROOT}{AERODYNAMICSDIR}") -# Add unit tests. -add_executable(test_AerodynamicMomentAndAerodynamicForce "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestAerodynamicMomentAndAerodynamicForce.cpp") -setup_custom_test_program(test_AerodynamicMomentAndAerodynamicForce "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_AerodynamicMomentAndAerodynamicForce ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_AerodynamicsNamespace "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestAerodynamicsNamespace.cpp") -setup_custom_test_program(test_AerodynamicsNamespace "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_AerodynamicsNamespace tudat_aerodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_AerodynamicCoefficientGenerator "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestCoefficientGenerator.cpp") -setup_custom_test_program(test_AerodynamicCoefficientGenerator "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_AerodynamicCoefficientGenerator tudat_aerodynamics tudat_geometric_shapes tudat_interpolators tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_ExponentialAtmosphere "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestExponentialAtmosphere.cpp") -setup_custom_test_program(test_ExponentialAtmosphere "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_ExponentialAtmosphere tudat_aerodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_CustomConstantTemperatureAtmosphere "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestCustomConstantTemperatureAtmosphere.cpp") -setup_custom_test_program(test_CustomConstantTemperatureAtmosphere "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_CustomConstantTemperatureAtmosphere tudat_aerodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_TabulatedAtmosphere "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestTabulatedAtmosphere.cpp") -setup_custom_test_program(test_TabulatedAtmosphere "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_TabulatedAtmosphere tudat_aerodynamics tudat_input_output tudat_interpolators - tudat_basic_mathematics tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_TabulatedAerodynamicCoefficients "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestTabulatedAerodynamicCoefficients.cpp") -setup_custom_test_program(test_TabulatedAerodynamicCoefficients "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_TabulatedAerodynamicCoefficients ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_HeatTransfer "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestHeatTransfer.cpp") -setup_custom_test_program(test_HeatTransfer "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_HeatTransfer tudat_aerodynamics tudat_root_finders tudat_basic_mathematics - tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_ControlSurfaceIncrements "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestControlSurfaceIncrements.cpp") -setup_custom_test_program(test_ControlSurfaceIncrements "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_ControlSurfaceIncrements ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_AerodynamicCoefficientsFromFile "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestAerodynamicCoefficientsFromFile.cpp") -setup_custom_test_program(test_AerodynamicCoefficientsFromFile "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_AerodynamicCoefficientsFromFile ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_WindModel "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestWindModel.cpp") -setup_custom_test_program(test_WindModel "${SRCROOT}${AERODYNAMICSDIR}") -target_link_libraries(test_WindModel ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) +# Add unit tests +set(AERO_TEST_DIR "${SRCROOT}${AERODYNAMICSDIR}/UnitTests") + +tudat_add_test( + TARGET test_AerodynamicMomentAndAerodynamicForce + SOURCES "${AERO_TEST_DIR}/unitTestAerodynamicMomentAndAerodynamicForce.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_AerodynamicsNamespace + SOURCES "${AERO_TEST_DIR}/unitTestAerodynamicsNamespace.cpp" + LINK_LIBRARIES tudat_aerodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_AerodynamicCoefficientGenerator + SOURCES "${AERO_TEST_DIR}/unitTestCoefficientGenerator.cpp" + LINK_LIBRARIES tudat_aerodynamics tudat_geometric_shapes tudat_interpolators tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_ExponentialAtmosphere + SOURCES "${AERO_TEST_DIR}/unitTestExponentialAtmosphere.cpp" + LINK_LIBRARIES tudat_aerodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_CustomConstantTemperatureAtmosphere + SOURCES "${AERO_TEST_DIR}/unitTestCustomConstantTemperatureAtmosphere.cpp" + LINK_LIBRARIES tudat_aerodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_TabulatedAtmosphere + SOURCES "${AERO_TEST_DIR}/unitTestTabulatedAtmosphere.cpp" + LINK_LIBRARIES tudat_aerodynamics + tudat_input_output + tudat_interpolators + tudat_basic_mathematics + tudat_basic_astrodynamics + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_TabulatedAerodynamicCoefficients + SOURCES "${AERO_TEST_DIR}/unitTestTabulatedAerodynamicCoefficients.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_HeatTransfer + SOURCES "${AERO_TEST_DIR}/unitTestHeatTransfer.cpp" + LINK_LIBRARIES tudat_aerodynamics + tudat_root_finders + tudat_basic_mathematics + tudat_basic_astrodynamics + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_ControlSurfaceIncrements + SOURCES "${AERO_TEST_DIR}/unitTestControlSurfaceIncrements.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_AerodynamicCoefficientsFromFile + SOURCES "${AERO_TEST_DIR}/unitTestAerodynamicCoefficientsFromFile.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_WindModel + SOURCES "${AERO_TEST_DIR}/unitTestWindModel.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) if(USE_NRLMSISE00) - add_executable(test_NRLMSISE00Atmosphere "${SRCROOT}${AERODYNAMICSDIR}/UnitTests/unitTestNRLMSISE00Atmosphere.cpp") - setup_custom_test_program(test_NRLMSISE00Atmosphere "${SRCROOT}${AERODYNAMICSDIR}") - target_link_libraries(test_NRLMSISE00Atmosphere tudat_aerodynamics tudat_interpolators tudat_basic_mathematics nrlmsise00 tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) + tudat_add_test( + TARGET test_NRLMSISE00Atmosphere + SOURCES "${AERO_TEST_DIR}/unitTestNRLMSISE00Atmosphere.cpp" + LINK_LIBRARIES tudat_aerodynamics + tudat_interpolators + tudat_basic_mathematics + nrlmsise00 + tudat_input_output + tudat_basic_astrodynamics + ${Boost_LIBRARIES}) endif( ) diff --git a/Tudat/Astrodynamics/BasicAstrodynamics/CMakeLists.txt b/Tudat/Astrodynamics/BasicAstrodynamics/CMakeLists.txt index 4428829822..77574e3bde 100755 --- a/Tudat/Astrodynamics/BasicAstrodynamics/CMakeLists.txt +++ b/Tudat/Astrodynamics/BasicAstrodynamics/CMakeLists.txt @@ -83,86 +83,123 @@ set(BASICASTRODYNAMICS_UNITTESTS "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestUnifiedStateModelExponentialMapElementConversions.cpp" ) -add_executable(test_AstrodynamicsFunctions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestAstrodynamicsFunctions.cpp") -setup_custom_test_program(test_AstrodynamicsFunctions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_AstrodynamicsFunctions tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_OrbitalElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestOrbitalElementConversions.cpp") -setup_custom_test_program(test_OrbitalElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_OrbitalElementConversions tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_PhysicalConstants "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestPhysicalConstants.cpp") -setup_custom_test_program(test_PhysicalConstants "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_PhysicalConstants tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_UnitConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestUnitConversions.cpp") -setup_custom_test_program(test_UnitConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_UnitConversions tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_MeanToEccentricAnomalyConversion "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestConvertMeanAnomalyToEccentricAnomaly.cpp") -setup_custom_test_program(test_MeanToEccentricAnomalyConversion "${SRCRthrustFunctionsOOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_MeanToEccentricAnomalyConversion tudat_basic_astrodynamics tudat_basic_mathematics tudat_root_finders ${Boost_LIBRARIES}) - -add_executable(test_MeanToHyperbolicEccentricAnomalyConversion "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestConvertMeanAnomalyToHyperbolicEccentricAnomaly.cpp") -setup_custom_test_program(test_MeanToHyperbolicEccentricAnomalyConversion "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_MeanToHyperbolicEccentricAnomalyConversion tudat_basic_astrodynamics tudat_basic_mathematics tudat_root_finders ${Boost_LIBRARIES}) - -add_executable(test_KeplerPropagator "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestKeplerPropagator.cpp") -setup_custom_test_program(test_KeplerPropagator "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_KeplerPropagator tudat_input_output tudat_gravitation tudat_basic_astrodynamics tudat_basic_mathematics tudat_root_finders ${Boost_LIBRARIES}) - -add_executable(test_AccelerationModel "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestAccelerationModel.cpp") -setup_custom_test_program(test_AccelerationModel "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_AccelerationModel tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_ClohessyWiltshirePropagator "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestClohessyWiltshirePropagator.cpp") -setup_custom_test_program(test_ClohessyWiltshirePropagator "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_ClohessyWiltshirePropagator tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_MissionGeometry "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestMissionGeometry.cpp") -setup_custom_test_program(test_MissionGeometry "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_MissionGeometry tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_TimeConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestTimeConversions.cpp") -setup_custom_test_program(test_TimeConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_TimeConversions tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_CelestialBodyConstants "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestCelestialBodyConstants.cpp") -setup_custom_test_program(test_CelestialBodyConstants "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_CelestialBodyConstants tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_ModifiedEquinoctialElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestModifiedEquinoctialElementConversions.cpp") -setup_custom_test_program(test_ModifiedEquinoctialElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_ModifiedEquinoctialElementConversions tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_GeodeticCoordinateConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestGeodeticCoordinateConversions.cpp") -setup_custom_test_program(test_GeodeticCoordinateConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_GeodeticCoordinateConversions tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_StateElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestStateConversions.cpp") -setup_custom_test_program(test_StateElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_StateElementConversions tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_SphericalOrbitalStateConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestSphericalOrbitStateConversions.cpp") -setup_custom_test_program(test_SphericalOrbitalStateConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_SphericalOrbitalStateConversions tudat_basic_astrodynamics tudat_reference_frames tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_BodyShapeModels "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestBodyShapeModels.cpp") -setup_custom_test_program(test_BodyShapeModels "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_BodyShapeModels tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_UnifiedStateModelQuaternionElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestUnifiedStateModelQuaternionElementConversions.cpp") -setup_custom_test_program(test_UnifiedStateModelQuaternionElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_UnifiedStateModelQuaternionElementConversions tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_UnifiedStateModelMRPElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestUnifiedStateModelMRPElementConversions.cpp") -setup_custom_test_program(test_UnifiedStateModelMRPElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_UnifiedStateModelMRPElementConversions tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_UnifiedStateModelEMElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestUnifiedStateModelEMElementConversions.cpp") -setup_custom_test_program(test_UnifiedStateModelEMElementConversions "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_UnifiedStateModelEMElementConversions tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_EmpiricalAccelerations "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests/unitTestEmpiricalAcceleration.cpp") -setup_custom_test_program(test_EmpiricalAccelerations "${SRCROOT}${BASICASTRODYNAMICSDIR}") -target_link_libraries(test_EmpiricalAccelerations ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) +set(BASIC_ASTRO_TEST_DIR "${SRCROOT}${BASICASTRODYNAMICSDIR}/UnitTests") + +tudat_add_test( + TARGET test_AstrodynamicsFunctions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestAstrodynamicsFunctions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_OrbitalElementConversions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestOrbitalElementConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_PhysicalConstants + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestPhysicalConstants.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_UnitConversions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestUnitConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_MeanToEccentricAnomalyConversion + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestConvertMeanAnomalyToEccentricAnomaly.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_root_finders + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_MeanToHyperbolicEccentricAnomalyConversion + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestConvertMeanAnomalyToHyperbolicEccentricAnomaly.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_root_finders + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_KeplerPropagator + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestKeplerPropagator.cpp" + LINK_LIBRARIES tudat_input_output + tudat_gravitation + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_root_finders + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_AccelerationModel + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestAccelerationModel.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_ClohessyWiltshirePropagator + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestClohessyWiltshirePropagator.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_MissionGeometry + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestMissionGeometry.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_TimeConversions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestTimeConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_CelestialBodyConstants + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestCelestialBodyConstants.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_ModifiedEquinoctialElementConversions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestModifiedEquinoctialElementConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_GeodeticCoordinateConversions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestGeodeticCoordinateConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_StateElementConversions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestStateConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_SphericalOrbitalStateConversions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestSphericalOrbitStateConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics + tudat_reference_frames + tudat_basic_mathematics + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_BodyShapeModels + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestBodyShapeModels.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_UnifiedStateModelQuaternionElementConversions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestUnifiedStateModelQuaternionElementConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_UnifiedStateModelMRPElementConversions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestUnifiedStateModelMRPElementConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_UnifiedStateModelEMElementConversions + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestUnifiedStateModelEMElementConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_EmpiricalAccelerations + SOURCES "${BASIC_ASTRO_TEST_DIR}/unitTestEmpiricalAcceleration.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) diff --git a/Tudat/Astrodynamics/EarthOrientation/CMakeLists.txt b/Tudat/Astrodynamics/EarthOrientation/CMakeLists.txt index faa6c2a112..615c1e609b 100755 --- a/Tudat/Astrodynamics/EarthOrientation/CMakeLists.txt +++ b/Tudat/Astrodynamics/EarthOrientation/CMakeLists.txt @@ -35,24 +35,67 @@ set(EARTH_ORIENTATION_HEADERS add_library(tudat_earth_orientation STATIC ${EARTH_ORIENTATION_SOURCES} ${EARTH_ORIENTATION_HEADERS}) setup_tudat_library_target(tudat_earth_orientation "${SRCROOT}${EARTHORIENTATIONDIR}") -add_executable(test_EarthOrientationCalculator "${SRCROOT}${EARTHORIENTATIONDIR}/UnitTests/unitTestEarthOrientationCalculator.cpp") -setup_custom_test_program(test_EarthOrientationCalculator "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_EarthOrientationCalculator tudat_earth_orientation tudat_spice_interface tudat_sofa_interface tudat_interpolators tudat_basic_astrodynamics tudat_basic_mathematics tudat_input_output tudat_input_output sofa cspice ${Boost_LIBRARIES}) +# Add unit tests. +set(EO_TEST_DIR "${SRCROOT}${EARTHORIENTATIONDIR}/UnitTests") -add_executable(test_EopReader "${SRCROOT}${EARTHORIENTATIONDIR}/UnitTests/unitTestEopReader.cpp") -setup_custom_test_program(test_EopReader "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_EopReader tudat_earth_orientation tudat_sofa_interface tudat_interpolators tudat_basic_astrodynamics tudat_basic_mathematics tudat_input_output sofa ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_EarthOrientationCalculator + SOURCES "${EO_TEST_DIR}/unitTestEarthOrientationCalculator.cpp" + LINK_LIBRARIES tudat_earth_orientation + tudat_spice_interface + tudat_sofa_interface + tudat_interpolators + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_input_output + tudat_input_output + sofa cspice + ${Boost_LIBRARIES}) -add_executable(test_PolarMotion "${SRCROOT}${EARTHORIENTATIONDIR}/UnitTests/unitTestPolarMotionCalculator.cpp") -setup_custom_test_program(test_PolarMotion "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_PolarMotion tudat_earth_orientation tudat_sofa_interface tudat_interpolators tudat_basic_astrodynamics tudat_basic_mathematics tudat_input_output sofa ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_EopReader + SOURCES "${EO_TEST_DIR}/unitTestEopReader.cpp" + LINK_LIBRARIES tudat_earth_orientation + tudat_sofa_interface + tudat_interpolators + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_input_output sofa + ${Boost_LIBRARIES}) -add_executable(test_TimeScaleConverter "${SRCROOT}${EARTHORIENTATIONDIR}/UnitTests/unitTestTimeScaleConverter.cpp") -setup_custom_test_program(test_TimeScaleConverter "${SRCROOT}${EARTHORIENTATIONDIR}") -target_link_libraries(test_TimeScaleConverter tudat_earth_orientation tudat_sofa_interface tudat_interpolators tudat_basic_astrodynamics tudat_basic_mathematics tudat_input_output sofa ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_PolarMotion + SOURCES "${EO_TEST_DIR}/unitTestPolarMotionCalculator.cpp" + LINK_LIBRARIES tudat_earth_orientation + tudat_sofa_interface + tudat_interpolators + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_input_output sofa + ${Boost_LIBRARIES}) -add_executable(test_ShortPeriodEopCorrections "${SRCROOT}${EARTHORIENTATIONDIR}/UnitTests/unitTestShortPeriodEopCorrections.cpp") -setup_custom_test_program(test_ShortPeriodEopCorrections "${SRCROOT}${EARTHORIENTATIONDIR}") -target_link_libraries(test_ShortPeriodEopCorrections tudat_earth_orientation tudat_sofa_interface tudat_basic_astrodynamics tudat_basic_astrodynamics tudat_basic_mathematics tudat_input_output sofa ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_TimeScaleConverter + SOURCES "${EO_TEST_DIR}/unitTestTimeScaleConverter.cpp" + LINK_LIBRARIES tudat_earth_orientation + tudat_sofa_interface + tudat_interpolators + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_input_output + sofa + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_ShortPeriodEopCorrections + SOURCES "${EO_TEST_DIR}/unitTestShortPeriodEopCorrections.cpp" + LINK_LIBRARIES tudat_earth_orientation + tudat_sofa_interface + tudat_basic_astrodynamics + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_input_output + sofa + ${Boost_LIBRARIES}) diff --git a/Tudat/Astrodynamics/ElectroMagnetism/CMakeLists.txt b/Tudat/Astrodynamics/ElectroMagnetism/CMakeLists.txt index 3a14753b5d..c126a52d97 100644 --- a/Tudat/Astrodynamics/ElectroMagnetism/CMakeLists.txt +++ b/Tudat/Astrodynamics/ElectroMagnetism/CMakeLists.txt @@ -38,22 +38,29 @@ add_library(tudat_electro_magnetism STATIC ${ELECTROMAGNETISM_SOURCES} ${ELECTRO setup_tudat_library_target(tudat_electro_magnetism "${SRCROOT}${ELECTROMAGNETISMDIR}") # Add unit tests. -add_executable(test_CannonBallRadiationPressureAccelerationAndForce "${SRCROOT}${ELECTROMAGNETISMDIR}/UnitTests/unitTestCannonBallRadiationPressureAccelerationAndForce.cpp") -setup_custom_test_program(test_CannonBallRadiationPressureAccelerationAndForce "${SRCROOT}${ELECTROMAGNETISMDIR}") -target_link_libraries(test_CannonBallRadiationPressureAccelerationAndForce tudat_electro_magnetism tudat_basic_astrodynamics ${Boost_LIBRARIES}) +set(EM_TEST_DIR "${SRCROOT}${ELECTROMAGNETISMDIR}/UnitTests") -add_executable(test_LorentzStaticMagneticAccelerationAndForce "${SRCROOT}${ELECTROMAGNETISMDIR}/UnitTests/unitTestLorentzStaticMagneticAccelerationAndForce.cpp") -setup_custom_test_program(test_LorentzStaticMagneticAccelerationAndForce "${SRCROOT}${ELECTROMAGNETISMDIR}") -target_link_libraries(test_LorentzStaticMagneticAccelerationAndForce tudat_electro_magnetism tudat_basic_astrodynamics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_CannonBallRadiationPressureAccelerationAndForce + SOURCES "${EM_TEST_DIR}/unitTestCannonBallRadiationPressureAccelerationAndForce.cpp" + LINK_LIBRARIES tudat_electro_magnetism tudat_basic_astrodynamics ${Boost_LIBRARIES}) -add_executable(test_RadiationPressureInterface "${SRCROOT}${ELECTROMAGNETISMDIR}/UnitTests/unitTestRadiationPressureInterface.cpp") -setup_custom_test_program(test_RadiationPressureInterface "${SRCROOT}${ELECTROMAGNETISMDIR}") -target_link_libraries(test_RadiationPressureInterface tudat_electro_magnetism tudat_basic_astrodynamics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_LorentzStaticMagneticAccelerationAndForce + SOURCES "${EM_TEST_DIR}/unitTestLorentzStaticMagneticAccelerationAndForce.cpp" + LINK_LIBRARIES tudat_electro_magnetism tudat_basic_astrodynamics ${Boost_LIBRARIES}) -add_executable(test_PanelledRadiationPressure "${SRCROOT}${ELECTROMAGNETISMDIR}/UnitTests/unitTestPanelledRadiationPressure.cpp") -setup_custom_test_program(test_PanelledRadiationPressure "${ELECTROMAGNETISMDIR}") -target_link_libraries(test_PanelledRadiationPressure ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_RadiationPressureInterface + SOURCES "${EM_TEST_DIR}/unitTestRadiationPressureInterface.cpp" + LINK_LIBRARIES tudat_electro_magnetism tudat_basic_astrodynamics ${Boost_LIBRARIES}) -add_executable(test_SolarSailAccelerationAndForce "${SRCROOT}${ELECTROMAGNETISMDIR}/UnitTests/unitTestSolarSailAccelerationAndForce.cpp") -setup_custom_test_program(test_SolarSailAccelerationAndForce "${SRCROOT}${ELECTROMAGNETISMDIR}") -target_link_libraries(test_SolarSailAccelerationAndForce tudat_electro_magnetism tudat_basic_astrodynamics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_PanelledRadiationPressure + SOURCES "${EM_TEST_DIR}/unitTestPanelledRadiationPressure.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_SolarSailAccelerationAndForce + SOURCES "${EM_TEST_DIR}/unitTestSolarSailAccelerationAndForce.cpp" + LINK_LIBRARIES tudat_electro_magnetism tudat_basic_astrodynamics ${Boost_LIBRARIES}) diff --git a/Tudat/Astrodynamics/Ephemerides/CMakeLists.txt b/Tudat/Astrodynamics/Ephemerides/CMakeLists.txt index 769f657915..3d87bc9ea3 100644 --- a/Tudat/Astrodynamics/Ephemerides/CMakeLists.txt +++ b/Tudat/Astrodynamics/Ephemerides/CMakeLists.txt @@ -26,7 +26,7 @@ set(EPHEMERIDES_SOURCES "${SRCROOT}${EPHEMERIDESDIR}/tabulatedRotationalEphemeris.cpp" "${SRCROOT}${EPHEMERIDESDIR}/synchronousRotationalEphemeris.cpp" "${SRCROOT}${EPHEMERIDESDIR}/fullPlanetaryRotationModel.cpp" - "${SRCROOT}${EPHEMERIDESDIR}/tleEphemeris.cpp" + "${SRCROOT}${EPHEMERIDESDIR}/tleEphemeris.cpp" ) # Set the header files. @@ -53,70 +53,142 @@ set(EPHEMERIDES_HEADERS "${SRCROOT}${EPHEMERIDESDIR}/tabulatedRotationalEphemeris.h" "${SRCROOT}${EPHEMERIDESDIR}/fullPlanetaryRotationModel.h" "${SRCROOT}${EPHEMERIDESDIR}/synchronousRotationalEphemeris.h" - "${SRCROOT}${EPHEMERIDESDIR}/tleEphemeris.h") + "${SRCROOT}${EPHEMERIDESDIR}/tleEphemeris.h") # Add static libraries. add_library(tudat_ephemerides STATIC ${EPHEMERIDES_SOURCES} ${EPHEMERIDES_HEADERS}) setup_tudat_library_target(tudat_ephemerides "${SRCROOT}${EPHEMERIDESDIR}") # Add unit tests. -add_executable(test_ApproximatePlanetPositions "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestApproximatePlanetPositions.cpp") -setup_custom_test_program(test_ApproximatePlanetPositions "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_ApproximatePlanetPositions tudat_ephemerides tudat_gravitation tudat_basic_astrodynamics tudat_basic_mathematics tudat_input_output tudat_root_finders ${Boost_LIBRARIES}) - -add_executable(test_TabulatedEphemeris "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestTabulatedEphemeris.cpp") -setup_custom_test_program(test_TabulatedEphemeris "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_TabulatedEphemeris tudat_ephemerides tudat_interpolators tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_CartesianStateExtractor "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestCartesianStateExtractor.cpp") -setup_custom_test_program(test_CartesianStateExtractor "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_CartesianStateExtractor tudat_input_output tudat_ephemerides ${Boost_LIBRARIES}) - -add_executable(test_KeplerStateExtractor "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestKeplerStateExtractor.cpp") -setup_custom_test_program(test_KeplerStateExtractor "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_KeplerStateExtractor tudat_ephemerides tudat_input_output tudat_basic_astrodynamics tudat_basic_mathematics tudat_root_finders ${Boost_LIBRARIES}) - -add_executable(test_RotationalEphemeris "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestRotationalEphemeris.cpp") -setup_custom_test_program(test_RotationalEphemeris "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_RotationalEphemeris tudat_ephemerides tudat_reference_frames tudat_input_output tudat_basic_astrodynamics tudat_basic_mathematics tudat_spice_interface ${TUDAT_EXTERNAL_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_SimpleRotationalEphemeris "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestSimpleRotationalEphemeris.cpp") -setup_custom_test_program(test_SimpleRotationalEphemeris "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_SimpleRotationalEphemeris tudat_ephemerides tudat_reference_frames tudat_input_output tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) +set(EPHEM_TEST_DIR "${SRCROOT}${EPHEMERIDESDIR}/UnitTests") + +tudat_add_test( + TARGET test_ApproximatePlanetPositions + SOURCES "${EPHEM_TEST_DIR}/unitTestApproximatePlanetPositions.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_gravitation + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_input_output + tudat_root_finders + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_TabulatedEphemeris + SOURCES "${EPHEM_TEST_DIR}/unitTestTabulatedEphemeris.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_interpolators + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_CartesianStateExtractor + SOURCES "${EPHEM_TEST_DIR}/unitTestCartesianStateExtractor.cpp" + LINK_LIBRARIES tudat_input_output tudat_ephemerides ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_KeplerStateExtractor + SOURCES "${EPHEM_TEST_DIR}/unitTestKeplerStateExtractor.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_input_output + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_root_finders + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RotationalEphemeris + SOURCES "${EPHEM_TEST_DIR}/unitTestRotationalEphemeris.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_reference_frames + tudat_input_output + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_spice_interface + ${TUDAT_EXTERNAL_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_SimpleRotationalEphemeris + SOURCES "${EPHEM_TEST_DIR}/unitTestSimpleRotationalEphemeris.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_reference_frames + tudat_input_output + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) if(USE_CSPICE) -add_executable(test_FrameManager "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestFrameManager.cpp") -setup_custom_test_program(test_FrameManager "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_FrameManager tudat_ephemerides tudat_reference_frames ${TUDAT_EXTERNAL_INTERFACE_LIBRARIES} tudat_input_output tudat_basic_astrodynamics tudat_basic_mathematics ${TUDAT_EXTERNAL_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_CompositeEphemeris "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestCompositeEphemeris.cpp") -setup_custom_test_program(test_CompositeEphemeris "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_CompositeEphemeris ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_TabulatedRotationalEphemeris "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestTabulatedRotationalEphemeris.cpp") -setup_custom_test_program(test_TabulatedRotationalEphemeris "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_TabulatedRotationalEphemeris tudat_ephemerides tudat_reference_frames tudat_input_output tudat_basic_astrodynamics tudat_basic_mathematics tudat_spice_interface ${TUDAT_EXTERNAL_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_SynchronousRotationalEphemeris "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestSynchronousRotationalEphemeris.cpp") -setup_custom_test_program(test_SynchronousRotationalEphemeris "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_SynchronousRotationalEphemeris ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) -add_executable(test_TwoLineElementsEphemeris "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestTwoLineElementsEphemeris.cpp") -setup_custom_test_program(test_TwoLineElementsEphemeris "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_TwoLineElementsEphemeris ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + tudat_add_test( + TARGET test_FrameManager + SOURCES "${EPHEM_TEST_DIR}/unitTestFrameManager.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_reference_frames + ${TUDAT_EXTERNAL_INTERFACE_LIBRARIES} + tudat_input_output + tudat_basic_astrodynamics + tudat_basic_mathematics + ${TUDAT_EXTERNAL_LIBRARIES} + ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_CompositeEphemeris + SOURCES "${EPHEM_TEST_DIR}/unitTestCompositeEphemeris.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_TabulatedRotationalEphemeris + SOURCES "${EPHEM_TEST_DIR}/unitTestTabulatedRotationalEphemeris.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_reference_frames + tudat_input_output + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_spice_interface + ${TUDAT_EXTERNAL_LIBRARIES} + ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_SynchronousRotationalEphemeris + SOURCES "${EPHEM_TEST_DIR}/unitTestSynchronousRotationalEphemeris.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_TwoLineElementsEphemeris + SOURCES "${EPHEM_TEST_DIR}/unitTestTwoLineElementsEphemeris.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) endif() -add_executable(test_KeplerEphemeris "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestKeplerEphemeris.cpp") -setup_custom_test_program(test_KeplerEphemeris "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_KeplerEphemeris tudat_ephemerides tudat_reference_frames tudat_input_output tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_KeplerEphemeris + SOURCES "${EPHEM_TEST_DIR}/unitTestKeplerEphemeris.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_reference_frames + tudat_input_output + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) if(USE_SOFA) -add_executable(test_GcrsToItrsRotation "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestItrsToGcrsRotationModel.cpp") -setup_custom_test_program(test_GcrsToItrsRotation "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_GcrsToItrsRotation tudat_ephemerides tudat_spice_interface tudat_reference_frames tudat_earth_orientation tudat_sofa_interface tudat_basic_astrodynamics tudat_basic_mathematics tudat_input_output cspice sofa ${Boost_LIBRARIES}) + tudat_add_test( + TARGET test_GcrsToItrsRotation + SOURCES "${EPHEM_TEST_DIR}/unitTestItrsToGcrsRotationModel.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_spice_interface + tudat_reference_frames + tudat_earth_orientation + tudat_sofa_interface + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_input_output + cspice sofa + ${Boost_LIBRARIES}) endif( ) -add_executable(test_PlanetaryRotationModel "${SRCROOT}${EPHEMERIDESDIR}/UnitTests/unitTestPlanetaryRotationModel.cpp") -setup_custom_test_program(test_PlanetaryRotationModel "${SRCROOT}${EPHEMERIDESDIR}") -target_link_libraries(test_PlanetaryRotationModel ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_PlanetaryRotationModel + SOURCES "${EPHEM_TEST_DIR}/unitTestPlanetaryRotationModel.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) diff --git a/Tudat/Astrodynamics/Gravitation/CMakeLists.txt b/Tudat/Astrodynamics/Gravitation/CMakeLists.txt index 49837d5568..2882a6e913 100644 --- a/Tudat/Astrodynamics/Gravitation/CMakeLists.txt +++ b/Tudat/Astrodynamics/Gravitation/CMakeLists.txt @@ -67,58 +67,101 @@ add_library(tudat_gravitation STATIC ${GRAVITATION_SOURCES} ${GRAVITATION_HEADER setup_tudat_library_target(tudat_gravitation "${SRCROOT}${GRAVITATIONDIR}") # Add unit tests. -add_executable(test_SphericalHarmonicsGravityField "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestSphericalHarmonicsGravityField.cpp") -setup_custom_test_program(test_SphericalHarmonicsGravityField "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_SphericalHarmonicsGravityField tudat_gravitation tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) - -add_executable(test_GravitationalForce "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestGravitationalForce.cpp") -setup_custom_test_program(test_GravitationalForce "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_GravitationalForce tudat_gravitation tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_CentralAndZonalGravityModel "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestCentralAndZonalGravityModel.cpp") -setup_custom_test_program(test_CentralAndZonalGravityModel "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_CentralAndZonalGravityModel tudat_gravitation tudat_basic_astrodynamics tudat_basic_astrodynamics tudat_numerical_integrators ${Boost_LIBRARIES}) - -add_executable(test_UnitConversionsCircularRestrictedThreeBodyProblem "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestUnitConversionsCircularRestrictedThreeBodyProblem.cpp") -setup_custom_test_program(test_UnitConversionsCircularRestrictedThreeBodyProblem "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_UnitConversionsCircularRestrictedThreeBodyProblem tudat_gravitation ${Boost_LIBRARIES}) - -add_executable(test_JacobiEnergy "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestJacobiEnergy.cpp") -setup_custom_test_program(test_JacobiEnergy "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_JacobiEnergy tudat_gravitation tudat_mission_segments tudat_root_finders tudat_basic_astrodynamics tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_LibrationPoints "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestLibrationPoints.cpp") -setup_custom_test_program(test_LibrationPoints "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_LibrationPoints tudat_ephemerides tudat_root_finders tudat_gravitation tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_SphericalHarmonicsGravityModel "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestSphericalHarmonicsGravityModel.cpp") -setup_custom_test_program(test_SphericalHarmonicsGravityModel "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_SphericalHarmonicsGravityModel tudat_gravitation tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES} ) - -add_executable(test_ThirdBodyPerturbation "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestThirdBodyPerturbation.cpp") -setup_custom_test_program(test_ThirdBodyPerturbation "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_ThirdBodyPerturbation tudat_gravitation tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES} ) - -add_executable(test_TriAxialEllipsoidGravity "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestTriAxialEllipsoidGravity.cpp") -setup_custom_test_program(test_TriAxialEllipsoidGravity "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_TriAxialEllipsoidGravity tudat_gravitation tudat_basic_mathematics ${Boost_LIBRARIES} ) - -add_executable(test_DirectTidalDissipationAcceleration "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestDirectTidalDissipation.cpp") -setup_custom_test_program(test_DirectTidalDissipationAcceleration "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_DirectTidalDissipationAcceleration ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - +set(GRAV_TEST_DIR "${SRCROOT}${GRAVITATIONDIR}/UnitTests") + +tudat_add_test( + TARGET test_SphericalHarmonicsGravityField + SOURCES "${GRAV_TEST_DIR}/unitTestSphericalHarmonicsGravityField.cpp" + LINK_LIBRARIES tudat_gravitation + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_GravitationalForce + SOURCES "${GRAV_TEST_DIR}/unitTestGravitationalForce.cpp" + LINK_LIBRARIES tudat_gravitation tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_CentralAndZonalGravityModel + SOURCES "${GRAV_TEST_DIR}/unitTestCentralAndZonalGravityModel.cpp" + LINK_LIBRARIES tudat_gravitation + tudat_basic_astrodynamics + tudat_basic_astrodynamics + tudat_numerical_integrators + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_UnitConversionsCircularRestrictedThreeBodyProblem + SOURCES "${GRAV_TEST_DIR}/unitTestUnitConversionsCircularRestrictedThreeBodyProblem.cpp" + LINK_LIBRARIES tudat_gravitation ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_JacobiEnergy + SOURCES "${GRAV_TEST_DIR}/unitTestJacobiEnergy.cpp" + LINK_LIBRARIES tudat_gravitation + tudat_mission_segments + tudat_root_finders + tudat_basic_astrodynamics + tudat_input_output + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_LibrationPoints + SOURCES "${GRAV_TEST_DIR}/unitTestLibrationPoints.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_root_finders + tudat_gravitation + tudat_input_output + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_SphericalHarmonicsGravityModel + SOURCES "${GRAV_TEST_DIR}/unitTestSphericalHarmonicsGravityModel.cpp" + LINK_LIBRARIES tudat_gravitation + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES} ) + +tudat_add_test( + TARGET test_ThirdBodyPerturbation + SOURCES "${GRAV_TEST_DIR}/unitTestThirdBodyPerturbation.cpp" + LINK_LIBRARIES tudat_gravitation + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_TriAxialEllipsoidGravity + SOURCES "${GRAV_TEST_DIR}/unitTestTriAxialEllipsoidGravity.cpp" + LINK_LIBRARIES tudat_gravitation tudat_basic_mathematics ${Boost_LIBRARIES} ) + +tudat_add_test( + TARGET test_DirectTidalDissipationAcceleration + SOURCES "${GRAV_TEST_DIR}/unitTestDirectTidalDissipation.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) if(USE_CSPICE) -add_executable(test_GravityFieldVariations "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestGravityFieldVariations.cpp") -setup_custom_test_program(test_GravityFieldVariations "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_GravityFieldVariations tudat_gravitation tudat_interpolators tudat_basic_mathematics tudat_spice_interface ${SPICE_LIBRARIES} ${Boost_LIBRARIES} ) - -add_executable(test_MutualSphericalHarmonicsGravityModel "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestMutualSphericalHarmonicAcceleration.cpp") -setup_custom_test_program(test_MutualSphericalHarmonicsGravityModel "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_MutualSphericalHarmonicsGravityModel ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) -add_executable(test_GravitationalTorques "${SRCROOT}${GRAVITATIONDIR}/UnitTests/unitTestGravitationalTorques.cpp") -setup_custom_test_program(test_GravitationalTorques "${SRCROOT}${GRAVITATIONDIR}") -target_link_libraries(test_GravitationalTorques ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + tudat_add_test( + TARGET test_GravityFieldVariations + SOURCES "${GRAV_TEST_DIR}/unitTestGravityFieldVariations.cpp" + DEPENDS ${SPICE_LIBRARIES} + LINK_LIBRARIES tudat_gravitation + tudat_interpolators + tudat_basic_mathematics + tudat_spice_interface + ${SPICE_LIBRARIES} + ${Boost_LIBRARIES} ) + + tudat_add_test( + TARGET test_MutualSphericalHarmonicsGravityModel + SOURCES "${GRAV_TEST_DIR}/unitTestMutualSphericalHarmonicAcceleration.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_GravitationalTorques + SOURCES "${GRAV_TEST_DIR}/unitTestGravitationalTorques.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) endif() diff --git a/Tudat/Astrodynamics/GroundStations/CMakeLists.txt b/Tudat/Astrodynamics/GroundStations/CMakeLists.txt index 9204dc4699..0f64317d70 100644 --- a/Tudat/Astrodynamics/GroundStations/CMakeLists.txt +++ b/Tudat/Astrodynamics/GroundStations/CMakeLists.txt @@ -26,11 +26,13 @@ set(GROUND_STATIONS_HEADERS add_library(tudat_ground_stations STATIC ${GROUND_STATIONS_SOURCES} ${GROUND_STATIONS_HEADERS}) setup_tudat_library_target(tudat_ground_stations "${SRCROOT}{GROUNDSTATIONSDIR}") +# Add unit tests +tudat_add_test( + TARGET test_GroundStationState + SOURCES "${SRCROOT}${GROUNDSTATIONSDIR}/UnitTests/unitTestGroundStationState.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) -add_executable(test_GroundStationState "${SRCROOT}${GROUNDSTATIONSDIR}/UnitTests/unitTestGroundStationState.cpp") -setup_custom_test_program(test_GroundStationState "${SRCROOT}${GROUNDSTATIONSDIR}") -target_link_libraries(test_GroundStationState ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_PointingAnglesCalculator "${SRCROOT}${GROUNDSTATIONSDIR}/UnitTests/unitTestPointingAnglesCalculator.cpp") -setup_custom_test_program(test_PointingAnglesCalculator "${SRCROOT}${GROUNDSTATIONSDIR}") -target_link_libraries(test_PointingAnglesCalculator ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_PointingAnglesCalculator + SOURCES "${SRCROOT}${GROUNDSTATIONSDIR}/UnitTests/unitTestPointingAnglesCalculator.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) diff --git a/Tudat/Astrodynamics/MissionSegments/CMakeLists.txt b/Tudat/Astrodynamics/MissionSegments/CMakeLists.txt index 09f346e521..8caedba42d 100755 --- a/Tudat/Astrodynamics/MissionSegments/CMakeLists.txt +++ b/Tudat/Astrodynamics/MissionSegments/CMakeLists.txt @@ -22,7 +22,7 @@ set(MISSIONSEGMENTS_SOURCES ) # Set the header files. -set(MISSIONSEGMENTS_HEADERS +set(MISSIONSEGMENTS_HEADERS "${SRCROOT}${MISSIONSEGMENTSDIR}/escapeAndCapture.h" "${SRCROOT}${MISSIONSEGMENTSDIR}/gravityAssist.h" "${SRCROOT}${MISSIONSEGMENTSDIR}/improvedInversePolynomialWall.h" @@ -40,38 +40,85 @@ add_library(tudat_mission_segments STATIC ${MISSIONSEGMENTS_SOURCES} ${MISSIONSE setup_tudat_library_target(tudat_mission_segments "${SRCROOT}${MISSIONSEGMENTSDIR}") # Add unit tests. -add_executable(test_EscapeAndCapture "${SRCROOT}${MISSIONSEGMENTSDIR}/UnitTests/unitTestEscapeAndCapture.cpp") -setup_custom_test_program(test_EscapeAndCapture "${SRCROOT}${MISSIONSEGMENTSDIR}") -target_link_libraries(test_EscapeAndCapture tudat_mission_segments tudat_gravitation tudat_basic_astrodynamics tudat_basic_mathematics tudat_root_finders tudat_input_output ${Boost_LIBRARIES}) +set(MISS_SEG_TEST_DIR "${SRCROOT}${MISSIONSEGMENTSDIR}/UnitTests") -add_executable(test_GravityAssist "${SRCROOT}${MISSIONSEGMENTSDIR}/UnitTests/unitTestGravityAssist.cpp") -setup_custom_test_program(test_GravityAssist "${SRCROOT}${MISSIONSEGMENTSDIR}") -target_link_libraries(test_GravityAssist tudat_gravitation tudat_mission_segments tudat_basic_astrodynamics tudat_basic_mathematics tudat_root_finders tudat_input_output ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_EscapeAndCapture + SOURCES "${MISS_SEG_TEST_DIR}/unitTestEscapeAndCapture.cpp" + LINK_LIBRARIES tudat_mission_segments + tudat_gravitation + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_root_finders + tudat_input_output + ${Boost_LIBRARIES}) -add_executable(test_LambertTargeterIzzo "${SRCROOT}${MISSIONSEGMENTSDIR}/UnitTests/unitTestLambertTargeterIzzo.cpp") -setup_custom_test_program(test_LambertTargeterIzzo "${SRCROOT}${MISSIONSEGMENTSDIR}") -target_link_libraries(test_LambertTargeterIzzo tudat_mission_segments tudat_root_finders tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_GravityAssist + SOURCES "${MISS_SEG_TEST_DIR}/unitTestGravityAssist.cpp" + LINK_LIBRARIES tudat_gravitation + tudat_mission_segments + tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_root_finders + tudat_input_output + ${Boost_LIBRARIES}) -add_executable(test_LambertTargeterGooding "${SRCROOT}${MISSIONSEGMENTSDIR}/UnitTests/unitTestLambertTargeterGooding.cpp") -setup_custom_test_program(test_LambertTargeterGooding "${SRCROOT}${MISSIONSEGMENTSDIR}") -target_link_libraries(test_LambertTargeterGooding tudat_mission_segments tudat_root_finders tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_LambertTargeterIzzo + SOURCES "${MISS_SEG_TEST_DIR}/unitTestLambertTargeterIzzo.cpp" + LINK_LIBRARIES tudat_mission_segments + tudat_root_finders + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) -add_executable(test_LambertTargeter "${SRCROOT}${MISSIONSEGMENTSDIR}/UnitTests/unitTestLambertTargeter.cpp") -setup_custom_test_program(test_LambertTargeter "${SRCROOT}${MISSIONSEGMENTSDIR}") -target_link_libraries(test_LambertTargeter tudat_mission_segments tudat_root_finders tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_LambertTargeterGooding + SOURCES "${MISS_SEG_TEST_DIR}/unitTestLambertTargeterGooding.cpp" + LINK_LIBRARIES tudat_mission_segments + tudat_root_finders + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) -add_executable(test_LambertRoutines "${SRCROOT}${MISSIONSEGMENTSDIR}/UnitTests/unitTestLambertRoutines.cpp") -setup_custom_test_program(test_LambertRoutines "${SRCROOT}${MISSIONSEGMENTSDIR}") -target_link_libraries(test_LambertRoutines tudat_mission_segments tudat_root_finders tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_LambertTargeter + SOURCES "${MISS_SEG_TEST_DIR}/unitTestLambertTargeter.cpp" + LINK_LIBRARIES tudat_mission_segments + tudat_root_finders + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) -add_executable(test_ZeroRevolutionLambertTargeterIzzo "${SRCROOT}${MISSIONSEGMENTSDIR}/UnitTests/unitTestZeroRevolutionLambertTargeterIzzo.cpp") -setup_custom_test_program(test_ZeroRevolutionLambertTargeterIzzo "${SRCROOT}${MISSIONSEGMENTSDIR}") -target_link_libraries(test_ZeroRevolutionLambertTargeterIzzo tudat_mission_segments tudat_root_finders tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_LambertRoutines + SOURCES "${MISS_SEG_TEST_DIR}/unitTestLambertRoutines.cpp" + LINK_LIBRARIES tudat_mission_segments + tudat_root_finders + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) -add_executable(test_MultiRevolutionLambertTargeterIzzo "${SRCROOT}${MISSIONSEGMENTSDIR}/UnitTests/unitTestMultiRevolutionLambertTargeterIzzo.cpp") -setup_custom_test_program(test_MultiRevolutionLambertTargeterIzzo "${SRCROOT}${MISSIONSEGMENTSDIR}") -target_link_libraries(test_MultiRevolutionLambertTargeterIzzo tudat_mission_segments tudat_root_finders tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_ZeroRevolutionLambertTargeterIzzo + SOURCES "${MISS_SEG_TEST_DIR}/unitTestZeroRevolutionLambertTargeterIzzo.cpp" + LINK_LIBRARIES tudat_mission_segments + tudat_root_finders + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) -add_executable(test_MathematicalShapeFunctions "${SRCROOT}${MISSIONSEGMENTSDIR}/UnitTests/unitTestMathematicalShapeFunctions.cpp") -setup_custom_test_program(test_MathematicalShapeFunctions "${SRCROOT}${MISSIONSEGMENTSDIR}") -target_link_libraries(test_MathematicalShapeFunctions tudat_mission_segments tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_MultiRevolutionLambertTargeterIzzo + SOURCES "${MISS_SEG_TEST_DIR}/unitTestMultiRevolutionLambertTargeterIzzo.cpp" + LINK_LIBRARIES tudat_mission_segments + tudat_root_finders + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_MathematicalShapeFunctions + SOURCES "${MISS_SEG_TEST_DIR}/unitTestMathematicalShapeFunctions.cpp" + LINK_LIBRARIES tudat_mission_segments tudat_basic_mathematics ${Boost_LIBRARIES}) diff --git a/Tudat/Astrodynamics/ObservationModels/CMakeLists.txt b/Tudat/Astrodynamics/ObservationModels/CMakeLists.txt index f2111e90a6..1bccdb79cf 100644 --- a/Tudat/Astrodynamics/ObservationModels/CMakeLists.txt +++ b/Tudat/Astrodynamics/ObservationModels/CMakeLists.txt @@ -53,49 +53,68 @@ set(OBSERVATION_MODELS_HEADERS add_library(tudat_observation_models STATIC ${OBSERVATION_MODELS_SOURCES} ${OBSERVATION_MODELS_HEADERS}) setup_tudat_library_target(tudat_observation_models "${SRCROOT}${OBSERVATIONMODELSDIR}") +# Add unit tests. +set(OBSMDL_TEST_DIR "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests") if(USE_CSPICE) - add_executable(test_LightTime "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestLightTimeSolution.cpp") - setup_custom_test_program(test_LightTime "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_LightTime tudat_observation_models tudat_ephemerides tudat_basic_astrodynamics tudat_spice_interface ${SPICE_LIBRARIES} ${Boost_LIBRARIES}) + tudat_add_test( + TARGET test_LightTime + SOURCES "${OBSMDL_TEST_DIR}/unitTestLightTimeSolution.cpp" + LINK_LIBRARIES tudat_observation_models + tudat_ephemerides + tudat_basic_astrodynamics + tudat_spice_interface + ${SPICE_LIBRARIES} + ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_AngularPositionModel + SOURCES "${OBSMDL_TEST_DIR}/unitTestAngularPositionModel.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_OneWayRangeModel + SOURCES "${OBSMDL_TEST_DIR}/unitTestOneWayRangeObservationModel.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_OneWayDifferencedRangeModel + SOURCES "${OBSMDL_TEST_DIR}/unitTestOneWayDifferencedRangeModel.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_DopplerModels + SOURCES "${OBSMDL_TEST_DIR}/unitTestDopplerModels.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_PositionObservationModel + SOURCES "${OBSMDL_TEST_DIR}/unitTestPositionObservationModel.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_EulerAngleObservationModel + SOURCES "${OBSMDL_TEST_DIR}/unitTestEulerAngleObservationModel.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_VelocityObservationModel + SOURCES "${OBSMDL_TEST_DIR}/unitTestVelocityObservationModel.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_ObservationNoiseSimulation + SOURCES "${OBSMDL_TEST_DIR}/unitTestSimulatedObservationNoise.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_NWayRangeObservationModel + SOURCES "${OBSMDL_TEST_DIR}/unitTestNWayRangeObservationModel.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_ObservationViabilityCalculators + SOURCES "${OBSMDL_TEST_DIR}/unitTestObservationViabilityCalculators.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - add_executable(test_AngularPositionModel "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestAngularPositionModel.cpp") - setup_custom_test_program(test_AngularPositionModel "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_AngularPositionModel ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - add_executable(test_OneWayRangeModel "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestOneWayRangeObservationModel.cpp") - setup_custom_test_program(test_OneWayRangeModel "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_OneWayRangeModel ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - add_executable(test_OneWayDifferencedRangeModel "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestOneWayDifferencedRangeModel.cpp") - setup_custom_test_program(test_OneWayDifferencedRangeModel "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_OneWayDifferencedRangeModel ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - add_executable(test_DopplerModels "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestDopplerModels.cpp") - setup_custom_test_program(test_DopplerModels "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_DopplerModels ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - add_executable(test_PositionObservationModel "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestPositionObservationModel.cpp") - setup_custom_test_program(test_PositionObservationModel "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_PositionObservationModel ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - add_executable(test_EulerAngleObservationModel "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestEulerAngleObservationModel.cpp") - setup_custom_test_program(test_EulerAngleObservationModel "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_EulerAngleObservationModel ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - add_executable(test_VelocityObservationModel "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestVelocityObservationModel.cpp") - setup_custom_test_program(test_VelocityObservationModel "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_VelocityObservationModel ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - add_executable(test_ObservationNoiseSimulation "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestSimulatedObservationNoise.cpp") - setup_custom_test_program(test_ObservationNoiseSimulation "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_ObservationNoiseSimulation ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - add_executable(test_NWayRangeObservationModel "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestNWayRangeObservationModel.cpp") - setup_custom_test_program(test_NWayRangeObservationModel "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_NWayRangeObservationModel ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - add_executable(test_ObservationViabilityCalculators "${SRCROOT}${OBSERVATIONMODELSDIR}/UnitTests/unitTestObservationViabilityCalculators.cpp") - setup_custom_test_program(test_ObservationViabilityCalculators "${SRCROOT}${OBSERVATIONMODELSDIR}") - target_link_libraries(test_ObservationViabilityCalculators ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) endif( ) diff --git a/Tudat/Astrodynamics/OrbitDetermination/AccelerationPartials/CMakeLists.txt b/Tudat/Astrodynamics/OrbitDetermination/AccelerationPartials/CMakeLists.txt index 2b5bb13926..a3914cf292 100644 --- a/Tudat/Astrodynamics/OrbitDetermination/AccelerationPartials/CMakeLists.txt +++ b/Tudat/Astrodynamics/OrbitDetermination/AccelerationPartials/CMakeLists.txt @@ -47,21 +47,24 @@ set(ACCELERATION_PARTIALS_HEADERS add_library(tudat_acceleration_partials STATIC ${ACCELERATION_PARTIALS_SOURCES} ${ACCELERATION_PARTIALS_HEADERS}) setup_tudat_library_target(tudat_acceleration_partials "${SRCROOT}{ACCELERATIONPARTIALSDIR}") +# Add unit tests +set(ACCPARTIALS_TEST_DIR "${SRCROOT}${ACCELERATIONPARTIALSDIR}/UnitTests") if(USE_CSPICE) -# Add unit tests -add_executable(test_AccelerationPartials "${SRCROOT}${ACCELERATIONPARTIALSDIR}/UnitTests/unitTestAccelerationPartials.cpp") -setup_custom_test_program(test_AccelerationPartials "${SRCROOT}${ACCELERATIONPARTIALSDIR}") -target_link_libraries(test_AccelerationPartials ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + tudat_add_test( + TARGET test_AccelerationPartials + SOURCES "${ACCPARTIALS_TEST_DIR}/unitTestAccelerationPartials.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) -# Add unit tests -add_executable(test_SphericalHarmonicPartials "${SRCROOT}${ACCELERATIONPARTIALSDIR}/UnitTests/unitTestSphericalHarmonicPartials.cpp") -setup_custom_test_program(test_SphericalHarmonicPartials "${SRCROOT}${ACCELERATIONPARTIALSDIR}") -target_link_libraries(test_SphericalHarmonicPartials ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + tudat_add_test( + TARGET test_SphericalHarmonicPartials + SOURCES "${ACCPARTIALS_TEST_DIR}/unitTestSphericalHarmonicPartials.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) -add_executable(test_MutualSphericalHarmonicPartials "${SRCROOT}${ACCELERATIONPARTIALSDIR}/UnitTests/unitTestMutualSphericalHarmonicPartials.cpp") -setup_custom_test_program(test_MutualSphericalHarmonicPartials "${SRCROOT}${ACCELERATIONPARTIALSDIR}") -target_link_libraries(test_MutualSphericalHarmonicPartials ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + tudat_add_test( + TARGET test_MutualSphericalHarmonicPartials + SOURCES "${ACCPARTIALS_TEST_DIR}/unitTestMutualSphericalHarmonicPartials.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) endif( ) diff --git a/Tudat/Astrodynamics/OrbitDetermination/CMakeLists.txt b/Tudat/Astrodynamics/OrbitDetermination/CMakeLists.txt index af559fb8cf..b02b7210a3 100644 --- a/Tudat/Astrodynamics/OrbitDetermination/CMakeLists.txt +++ b/Tudat/Astrodynamics/OrbitDetermination/CMakeLists.txt @@ -42,68 +42,83 @@ set(ORBIT_DETERMINATION_HEADERS add_library(tudat_orbit_determination STATIC ${ORBIT_DETERMINATION_SOURCES} ${ORBIT_DETERMINATION_HEADERS}) setup_tudat_library_target(tudat_orbit_determination "${SRCROOT}{ORBITDETERMINATIONDIR}") +# Add unit tests. +set(ORBDET_TEST_DIR "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests") if( BUILD_WITH_PROPAGATION_TESTS ) -add_executable(test_EstimationFromPositionDoubleDouble "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestEstimationFromIdealDataDoubleDouble.cpp") -setup_custom_test_program(test_EstimationFromPositionDoubleDouble "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_EstimationFromPositionDoubleDouble ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_EstimationInput "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestEstimationInput.cpp") -setup_custom_test_program(test_EstimationInput "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_EstimationInput ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - -add_executable(test_TidalPropertyEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestTidalPropertyEstimation.cpp") -setup_custom_test_program(test_TidalPropertyEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_TidalPropertyEstimation ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_MultiArcStateEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestMultiArcStateEstimation.cpp") -setup_custom_test_program(test_MultiArcStateEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_MultiArcStateEstimation ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_HybridArcStateEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestHybridArcStateEstimation.cpp") -setup_custom_test_program(test_HybridArcStateEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_HybridArcStateEstimation ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_ParameterInfluenceDetermination "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestParameterInfluenceDetermination.cpp") -setup_custom_test_program(test_ParameterInfluenceDetermination "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_ParameterInfluenceDetermination ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_BiasEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestBiasEstimation.cpp") -setup_custom_test_program(test_BiasEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_BiasEstimation ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_RotationalStateEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestRotationalStateEstimation.cpp") -setup_custom_test_program(test_RotationalStateEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_RotationalStateEstimation ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_ArcwiseEnvironmentEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestArcwiseEnvironmentParameters.cpp") -setup_custom_test_program(test_ArcwiseEnvironmentEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_ArcwiseEnvironmentEstimation ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_DesaturationDeltaVsEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestDesaturationDeltaVsEstimation.cpp") -setup_custom_test_program(test_DesaturationDeltaVsEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_DesaturationDeltaVsEstimation ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_FullPlanetaryRotationModelEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestFullPlanetaryRotationModelEstimation.cpp") -setup_custom_test_program(test_FullPlanetaryRotationModelEstimation "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_FullPlanetaryRotationModelEstimation ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -if( BUILD_WITH_EXTENDED_PRECISION_PROPAGATION_TOOLS ) - -add_executable(test_EstimationFromPositionDoubleLongDouble "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestEstimationFromIdealDataDoubleLongDouble.cpp") -setup_custom_test_program(test_EstimationFromPositionDoubleLongDouble "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_EstimationFromPositionDoubleLongDouble ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_EstimationFromPositionTimeDouble "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestEstimationFromIdealDataTimeDouble.cpp") -setup_custom_test_program(test_EstimationFromPositionTimeDouble "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_EstimationFromPositionTimeDouble ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_EstimationFromPositionTimeLongDouble "${SRCROOT}${ORBITDETERMINATIONDIR}/UnitTests/unitTestEstimationFromIdealDataTimeLongDouble.cpp") -setup_custom_test_program(test_EstimationFromPositionTimeLongDouble "${SRCROOT}${ORBITDETERMINATIONDIR}") -target_link_libraries(test_EstimationFromPositionTimeLongDouble ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -endif( ) + tudat_add_test( + TARGET test_EstimationFromPositionDoubleDouble + SOURCES "${ORBDET_TEST_DIR}/unitTestEstimationFromIdealDataDoubleDouble.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_EstimationInput + SOURCES "${ORBDET_TEST_DIR}/unitTestEstimationInput.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_TidalPropertyEstimation + SOURCES "${ORBDET_TEST_DIR}/unitTestTidalPropertyEstimation.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_MultiArcStateEstimation + SOURCES "${ORBDET_TEST_DIR}/unitTestMultiArcStateEstimation.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_HybridArcStateEstimation + SOURCES "${ORBDET_TEST_DIR}/unitTestHybridArcStateEstimation.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_ParameterInfluenceDetermination + SOURCES "${ORBDET_TEST_DIR}/unitTestParameterInfluenceDetermination.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_BiasEstimation + SOURCES "${ORBDET_TEST_DIR}/unitTestBiasEstimation.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_RotationalStateEstimation + SOURCES "${ORBDET_TEST_DIR}/unitTestRotationalStateEstimation.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_ArcwiseEnvironmentEstimation + SOURCES "${ORBDET_TEST_DIR}/unitTestArcwiseEnvironmentParameters.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_DesaturationDeltaVsEstimation + SOURCES "${ORBDET_TEST_DIR}/unitTestDesaturationDeltaVsEstimation.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_FullPlanetaryRotationModelEstimation + SOURCES "${ORBDET_TEST_DIR}/unitTestFullPlanetaryRotationModelEstimation.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + if( BUILD_WITH_EXTENDED_PRECISION_PROPAGATION_TOOLS ) + + tudat_add_test( + TARGET test_EstimationFromPositionDoubleLongDouble + SOURCES "${ORBDET_TEST_DIR}/unitTestEstimationFromIdealDataDoubleLongDouble.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_EstimationFromPositionTimeDouble + SOURCES "${ORBDET_TEST_DIR}/unitTestEstimationFromIdealDataTimeDouble.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_EstimationFromPositionTimeLongDouble + SOURCES "${ORBDET_TEST_DIR}/unitTestEstimationFromIdealDataTimeLongDouble.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + endif( ) endif( ) diff --git a/Tudat/Astrodynamics/OrbitDetermination/ObservationPartials/CMakeLists.txt b/Tudat/Astrodynamics/OrbitDetermination/ObservationPartials/CMakeLists.txt index 268afaac70..c4ad51e27a 100644 --- a/Tudat/Astrodynamics/OrbitDetermination/ObservationPartials/CMakeLists.txt +++ b/Tudat/Astrodynamics/OrbitDetermination/ObservationPartials/CMakeLists.txt @@ -55,47 +55,80 @@ setup_tudat_library_target(tudat_observation_partials "${SRCROOT}{OBSERVATIONPAR add_library(tudat_observation_partials_test_functions STATIC ${OBSERVATION_PARTIALS_TEST_SOURCES} ${OBSERVATION_PARTIALS_TEST_HEADERS}) setup_tudat_library_target(tudat_observation_partials "${SRCROOT}{OBSERVATIONPARTIALSDIR}/UnitTests") -add_executable(test_OneWayRangePartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests/unitTestOneWayRangePartials.cpp") -setup_custom_test_program(test_OneWayRangePartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}") -target_link_libraries(test_OneWayRangePartials tudat_observation_partials_test_functions ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - -add_executable(test_NWayRangePartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests/unitTestNWayRangePartials.cpp") -setup_custom_test_program(test_NWayRangePartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}") -target_link_libraries(test_NWayRangePartials tudat_observation_partials_test_functions ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_OneWayDifferencedRangePartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests/unitTestDifferencedOneWayRangePartials.cpp") -setup_custom_test_program(test_OneWayDifferencedRangePartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}") -target_link_libraries(test_OneWayDifferencedRangePartials tudat_observation_partials_test_functions ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_OneWayDopplerPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests/unitTestOneWayDopplerPartials.cpp") -setup_custom_test_program(test_OneWayDopplerPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}") -target_link_libraries(test_OneWayDopplerPartials tudat_observation_partials_test_functions ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_TwoWayDopplerPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests/unitTestTwoWayDopplerPartials.cpp") -setup_custom_test_program(test_TwoWayDopplerPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}") -target_link_libraries(test_TwoWayDopplerPartials tudat_observation_partials_test_functions ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_AngularPositionPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests/unitTestAngularPositionPartials.cpp") -setup_custom_test_program(test_AngularPositionPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}") -target_link_libraries(test_AngularPositionPartials tudat_observation_partials_test_functions ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_PositionPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests/unitTestPositionPartials.cpp") -setup_custom_test_program(test_PositionPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}") -target_link_libraries(test_PositionPartials tudat_observation_partials_test_functions ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_EulerAngleObservationPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests/unitTestEulerAngleObservationPartials.cpp") -setup_custom_test_program(test_EulerAngleObservationPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}") -target_link_libraries(test_EulerAngleObservationPartials tudat_observation_partials_test_functions ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_RotationMatrixPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests/unitTestRotationMatrixPartials.cpp") -setup_custom_test_program(test_RotationMatrixPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}") -target_link_libraries(test_RotationMatrixPartials ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_FullRotationPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests/unitTestFullRotationPartials.cpp") -setup_custom_test_program(test_FullRotationPartials "${SRCROOT}${OBSERVATIONPARTIALSDIR}") -target_link_libraries(test_FullRotationPartials ${TUDAT_PROPAGATION_LIBRARIES} ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_LightTimePartials "${SRCROOT}${LIGHTTIMECORRECTIONPARTIALSDIR}/UnitTests/unitTestLightTimePartials.cpp") -setup_custom_test_program(test_LightTimePartials "${SRCROOT}${LIGHTTIMECORRECTIONPARTIALSDIR}") -target_link_libraries(test_LightTimePartials tudat_observation_partials_test_functions ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) +# Add unit tests. +set(OBSPARTIALS_TEST_DIR "${SRCROOT}${OBSERVATIONPARTIALSDIR}/UnitTests") + +tudat_add_test( + TARGET test_OneWayRangePartials + SOURCES "${OBSPARTIALS_TEST_DIR}/unitTestOneWayRangePartials.cpp" + LINK_LIBRARIES tudat_observation_partials_test_functions + ${TUDAT_ESTIMATION_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_NWayRangePartials + SOURCES "${OBSPARTIALS_TEST_DIR}/unitTestNWayRangePartials.cpp" + LINK_LIBRARIES tudat_observation_partials_test_functions + ${TUDAT_ESTIMATION_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_OneWayDifferencedRangePartials + SOURCES "${OBSPARTIALS_TEST_DIR}/unitTestDifferencedOneWayRangePartials.cpp" + LINK_LIBRARIES tudat_observation_partials_test_functions + ${TUDAT_ESTIMATION_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_OneWayDopplerPartials + SOURCES "${OBSPARTIALS_TEST_DIR}/unitTestOneWayDopplerPartials.cpp" + LINK_LIBRARIES tudat_observation_partials_test_functions + ${TUDAT_ESTIMATION_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_TwoWayDopplerPartials + SOURCES "${OBSPARTIALS_TEST_DIR}/unitTestTwoWayDopplerPartials.cpp" + LINK_LIBRARIES tudat_observation_partials_test_functions + ${TUDAT_ESTIMATION_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_AngularPositionPartials + SOURCES "${OBSPARTIALS_TEST_DIR}/unitTestAngularPositionPartials.cpp" + LINK_LIBRARIES tudat_observation_partials_test_functions + ${TUDAT_ESTIMATION_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_PositionPartials + SOURCES "${OBSPARTIALS_TEST_DIR}/unitTestPositionPartials.cpp" + LINK_LIBRARIES tudat_observation_partials_test_functions + ${TUDAT_ESTIMATION_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_EulerAngleObservationPartials + SOURCES "${OBSPARTIALS_TEST_DIR}/unitTestEulerAngleObservationPartials.cpp" + LINK_LIBRARIES tudat_observation_partials_test_functions + ${TUDAT_ESTIMATION_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RotationMatrixPartials + SOURCES "${OBSPARTIALS_TEST_DIR}/unitTestRotationMatrixPartials.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_FullRotationPartials + SOURCES "${OBSPARTIALS_TEST_DIR}/unitTestFullRotationPartials.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} + ${TUDAT_ESTIMATION_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_LightTimePartials + SOURCES "${SRCROOT}${LIGHTTIMECORRECTIONPARTIALSDIR}/UnitTests/unitTestLightTimePartials.cpp" + LINK_LIBRARIES tudat_observation_partials_test_functions + ${TUDAT_ESTIMATION_LIBRARIES} + ${Boost_LIBRARIES}) diff --git a/Tudat/Astrodynamics/OrbitDetermination/RotationalDynamicsPartials/CMakeLists.txt b/Tudat/Astrodynamics/OrbitDetermination/RotationalDynamicsPartials/CMakeLists.txt index 4033f02817..74a4cb5be1 100644 --- a/Tudat/Astrodynamics/OrbitDetermination/RotationalDynamicsPartials/CMakeLists.txt +++ b/Tudat/Astrodynamics/OrbitDetermination/RotationalDynamicsPartials/CMakeLists.txt @@ -29,13 +29,12 @@ set(TORQUE_PARTIALS_HEADERS add_library(tudat_torque_partials STATIC ${TORQUE_PARTIALS_SOURCES} ${TORQUE_PARTIALS_HEADERS}) setup_tudat_library_target(tudat_torque_partials "${SRCROOT}{TORQUEPARTIALSDIR}") +# Add unit tests if(USE_CSPICE) - - # Add unit tests - add_executable(test_TorquePartials "${SRCROOT}${TORQUEPARTIALSDIR}/UnitTests/unitTestTorquePartials.cpp") - setup_custom_test_program(test_TorquePartials "${SRCROOT}${TORQUEPARTIALSDIR}") - target_link_libraries(test_TorquePartials ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - + tudat_add_test( + TARGET test_TorquePartials + SOURCES "${SRCROOT}${TORQUEPARTIALSDIR}/UnitTests/unitTestTorquePartials.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) endif( ) diff --git a/Tudat/Astrodynamics/Propagators/CMakeLists.txt b/Tudat/Astrodynamics/Propagators/CMakeLists.txt index 58438241d1..51cce3589f 100644 --- a/Tudat/Astrodynamics/Propagators/CMakeLists.txt +++ b/Tudat/Astrodynamics/Propagators/CMakeLists.txt @@ -69,128 +69,176 @@ setup_tudat_library_target(tudat_propagators "${SRCROOT}${PROPAGATORSDIR}") include(tudatLinkLibraries) # Add unit tests. -add_executable(test_CentralBodyData "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestCentralBodyData.cpp") -setup_custom_test_program(test_CentralBodyData "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_CentralBodyData tudat_propagators tudat_basic_mathematics ${Boost_LIBRARIES}) +set(PROPAGATORS_TEST_DIR "${SRCROOT}${PROPAGATORSDIR}/UnitTests") -if(USE_CSPICE) - -if( BUILD_WITH_PROPAGATION_TESTS ) - -add_executable(test_CowellStateDerivative "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestCowellStateDerivative.cpp") -setup_custom_test_program(test_CowellStateDerivative "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_CowellStateDerivative ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_EnckeStateDerivative "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestEnckeStateDerivative.cpp") -setup_custom_test_program(test_EnckeStateDerivative "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_EnckeStateDerivative ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_GaussStateDerivative "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestGaussStateDerivative.cpp") -setup_custom_test_program(test_GaussStateDerivative "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_GaussStateDerivative ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_UnifiedStateModelStateDerivative "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestUnifiedStateModelStateDerivative.cpp") -setup_custom_test_program(test_UnifiedStateModelStateDerivative "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_UnifiedStateModelStateDerivative ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -if( BUILD_WITH_ESTIMATION_TOOLS ) -add_executable(test_SequentialVariationEquationIntegration "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestSequentialVariationalEquationIntegration.cpp") -setup_custom_test_program(test_SequentialVariationEquationIntegration "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_SequentialVariationEquationIntegration ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_VariationalEquations "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestVariationalEquationPropagation.cpp") -setup_custom_test_program(test_VariationalEquations "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_VariationalEquations ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_MultiArcVariationalEquations "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestMultiArcVariationalEquationPropagation.cpp") -setup_custom_test_program(test_MultiArcVariationalEquations "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_MultiArcVariationalEquations ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_HybridArcVariationalEquations "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestHybridArcVariationalEquationPropagation.cpp") -setup_custom_test_program(test_HybridArcVariationalEquations "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_HybridArcVariationalEquations ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - - -add_executable(test_DependentVariableOutput "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestDependentVariableOutput.cpp") -setup_custom_test_program(test_DependentVariableOutput "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_DependentVariableOutput ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) - -endif( ) - -add_executable(test_EnvironmentModelComputations "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestEnvironmentUpdater.cpp") -setup_custom_test_program(test_EnvironmentModelComputations "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_EnvironmentModelComputations ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_BodyMassPropagation "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestBodyMassPropagation.cpp") -setup_custom_test_program(test_BodyMassPropagation "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_BodyMassPropagation ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_CentralBodyData + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestCentralBodyData.cpp" + LINK_LIBRARIES tudat_propagators tudat_basic_mathematics ${Boost_LIBRARIES}) -add_executable(test_MultiTypeStatePropagation "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestMultiTypeStatePropagation.cpp") -setup_custom_test_program(test_MultiTypeStatePropagation "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_MultiTypeStatePropagation ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_StoppingConditions "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestStoppingConditions.cpp") -setup_custom_test_program(test_StoppingConditions "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_StoppingConditions ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_CustomStatePropagation "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestCustomStatePropagation.cpp") -setup_custom_test_program(test_CustomStatePropagation "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_CustomStatePropagation ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_MultiArcDynamics "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestMultiArcDynamics.cpp") -setup_custom_test_program(test_MultiArcDynamics "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_MultiArcDynamics ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_HybridArcDynamics "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestHybridArcDynamics.cpp") -setup_custom_test_program(test_HybridArcDynamics "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_HybridArcDynamics ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_PropagationTerminationReason "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestPropagationTerminationReason.cpp") -setup_custom_test_program(test_PropagationTerminationReason "${SRCROOT}${PROPAGATORSDIR}/") -target_link_libraries(test_PropagationTerminationReason ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_RotationalDynamicsPropagation "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestRotationalDynamicsPropagator.cpp") -setup_custom_test_program(test_RotationalDynamicsPropagation "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_RotationalDynamicsPropagation ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_CR3BPPropagation "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestCR3BPPropagation.cpp") -setup_custom_test_program(test_CR3BPPropagation "${SRCROOT}${PROPAGATORSDIR}/") -target_link_libraries(test_CR3BPPropagation ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_PropagationTerminationCheckOnFinalStep "${SRCROOT}${PROPAGATORSDIR}/UnitTests/uniTestPropagationTerminationCheckOnFinalStep.cpp") -setup_custom_test_program(test_PropagationTerminationCheckOnFinalStep "${SRCROOT}${PROPAGATORSDIR}/") -target_link_libraries(test_PropagationTerminationCheckOnFinalStep ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_GlobalFrameOrigin "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestGlobalFrameOrigin.cpp") -setup_custom_test_program(test_GlobalFrameOrigin "${SRCROOT}${PROPAGATORSDIR}/") -target_link_libraries(test_GlobalFrameOrigin ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_ForwardBackwardIntegration "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestForwardsBackwardsIntegration.cpp") -setup_custom_test_program(test_ForwardBackwardIntegration "${SRCROOT}${PROPAGATORSDIR}/") -target_link_libraries(test_ForwardBackwardIntegration ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_ExactTermination "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestExactTermination.cpp") -setup_custom_test_program(test_ExactTermination "${SRCROOT}${PROPAGATORSDIR}/") -target_link_libraries(test_ExactTermination ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) +if(USE_CSPICE) -endif( ) + if( BUILD_WITH_PROPAGATION_TESTS ) + + tudat_add_test( + TARGET test_CowellStateDerivative + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestCowellStateDerivative.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_EnckeStateDerivative + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestEnckeStateDerivative.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_GaussStateDerivative + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestGaussStateDerivative.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_UnifiedStateModelStateDerivative + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestUnifiedStateModelStateDerivative.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + if( BUILD_WITH_ESTIMATION_TOOLS ) + + tudat_add_test( + TARGET test_SequentialVariationEquationIntegration + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestSequentialVariationalEquationIntegration.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_VariationalEquations + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestVariationalEquationPropagation.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_MultiArcVariationalEquations + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestMultiArcVariationalEquationPropagation.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_HybridArcVariationalEquations + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestHybridArcVariationalEquationPropagation.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_DependentVariableOutput + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestDependentVariableOutput.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) + + endif( ) + + tudat_add_test( + TARGET test_EnvironmentModelComputations + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestEnvironmentUpdater.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_BodyMassPropagation + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestBodyMassPropagation.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_MultiTypeStatePropagation + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestMultiTypeStatePropagation.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_StoppingConditions + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestStoppingConditions.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_CustomStatePropagation + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestCustomStatePropagation.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_MultiArcDynamics + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestMultiArcDynamics.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_HybridArcDynamics + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestHybridArcDynamics.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_PropagationTerminationReason + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestPropagationTerminationReason.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_RotationalDynamicsPropagation + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestRotationalDynamicsPropagator.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_CR3BPPropagation + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestCR3BPPropagation.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_PropagationTerminationCheckOnFinalStep + SOURCES "${PROPAGATORS_TEST_DIR}/uniTestPropagationTerminationCheckOnFinalStep.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_GlobalFrameOrigin + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestGlobalFrameOrigin.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_ForwardBackwardIntegration + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestForwardsBackwardsIntegration.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_ExactTermination + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestExactTermination.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + endif( ) endif( ) -add_executable(test_StateDerivativeRestrictedThreeBodyProblem "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestStateDerivativeCircularRestrictedThreeBodyProblem.cpp") -setup_custom_test_program(test_StateDerivativeRestrictedThreeBodyProblem "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_StateDerivativeRestrictedThreeBodyProblem tudat_mission_segments tudat_root_finders tudat_propagators tudat_numerical_integrators tudat_basic_astrodynamics tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_FullPropagationRestrictedThreeBodyProblem "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestFullPropagationCircularRestrictedThreeBodyProblem.cpp") -setup_custom_test_program(test_FullPropagationRestrictedThreeBodyProblem "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_FullPropagationRestrictedThreeBodyProblem ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_FullPropagationLambertTargeter "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestFullPropagationLambertTargeter.cpp") -setup_custom_test_program(test_FullPropagationLambertTargeter "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_FullPropagationLambertTargeter tudat_trajectory_design tudat_mission_segments tudat_ephemerides tudat_basic_astrodynamics tudat_basic_mathematics ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - -add_executable(test_FullPropagationPatchedConicsTrajectory "${SRCROOT}${PROPAGATORSDIR}/UnitTests/unitTestFullPropagationPatchedConicsTrajectory.cpp") -setup_custom_test_program(test_FullPropagationPatchedConicsTrajectory "${SRCROOT}${PROPAGATORSDIR}") -target_link_libraries(test_FullPropagationPatchedConicsTrajectory tudat_trajectory_design tudat_mission_segments tudat_ephemerides tudat_basic_astrodynamics tudat_basic_mathematics ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_StateDerivativeRestrictedThreeBodyProblem + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestStateDerivativeCircularRestrictedThreeBodyProblem.cpp" + LINK_LIBRARIES tudat_mission_segments + tudat_root_finders + tudat_propagators + tudat_numerical_integrators + tudat_basic_astrodynamics + tudat_input_output + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_FullPropagationRestrictedThreeBodyProblem + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestFullPropagationCircularRestrictedThreeBodyProblem.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_FullPropagationLambertTargeter + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestFullPropagationLambertTargeter.cpp" + LINK_LIBRARIES tudat_trajectory_design + tudat_mission_segments + tudat_ephemerides + tudat_basic_astrodynamics + tudat_basic_mathematics + ${TUDAT_PROPAGATION_LIBRARIES} + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_FullPropagationPatchedConicsTrajectory + SOURCES "${PROPAGATORS_TEST_DIR}/unitTestFullPropagationPatchedConicsTrajectory.cpp" + LINK_LIBRARIES tudat_trajectory_design + tudat_mission_segments + tudat_ephemerides + tudat_basic_astrodynamics + tudat_basic_mathematics + ${TUDAT_PROPAGATION_LIBRARIES} + ${Boost_LIBRARIES}) diff --git a/Tudat/Astrodynamics/Propulsion/CMakeLists.txt b/Tudat/Astrodynamics/Propulsion/CMakeLists.txt index bbf765af40..eec21daa3a 100755 --- a/Tudat/Astrodynamics/Propulsion/CMakeLists.txt +++ b/Tudat/Astrodynamics/Propulsion/CMakeLists.txt @@ -30,6 +30,8 @@ set(PROPULSION_HEADERS add_library(tudat_propulsion STATIC ${PROPULSION_SOURCES} ${PROPULSION_HEADERS}) setup_tudat_library_target(tudat_propulsion "${SRCROOT}${PROPULSIONDIR}") -add_executable(test_ThrustAcceleration "${SRCROOT}${PROPULSIONDIR}/UnitTests/unitTestThrustAcceleration.cpp") -setup_custom_test_program(test_ThrustAcceleration "${SRCROOT}${PROPULSIONDIR}") -target_link_libraries(test_ThrustAcceleration ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) +# Add unit tests. +tudat_add_test( + TARGET test_ThrustAcceleration + SOURCES "${SRCROOT}${PROPULSIONDIR}/UnitTests/unitTestThrustAcceleration.cpp" + LINK_LIBRARIES ${TUDAT_ESTIMATION_LIBRARIES} ${Boost_LIBRARIES}) diff --git a/Tudat/Astrodynamics/ReferenceFrames/CMakeLists.txt b/Tudat/Astrodynamics/ReferenceFrames/CMakeLists.txt index 0ac120ec6d..3389072f1a 100755 --- a/Tudat/Astrodynamics/ReferenceFrames/CMakeLists.txt +++ b/Tudat/Astrodynamics/ReferenceFrames/CMakeLists.txt @@ -16,7 +16,7 @@ set(REFERENCEFRAMES_SOURCES ) # Add header files. -set(REFERENCEFRAMES_HEADERS +set(REFERENCEFRAMES_HEADERS "${SRCROOT}${REFERENCEFRAMESDIR}/referenceFrameTransformations.h" "${SRCROOT}${REFERENCEFRAMESDIR}/apparentAccelerationModel.h" "${SRCROOT}${REFERENCEFRAMESDIR}/aerodynamicAngleCalculator.h" @@ -28,15 +28,34 @@ add_library(tudat_reference_frames STATIC ${REFERENCEFRAMES_SOURCES} ${REFERENCE setup_tudat_library_target(tudat_reference_frames "${SRCROOT}${REFERENCEFRAMESDIR}") # Add unit tests. -add_executable(test_ReferenceFrameTransformations "${SRCROOT}${REFERENCEFRAMESDIR}/UnitTests/unitTestReferenceFrameTransformations.cpp") -setup_custom_test_program(test_ReferenceFrameTransformations "${SRCROOT}${REFERENCEFRAMESDIR}") -target_link_libraries(test_ReferenceFrameTransformations tudat_reference_frames ${Boost_LIBRARIES}) +set(REFFRAME_TEST_DIR "${SRCROOT}${REFERENCEFRAMESDIR}/UnitTests") -add_executable(test_ApparentAccelerationModel "${SRCROOT}${REFERENCEFRAMESDIR}/UnitTests/unitTestApparentAccelerationModel.cpp") -setup_custom_test_program(test_ApparentAccelerationModel "${SRCROOT}${REFERENCEFRAMESDIR}") -target_link_libraries(test_ApparentAccelerationModel tudat_reference_frames tudat_basic_astrodynamics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_ReferenceFrameTransformations + SOURCES "${REFFRAME_TEST_DIR}/unitTestReferenceFrameTransformations.cpp" + LINK_LIBRARIES tudat_reference_frames ${Boost_LIBRARIES}) -add_executable(test_AerodynamicAngleCalculator "${SRCROOT}${REFERENCEFRAMESDIR}/UnitTests/unitTestAerodynamicAngleCalculator.cpp") -setup_custom_test_program(test_AerodynamicAngleCalculator "${SRCROOT}${REFERENCEFRAMESDIR}") -target_link_libraries(test_AerodynamicAngleCalculator tudat_environment_setup tudat_propagators tudat_aerodynamics tudat_geometric_shapes tudat_gravitation tudat_electro_magnetism tudat_propulsion tudat_ephemerides tudat_numerical_integrators tudat_reference_frames tudat_basic_astrodynamics tudat_input_output tudat_basic_mathematics tudat_spice_interface cspice ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_ApparentAccelerationModel + SOURCES "${REFFRAME_TEST_DIR}/unitTestApparentAccelerationModel.cpp" + LINK_LIBRARIES tudat_reference_frames tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_AerodynamicAngleCalculator + SOURCES "${REFFRAME_TEST_DIR}/unitTestAerodynamicAngleCalculator.cpp" + LINK_LIBRARIES tudat_environment_setup + tudat_propagators + tudat_aerodynamics + tudat_geometric_shapes + tudat_gravitation + tudat_electro_magnetism + tudat_propulsion + tudat_ephemerides + tudat_numerical_integrators + tudat_reference_frames + tudat_basic_astrodynamics + tudat_input_output + tudat_basic_mathematics + tudat_spice_interface cspice + ${Boost_LIBRARIES}) diff --git a/Tudat/Astrodynamics/Relativity/CMakeLists.txt b/Tudat/Astrodynamics/Relativity/CMakeLists.txt index 4c2e9887a9..8bc34b4185 100644 --- a/Tudat/Astrodynamics/Relativity/CMakeLists.txt +++ b/Tudat/Astrodynamics/Relativity/CMakeLists.txt @@ -17,7 +17,7 @@ set(RELATIVITY_SOURCES ) # Set the header files. -set(RELATIVITY_HEADERS +set(RELATIVITY_HEADERS "${SRCROOT}${RELATIVITYDIR}/relativisticLightTimeCorrection.h" "${SRCROOT}${RELATIVITYDIR}/relativisticAccelerationCorrection.h" "${SRCROOT}${RELATIVITYDIR}/relativisticTimeConversion.h" @@ -28,19 +28,22 @@ set(RELATIVITY_HEADERS add_library(tudat_relativity STATIC ${RELATIVITY_SOURCES} ${RELATIVITY_HEADERS}) setup_tudat_library_target(tudat_relativity "${SRCROOT}${RELATIVITYDIR}") +# Add unit tests. +set(EINSTEIN_TEST_DIR "${SRCROOT}${RELATIVITYDIR}/UnitTests") if( BUILD_WITH_ESTIMATION_TOOLS ) - -# Add unit tests -add_executable(test_ShapiroTimeDelay "${SRCROOT}${RELATIVITYDIR}/UnitTests/unitTestShapiroTimeDelay.cpp") -setup_custom_test_program(test_ShapiroTimeDelay "${SRCROOT}${RELATIVITYDIR}") -target_link_libraries(test_ShapiroTimeDelay tudat_relativity tudat_gravitation tudat_observation_models tudat_ephemerides ${Boost_LIBRARIES}) - + tudat_add_test( + TARGET test_ShapiroTimeDelay + SOURCES "${EINSTEIN_TEST_DIR}/unitTestShapiroTimeDelay.cpp" + LINK_LIBRARIES tudat_relativity + tudat_gravitation + tudat_observation_models + tudat_ephemerides + ${Boost_LIBRARIES}) endif( ) if( BUILD_WITH_PROPAGATION_TESTS ) - -add_executable(test_RelativisticAccelerationCorrection "${SRCROOT}${RELATIVITYDIR}/UnitTests/unitTestRelativisticAccelerationCorrection.cpp") -setup_custom_test_program(test_RelativisticAccelerationCorrection "${SRCROOT}${RELATIVITYDIR}") -target_link_libraries(test_RelativisticAccelerationCorrection ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - + tudat_add_test( + TARGET test_RelativisticAccelerationCorrection + SOURCES "${EINSTEIN_TEST_DIR}/unitTestRelativisticAccelerationCorrection.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) endif( ) diff --git a/Tudat/Astrodynamics/TrajectoryDesign/CMakeLists.txt b/Tudat/Astrodynamics/TrajectoryDesign/CMakeLists.txt index d51caa33a3..8723cd9920 100644 --- a/Tudat/Astrodynamics/TrajectoryDesign/CMakeLists.txt +++ b/Tudat/Astrodynamics/TrajectoryDesign/CMakeLists.txt @@ -20,14 +20,6 @@ macro(setup_library_target target_name CUSTOM_OUTPUT_PATH) install(TARGETS ${target_name} LIBRARY DESTINATION "${BINROOT}" ARCHIVE DESTINATION "${LIBROOT}") endmacro(setup_library_target) -macro(setup_unit_test_executable_target target_name CUSTOM_OUTPUT_PATH) - if (NOT TUDAT_DISABLE_TESTS) - set_property(TARGET ${target_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY "${BINROOT}/unit_tests") - get_property(CUSTOM_TEST_PROGRAM_NAME TARGET ${target_name} PROPERTY OUTPUT_NAME) - add_test("${target_name}" "${BINROOT}/unit_tests/${target_name}") - endif() -endmacro(setup_unit_test_executable_target) - # Set the source files. set(SPACETRAJECTORIES_SOURCES "${SRCROOT}${TRAJECTORYDIR}/captureLeg.cpp" @@ -43,7 +35,7 @@ set(SPACETRAJECTORIES_SOURCES ) # Set the header files. -set(SPACETRAJECTORIES_HEADERS +set(SPACETRAJECTORIES_HEADERS "${SRCROOT}${TRAJECTORYDIR}/captureLeg.h" "${SRCROOT}${TRAJECTORYDIR}/departureLeg.h" "${SRCROOT}${TRAJECTORYDIR}/departureLegMga.h" @@ -65,41 +57,70 @@ add_library(tudat_trajectory_design STATIC ${SPACETRAJECTORIES_SOURCES} ${SPACET setup_tudat_library_target(tudat_trajectory_design "${SRCROOT}${TRAJECTORYDIR}") # Add unit tests. -add_executable(test_CaptureLeg "${SRCROOT}${TRAJECTORYDIR}/UnitTests/unitTestCaptureLeg.cpp") -setup_unit_test_executable_target(test_CaptureLeg "${SRCROOT}${TRAJECTORYDIR}") -target_link_libraries(test_CaptureLeg tudat_trajectory_design tudat_mission_segments tudat_basic_mathematics ${Boost_LIBRARIES}) +set(TRAJDES_TEST_DIR "${SRCROOT}${TRAJECTORYDIR}/UnitTests") -# Add unit tests. -add_executable(test_DepartureLegMga "${SRCROOT}${TRAJECTORYDIR}/UnitTests/unitTestDepartureLegMga.cpp") -setup_unit_test_executable_target(test_DepartureLegMga "${SRCROOT}${TRAJECTORYDIR}") -target_link_libraries(test_DepartureLegMga tudat_trajectory_design tudat_mission_segments tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_CaptureLeg + SOURCES "${TRAJDES_TEST_DIR}/unitTestCaptureLeg.cpp" + LINK_LIBRARIES tudat_trajectory_design + tudat_mission_segments + tudat_basic_mathematics + ${Boost_LIBRARIES}) -# Add unit tests. -add_executable(test_DepartureLegMga1DsmPosition "${SRCROOT}${TRAJECTORYDIR}/UnitTests/unitTestDepartureLegMga1DsmPosition.cpp") -setup_unit_test_executable_target(test_DepartureLegMga1DsmPosition "${SRCROOT}${TRAJECTORYDIR}") -target_link_libraries(test_DepartureLegMga1DsmPosition tudat_trajectory_design tudat_mission_segments tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_DepartureLegMga + SOURCES "${TRAJDES_TEST_DIR}/unitTestDepartureLegMga.cpp" + LINK_LIBRARIES tudat_trajectory_design + tudat_mission_segments + tudat_basic_mathematics + ${Boost_LIBRARIES}) -# Add unit tests. -add_executable(test_DepartureLegMga1DsmVelocity "${SRCROOT}${TRAJECTORYDIR}/UnitTests/unitTestDepartureLegMga1DsmVelocity.cpp") -setup_unit_test_executable_target(test_DepartureLegMga1DsmVelocity "${SRCROOT}${TRAJECTORYDIR}") -target_link_libraries(test_DepartureLegMga1DsmVelocity tudat_trajectory_design tudat_mission_segments tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_DepartureLegMga1DsmPosition + SOURCES "${TRAJDES_TEST_DIR}/unitTestDepartureLegMga1DsmPosition.cpp" + LINK_LIBRARIES tudat_trajectory_design + tudat_mission_segments + tudat_basic_mathematics + ${Boost_LIBRARIES}) -# Add unit tests. -add_executable(test_SwingbyLegMga "${SRCROOT}${TRAJECTORYDIR}/UnitTests/unitTestSwingbyLegMga.cpp") -setup_unit_test_executable_target(test_SwingbyLegMga "${SRCROOT}${TRAJECTORYDIR}") -target_link_libraries(test_SwingbyLegMga tudat_trajectory_design tudat_mission_segments tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_DepartureLegMga1DsmVelocity + SOURCES "${TRAJDES_TEST_DIR}/unitTestDepartureLegMga1DsmVelocity.cpp" + LINK_LIBRARIES tudat_trajectory_design + tudat_mission_segments + tudat_basic_mathematics + ${Boost_LIBRARIES}) -# Add unit tests. -add_executable(test_SwingbyLegMga1DsmPosition "${SRCROOT}${TRAJECTORYDIR}/UnitTests/unitTestSwingbyLegMga1DsmPosition.cpp") -setup_unit_test_executable_target(test_SwingbyLegMga1DsmPosition "${SRCROOT}${TRAJECTORYDIR}") -target_link_libraries(test_SwingbyLegMga1DsmPosition tudat_trajectory_design tudat_mission_segments tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_SwingbyLegMga + SOURCES "${TRAJDES_TEST_DIR}/unitTestSwingbyLegMga.cpp" + LINK_LIBRARIES tudat_trajectory_design + tudat_mission_segments + tudat_basic_mathematics + ${Boost_LIBRARIES}) -# Add unit tests. -add_executable(test_SwingbyLegMga1DsmVelocity "${SRCROOT}${TRAJECTORYDIR}/UnitTests/unitTestSwingbyLegMga1DsmVelocity.cpp") -setup_unit_test_executable_target(test_SwingbyLegMga1DsmVelocity "${SRCROOT}${TRAJECTORYDIR}") -target_link_libraries(test_SwingbyLegMga1DsmVelocity tudat_trajectory_design tudat_mission_segments tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_SwingbyLegMga1DsmPosition + SOURCES "${TRAJDES_TEST_DIR}/unitTestSwingbyLegMga1DsmPosition.cpp" + LINK_LIBRARIES tudat_trajectory_design + tudat_mission_segments + tudat_basic_mathematics + ${Boost_LIBRARIES}) -# Add unit tests. -add_executable(test_Trajectory "${SRCROOT}${TRAJECTORYDIR}/UnitTests/unitTestTrajectory.cpp") -setup_unit_test_executable_target(test_Trajectory "${SRCROOT}${TRAJECTORYDIR}") -target_link_libraries(test_Trajectory tudat_trajectory_design tudat_mission_segments tudat_ephemerides tudat_basic_astrodynamics tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_SwingbyLegMga1DsmVelocity + SOURCES "${TRAJDES_TEST_DIR}/unitTestSwingbyLegMga1DsmVelocity.cpp" + LINK_LIBRARIES tudat_trajectory_design + tudat_mission_segments + tudat_basic_mathematics + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_Trajectory + SOURCES "${TRAJDES_TEST_DIR}/unitTestTrajectory.cpp" + LINK_LIBRARIES tudat_trajectory_design + tudat_mission_segments + tudat_ephemerides + tudat_basic_astrodynamics + tudat_basic_mathematics + ${Boost_LIBRARIES}) diff --git a/Tudat/Basics/CMakeLists.txt b/Tudat/Basics/CMakeLists.txt index 67b460d05f..2be60e89cc 100644 --- a/Tudat/Basics/CMakeLists.txt +++ b/Tudat/Basics/CMakeLists.txt @@ -14,7 +14,7 @@ set(BASICSDIR_SOURCES ) # Add header files. -set(BASICSDIR_HEADERS +set(BASICSDIR_HEADERS "${SRCROOT}${BASICSDIR}/utilities.h" "${SRCROOT}${BASICSDIR}/testMacros.h" "${SRCROOT}${BASICSDIR}/utilityMacros.h" @@ -34,12 +34,15 @@ set(BASICSDIR_UNITTESTS add_library(tudat_basics STATIC ${BASICSDIR_SOURCES} ${BASICSDIR_HEADERS}) setup_tudat_library_target(tudat_basics "${SRCROOT}${BASICSDIR}") -add_executable(test_TimeTypes "${SRCROOT}${BASICSDIR}/UnitTests/unitTestTimeTypes.cpp") -setup_custom_test_program(test_TimeTypes "${SRCROOT}${BASICSDIR}") -target_link_libraries(test_TimeTypes ${Boost_LIBRARIES}) +# Add unit tests. +set(BASICS_TEST_DIR "${SRCROOT}${BASICSDIR}/UnitTests") +tudat_add_test( + TARGET test_TimeTypes + SOURCES "${BASICS_TEST_DIR}/unitTestTimeTypes.cpp" + LINK_LIBRARIES ${Boost_LIBRARIES}) -add_executable(test_TudatTypeTraits "${SRCROOT}${BASICSDIR}/UnitTests/unitTestTudatTypeTraits.cpp") -setup_custom_test_program(test_TudatTypeTraits "${SRCROOT}${BASICSDIR}") -target_link_libraries(test_TudatTypeTraits tudat_basics ${Boost_LIBRARIES}) - +tudat_add_test( + TARGET test_TudatTypeTraits + SOURCES "${BASICS_TEST_DIR}/unitTestTudatTypeTraits.cpp" + LINK_LIBRARIES tudat_basics ${Boost_LIBRARIES}) diff --git a/Tudat/CMakeLists.txt b/Tudat/CMakeLists.txt index aac87a45bb..e60c6c3b22 100755 --- a/Tudat/CMakeLists.txt +++ b/Tudat/CMakeLists.txt @@ -23,6 +23,7 @@ option(BUILD_WITH_PROPAGATION_TESTS "Build Tudat with unit tests involving long option(TUDAT_DISABLE_TESTS "Whether to build Tudat's tests. Useful when including Tudat as a library inside other projects." OFF) + # Load UserSettings.txt if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) set(BUILD_STYLE "standalone") @@ -68,13 +69,16 @@ if (NOT TUDAT_DISABLE_TESTS) enable_testing( ) endif() -# Set the global macros for setting up targets. +# Set global macro for setting up target macro(setup_tudat_library_target target_name CUSTOM_OUTPUT_PATH) set_property(TARGET ${target_name} PROPERTY LIBRARY_OUTPUT_DIRECTORY "${LIBROOT}") set_property(TARGET ${target_name} PROPERTY ARCHIVE_OUTPUT_DIRECTORY "${LIBROOT}") endmacro(setup_tudat_library_target) +# DEPRECATED: Set global macro for setting up tests macro(setup_custom_test_program target_name CUSTOM_OUTPUT_PATH) + message(WARNING "Macro 'setup_custom_test_program' has been deprecated; " + "use 'tudat_add_test' instead.") if (NOT TUDAT_DISABLE_TESTS) set_property(TARGET ${target_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY "${BINROOT}/unit_tests") get_property(CUSTOM_TEST_PROGRAM_NAME TARGET ${target_name} PROPERTY OUTPUT_NAME) @@ -82,6 +86,10 @@ macro(setup_custom_test_program target_name CUSTOM_OUTPUT_PATH) endif() endmacro(setup_custom_test_program) +# DEPRECATED: use global function instead +include(tudatParseFunctionArguments) +include(tudatAddTest) + # Set the main sub-directories. set(ASTRODYNAMICSDIR "/Astrodynamics") set(BASICSDIR "/Basics") diff --git a/Tudat/External/CMake/tudatAddTest.cmake b/Tudat/External/CMake/tudatAddTest.cmake new file mode 100644 index 0000000000..57947b60c7 --- /dev/null +++ b/Tudat/External/CMake/tudatAddTest.cmake @@ -0,0 +1,77 @@ +#============================================================================= +# +# tudat_add_test +# +# This function facilitates defining a standardized tudat unit test +# +# Usage: +# tudat_add_test( +# TARGET +# [ SOURCES ] +# [ LINK_LIBRARIES ] +# [ COMPILE_FLAGS ] +# [ INCLUDES ] +# [ DEPENDS ] +# ) +# +# Input: +# TARGET : test target name +# COMPILE_FLAGS : custom compile flags +# LINK_FLAGS : custom link flags +# LINK_LIBRARIES: libraries to link test with +# SOURCES : source files +# INCLUDES : include directories +# DEPENDS : targets which this test depends on +# +# Output: +# Tudat-standardized test with name matching TARGET. +# +# Example: +# tudat_add_test( +# TARGET +# my_test_application +# SOURCES +# file.cpp +# LINK_LIBRARIES +# ${Boost_LIBRARIES} +# ) +# +function(tudat_add_test) + + if (NOT TUDAT_DISABLE_TESTS) + + tudat_parse_function_args( + NAME tudat_add_test + ONE_VALUE TARGET + MULTI_VALUE SOURCES DEPENDS LINK_LIBRARIES INCLUDES COMPILE_FLAGS + REQUIRED TARGET SOURCES + ARGN ${ARGN}) + + add_executable(${TARGET} ${SOURCES}) + + if(DEPENDS) + add_dependencies(${TARGET} ${DEPENDS}) + endif() + + if(LINK_LIBRARIES) + target_link_libraries(${TARGET} ${LINK_LIBRARIES}) + endif() + + if(COMPILE_FLAGS) + target_compile_options(${TARGET} PRIVATE ${COMPILE_FLAGS}) + endif() + + if(INCLUDES) + target_include_directories(${TARGET} PRIVATE ${INCLUDES}) + endif() + + # Tudat paths + set_property(TARGET ${TARGET} PROPERTY RUNTIME_OUTPUT_DIRECTORY "${BINROOT}/unit_tests") + get_property(CUSTOM_TEST_PROGRAM_NAME TARGET ${TARGET} PROPERTY OUTPUT_NAME) + + # Finally, add to CTest + add_test("${TARGET}" "${BINROOT}/unit_tests/${TARGET}") + + endif() + +endfunction() diff --git a/Tudat/External/CMake/tudatParseFunctionArguments.cmake b/Tudat/External/CMake/tudatParseFunctionArguments.cmake new file mode 100644 index 0000000000..1ebc4eb464 --- /dev/null +++ b/Tudat/External/CMake/tudatParseFunctionArguments.cmake @@ -0,0 +1,69 @@ +#============================================================================= +# +# tudat_parse_function_args +# +# This function simplifies usage of the cmake_parse_arguments module. +# It is intended to be called by other functions. +# +# Usage: +# tudat_parse_function_args( +# NAME +# [ OPTIONS ] +# [ ONE_VALUE ] +# [ MULTI_VALUE ] +# REQUIRED +# ARGN ) +# +# Input: +# NAME : the name of the calling function +# OPTIONS : boolean flags +# ONE_VALUE : single value variables +# MULTI_VALUE: multi value variables +# REQUIRED : required arguments +# ARGN : the function input arguments, typically ${ARGN} +# +# Output: +# The function arguments corresponding to the following are set: +# ${OPTIONS}, ${ONE_VALUE}, ${MULTI_VALUE} +# +# Example: +# function test() +# tudat_parse_function_args( +# NAME NAME +# ONE_VALUE NAME +# MULTI_VALUE LIST +# REQUIRED NAME LIST +# ARGN ${ARGN}) +# message(STATUS "name: ${NAME}") +# message(STATUS "list: ${LIST}") +# endfunction() +# +# test(NAME "hello" LIST a b c) +# +# OUTPUT: +# name: hello +# list: a b c +# +include(CMakeParseArguments) +function(tudat_parse_function_args) + + cmake_parse_arguments(IN "" "NAME" "OPTIONS;ONE_VALUE;MULTI_VALUE;REQUIRED;ARGN" "${ARGN}") + cmake_parse_arguments(OUT "${IN_OPTIONS}" "${IN_ONE_VALUE}" "${IN_MULTI_VALUE}" "${IN_ARGN}") + + if (OUT_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "${IN_NAME}: unparsed ${OUT_UNPARSED_ARGUMENTS}") + endif() + + foreach(arg ${IN_REQUIRED}) + if (NOT OUT_${arg}) + if (NOT "${OUT_${arg}}" STREQUAL "0") + message(FATAL_ERROR "${IN_NAME} requires argument ${arg}\nARGN: ${IN_ARGN}") + endif() + endif() + endforeach() + + foreach(arg ${IN_OPTIONS} ${IN_ONE_VALUE} ${IN_MULTI_VALUE}) + set(${arg} ${OUT_${arg}} PARENT_SCOPE) + endforeach() + +endfunction() diff --git a/Tudat/External/SofaInterface/CMakeLists.txt b/Tudat/External/SofaInterface/CMakeLists.txt index 127f8ccca4..61cbcb4c61 100644 --- a/Tudat/External/SofaInterface/CMakeLists.txt +++ b/Tudat/External/SofaInterface/CMakeLists.txt @@ -26,16 +26,25 @@ set(SOFAINTERFACE_HEADERS add_library(tudat_sofa_interface STATIC ${SOFAINTERFACE_SOURCES} ${SOFAINTERFACE_HEADERS}) setup_tudat_library_target(tudat_sofa_interface "${SRCROOT}${SOFAINTERFACEDIR}") -add_executable(test_SofaEarthOrientation "${SRCROOT}${EXTERNALDIR}/SofaInterface/UnitTests/unitTestSofaEarthOrientationInterface.cpp") -setup_custom_test_program(test_SofaEarthOrientation "${SRCROOT}${EXTERNALDIR}/SofaInterface") -target_link_libraries(test_SofaEarthOrientation tudat_sofa_interface tudat_basic_mathematics sofa ${Boost_LIBRARIES}) - -add_executable(test_SofaFundamentalArguments "${SRCROOT}${EXTERNALDIR}/SofaInterface/UnitTests/unitTestFundamentalArguments.cpp") -setup_custom_test_program(test_SofaFundamentalArguments "${SRCROOT}${EXTERNALDIR}/SofaInterface") -target_link_libraries(test_SofaFundamentalArguments tudat_sofa_interface tudat_basic_astrodynamics sofa ${Boost_LIBRARIES}) - -add_executable(test_SofaTimeConversions "${SRCROOT}${EXTERNALDIR}/SofaInterface/UnitTests/unitTestSofaTimeConversions.cpp") -setup_custom_test_program(test_SofaTimeConversions "${SRCROOT}${EXTERNALDIR}/SofaInterface") -target_link_libraries(test_SofaTimeConversions tudat_basic_astrodynamics tudat_basic_mathematics tudat_sofa_interface sofa ${Boost_LIBRARIES}) +# Add unit tests. +set(SOFAIF_TEST_DIR "${SRCROOT}${EXTERNALDIR}/SofaInterface/UnitTests") + +tudat_add_test( + TARGET test_SofaEarthOrientation + SOURCES "${SOFAIF_TEST_DIR}/unitTestSofaEarthOrientationInterface.cpp" + LINK_LIBRARIES tudat_sofa_interface tudat_basic_mathematics sofa ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_SofaFundamentalArguments + SOURCES "${SOFAIF_TEST_DIR}/unitTestFundamentalArguments.cpp" + LINK_LIBRARIES tudat_sofa_interface tudat_basic_astrodynamics sofa ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_SofaTimeConversions + SOURCES "${SOFAIF_TEST_DIR}/unitTestSofaTimeConversions.cpp" + LINK_LIBRARIES tudat_basic_astrodynamics + tudat_basic_mathematics + tudat_sofa_interface sofa + ${Boost_LIBRARIES}) # End of file. diff --git a/Tudat/External/SpiceInterface/CMakeLists.txt b/Tudat/External/SpiceInterface/CMakeLists.txt index 2fac4880bc..aa80a11e65 100644 --- a/Tudat/External/SpiceInterface/CMakeLists.txt +++ b/Tudat/External/SpiceInterface/CMakeLists.txt @@ -27,6 +27,14 @@ add_library(tudat_spice_interface STATIC ${SPICEINTERFACE_SOURCES} ${SPICEINTERF setup_tudat_library_target(tudat_spice_interface "${SRCROOT}${SPICEINTERFACEDIR}") # Add unit tests. -add_executable(test_SpiceInterface "${SRCROOT}${EXTERNALDIR}/SpiceInterface/UnitTests/unitTestSpiceInterface.cpp") -setup_custom_test_program(test_SpiceInterface "${SRCROOT}${EXTERNALDIR}/SpiceInterface") -target_link_libraries(test_SpiceInterface tudat_ephemerides tudat_basic_mathematics tudat_spice_interface tudat_basic_astrodynamics ${SPICE_LIBRARIES} ${Boost_LIBRARIES}) +set(SPICEIF_TEST_DIR "${SRCROOT}${EXTERNALDIR}/SpiceInterface/UnitTests") + +tudat_add_test( + TARGET test_SpiceInterface + SOURCES "${SPICEIF_TEST_DIR}/unitTestSpiceInterface.cpp" + LINK_LIBRARIES tudat_ephemerides + tudat_basic_mathematics + tudat_spice_interface + tudat_basic_astrodynamics + ${SPICE_LIBRARIES} + ${Boost_LIBRARIES}) diff --git a/Tudat/InputOutput/CMakeLists.txt b/Tudat/InputOutput/CMakeLists.txt index 20bf01fb86..c9ac351cb5 100644 --- a/Tudat/InputOutput/CMakeLists.txt +++ b/Tudat/InputOutput/CMakeLists.txt @@ -32,7 +32,7 @@ set(INPUTOUTPUT_SOURCES ) # Add header files. -set(INPUTOUTPUT_HEADERS +set(INPUTOUTPUT_HEADERS "${SRCROOT}${INPUTOUTPUTDIR}/basicInputOutput.h" "${SRCROOT}${INPUTOUTPUTDIR}/dictionaryComparer.h" "${SRCROOT}${INPUTOUTPUTDIR}/dictionaryEntry.h" @@ -76,74 +76,97 @@ add_library(tudat_input_output STATIC ${INPUTOUTPUT_SOURCES} ${INPUTOUTPUT_HEADE setup_tudat_library_target(tudat_input_output "${SRCROOT}${INPUTOUTPUTDIR}") # Add unit tests. -add_executable(test_MapTextFileReader "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestMapTextFileReader.cpp") -setup_custom_test_program(test_MapTextFileReader "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_MapTextFileReader tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_MatrixTextFileReader "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestMatrixTextFileReader.cpp") -setup_custom_test_program(test_MatrixTextFileReader "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_MatrixTextFileReader tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_StreamFilters "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestStreamFilters.cpp") -setup_custom_test_program(test_StreamFilters "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_StreamFilters tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_BasicInputOutput "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestBasicInputOutput.cpp") -setup_custom_test_program(test_BasicInputOutput "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_BasicInputOutput tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_ParsedDataVectorUtilities "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestParsedDataVectorUtilities.cpp") -setup_custom_test_program(test_ParsedDataVectorUtilities "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_ParsedDataVectorUtilities tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_FieldValue "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestFieldValue.cpp") -setup_custom_test_program(test_FieldValue "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_FieldValue tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_TextParser "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestTextParser.cpp") -setup_custom_test_program(test_TextParser "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_TextParser tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_MissileDatcomReader "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestMissileDatcomReader.cpp") -setup_custom_test_program(test_MissileDatcomReader "${SRCROOT}${INPUTDIR}") -target_link_libraries(test_MissileDatcomReader tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_MissileDatcomData "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestMissileDatcomData.cpp") -setup_custom_test_program(test_MissileDatcomData "${SRCROOT}${INPUTDIR}") -target_link_libraries(test_MissileDatcomData tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_DictionaryInputSystem "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestDictionaryInputSystem.cpp") -setup_custom_test_program(test_DictionaryInputSystem "${SRCROOT}${INPUTDIR}") -target_link_libraries(test_DictionaryInputSystem tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_Extractor "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestExtractor.cpp") -setup_custom_test_program(test_Extractor "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_Extractor tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_FixedWidthParser "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestFixedWidthParser.cpp") -setup_custom_test_program(test_FixedWidthParser "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_FixedWidthParser tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_SeparatedParser "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestSeparatedParser.cpp") -setup_custom_test_program(test_SeparatedParser "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_SeparatedParser tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_LinearFieldTransform "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestLinearFieldTransform.cpp") -setup_custom_test_program(test_LinearFieldTransform "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_LinearFieldTransform tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_SolarActivityData "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestSolarActivityData.cpp") -setup_custom_test_program(test_SolarActivityData "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_SolarActivityData tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_MultiArrayReader "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestMultiArrayReader.cpp") -setup_custom_test_program(test_MultiArrayReader "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_MultiArrayReader tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_MultiArrayWriter "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestMultiArrayWriter.cpp") -setup_custom_test_program(test_MultiArrayWriter "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_MultiArrayWriter tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) - -add_executable(test_AerodynamicCoefficientReader "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests/unitTestAerodynamicCoefficientReader.cpp" ) -setup_custom_test_program(test_AerodynamicCoefficientReader "${SRCROOT}${INPUTOUTPUTDIR}") -target_link_libraries(test_AerodynamicCoefficientReader tudat_input_output tudat_basic_astrodynamics tudat_basics ${Boost_LIBRARIES}) +set(IO_TEST_DIR "${SRCROOT}${INPUTOUTPUTDIR}/UnitTests") + +tudat_add_test( + TARGET test_MapTextFileReader + SOURCES "${IO_TEST_DIR}/unitTestMapTextFileReader.cpp" + LINK_LIBRARIES tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_MatrixTextFileReader + SOURCES "${IO_TEST_DIR}/unitTestMatrixTextFileReader.cpp" + LINK_LIBRARIES tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_StreamFilters + SOURCES "${IO_TEST_DIR}/unitTestStreamFilters.cpp" + LINK_LIBRARIES tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_BasicInputOutput + SOURCES "${IO_TEST_DIR}/unitTestBasicInputOutput.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_ParsedDataVectorUtilities + SOURCES "${IO_TEST_DIR}/unitTestParsedDataVectorUtilities.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_FieldValue + SOURCES "${IO_TEST_DIR}/unitTestFieldValue.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_TextParser + SOURCES "${IO_TEST_DIR}/unitTestTextParser.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_MissileDatcomReader + SOURCES "${IO_TEST_DIR}/unitTestMissileDatcomReader.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_MissileDatcomData + SOURCES "${IO_TEST_DIR}/unitTestMissileDatcomData.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_DictionaryInputSystem + SOURCES "${IO_TEST_DIR}/unitTestDictionaryInputSystem.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_Extractor + SOURCES "${IO_TEST_DIR}/unitTestExtractor.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_FixedWidthParser + SOURCES "${IO_TEST_DIR}/unitTestFixedWidthParser.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_SeparatedParser + SOURCES "${IO_TEST_DIR}/unitTestSeparatedParser.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_LinearFieldTransform + SOURCES "${IO_TEST_DIR}/unitTestLinearFieldTransform.cpp" + LINK_LIBRARIES tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_SolarActivityData + SOURCES "${IO_TEST_DIR}/unitTestSolarActivityData.cpp" + LINK_LIBRARIES tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_MultiArrayReader + SOURCES "${IO_TEST_DIR}/unitTestMultiArrayReader.cpp" + LINK_LIBRARIES tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_MultiArrayWriter + SOURCES "${IO_TEST_DIR}/unitTestMultiArrayWriter.cpp" + LINK_LIBRARIES tudat_input_output tudat_basic_astrodynamics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_AerodynamicCoefficientReader + SOURCES "${IO_TEST_DIR}/unitTestAerodynamicCoefficientReader.cpp" + LINK_LIBRARIES tudat_input_output + tudat_basic_astrodynamics + tudat_basics + ${Boost_LIBRARIES}) diff --git a/Tudat/JsonInterface/CMakeLists.txt b/Tudat/JsonInterface/CMakeLists.txt index 331a937626..fc8499e5bf 100644 --- a/Tudat/JsonInterface/CMakeLists.txt +++ b/Tudat/JsonInterface/CMakeLists.txt @@ -119,175 +119,210 @@ setup_executable_target(json_interface) target_link_libraries(json_interface ${JSON_PROPAGATION_LIBRARIES}) # Add unit tests. - set(JSON_TESTS_DIR "${SRCROOT}${JSONINTERFACEDIR}/UnitTests") # Acceleration -add_executable(test_JsonInterfaceAcceleration "${JSON_TESTS_DIR}/unitTestAcceleration.cpp") -setup_custom_test_program(test_JsonInterfaceAcceleration "") -target_link_libraries(test_JsonInterfaceAcceleration ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceAcceleration + SOURCES "${JSON_TESTS_DIR}/unitTestAcceleration.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Aerodynamics -add_executable(test_JsonInterfaceAerodynamics "${JSON_TESTS_DIR}/unitTestAerodynamics.cpp") -setup_custom_test_program(test_JsonInterfaceAerodynamics "") -target_link_libraries(test_JsonInterfaceAerodynamics ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceAerodynamics + SOURCES "${JSON_TESTS_DIR}/unitTestAerodynamics.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Atmosphere -add_executable(test_JsonInterfaceAtmosphere "${JSON_TESTS_DIR}/unitTestAtmosphere.cpp") -setup_custom_test_program(test_JsonInterfaceAtmosphere "") -target_link_libraries(test_JsonInterfaceAtmosphere ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceAtmosphere + SOURCES "${JSON_TESTS_DIR}/unitTestAtmosphere.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Body -add_executable(test_JsonInterfaceBody "${JSON_TESTS_DIR}/unitTestBody.cpp") -setup_custom_test_program(test_JsonInterfaceBody "") -target_link_libraries(test_JsonInterfaceBody ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceBody + SOURCES "${JSON_TESTS_DIR}/unitTestBody.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Deserialization -add_executable(test_JsonInterfaceDeserialization "${JSON_TESTS_DIR}/unitTestDeserialization.cpp") -setup_custom_test_program(test_JsonInterfaceDeserialization "") -target_link_libraries(test_JsonInterfaceDeserialization ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceDeserialization + SOURCES "${JSON_TESTS_DIR}/unitTestDeserialization.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Ephemeris -add_executable(test_JsonInterfaceEphemeris "${JSON_TESTS_DIR}/unitTestEphemeris.cpp") -setup_custom_test_program(test_JsonInterfaceEphemeris "") -target_link_libraries(test_JsonInterfaceEphemeris ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceEphemeris + SOURCES "${JSON_TESTS_DIR}/unitTestEphemeris.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Export -add_executable(test_JsonInterfaceExport "${JSON_TESTS_DIR}/unitTestExport.cpp") -setup_custom_test_program(test_JsonInterfaceExport "") -target_link_libraries(test_JsonInterfaceExport ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceExport + SOURCES "${JSON_TESTS_DIR}/unitTestExport.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # GravityField -add_executable(test_JsonInterfaceGravityField "${JSON_TESTS_DIR}/unitTestGravityField.cpp") -setup_custom_test_program(test_JsonInterfaceGravityField "") -target_link_libraries(test_JsonInterfaceGravityField ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceGravityField + SOURCES "${JSON_TESTS_DIR}/unitTestGravityField.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # GravityFieldVariation -add_executable(test_JsonInterfaceGravityFieldVariation "${JSON_TESTS_DIR}/unitTestGravityFieldVariation.cpp") -setup_custom_test_program(test_JsonInterfaceGravityFieldVariation "") -target_link_libraries(test_JsonInterfaceGravityFieldVariation ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceGravityFieldVariation + SOURCES "${JSON_TESTS_DIR}/unitTestGravityFieldVariation.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # GroundStation -add_executable(test_JsonInterfaceGroundStation "${JSON_TESTS_DIR}/unitTestGroundStation.cpp") -setup_custom_test_program(test_JsonInterfaceGroundStation "") -target_link_libraries(test_JsonInterfaceGroundStation ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceGroundStation + SOURCES "${JSON_TESTS_DIR}/unitTestGroundStation.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Integrator -add_executable(test_JsonInterfaceIntegrator "${JSON_TESTS_DIR}/unitTestIntegrator.cpp") -setup_custom_test_program(test_JsonInterfaceIntegrator "") -target_link_libraries(test_JsonInterfaceIntegrator ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceIntegrator + SOURCES "${JSON_TESTS_DIR}/unitTestIntegrator.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Interpolation -add_executable(test_JsonInterfaceInterpolation "${JSON_TESTS_DIR}/unitTestInterpolation.cpp") -setup_custom_test_program(test_JsonInterfaceInterpolation "") -target_link_libraries(test_JsonInterfaceInterpolation ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceInterpolation + SOURCES "${JSON_TESTS_DIR}/unitTestInterpolation.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # MassRateModel -add_executable(test_JsonInterfaceMassRateModel "${JSON_TESTS_DIR}/unitTestMassRateModel.cpp") -setup_custom_test_program(test_JsonInterfaceMassRateModel "") -target_link_libraries(test_JsonInterfaceMassRateModel ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceMassRateModel + SOURCES "${JSON_TESTS_DIR}/unitTestMassRateModel.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Propagator -add_executable(test_JsonInterfacePropagator "${JSON_TESTS_DIR}/unitTestPropagator.cpp") -setup_custom_test_program(test_JsonInterfacePropagator "") -target_link_libraries(test_JsonInterfacePropagator ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfacePropagator + SOURCES "${JSON_TESTS_DIR}/unitTestPropagator.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # RadiationPressure -add_executable(test_JsonInterfaceRadiationPressure "${JSON_TESTS_DIR}/unitTestRadiationPressure.cpp") -setup_custom_test_program(test_JsonInterfaceRadiationPressure "") -target_link_libraries(test_JsonInterfaceRadiationPressure ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceRadiationPressure + SOURCES "${JSON_TESTS_DIR}/unitTestRadiationPressure.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # ReferenceFrames -add_executable(test_JsonInterfaceReferenceFrames "${JSON_TESTS_DIR}/unitTestReferenceFrames.cpp") -setup_custom_test_program(test_JsonInterfaceReferenceFrames "") -target_link_libraries(test_JsonInterfaceReferenceFrames ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceReferenceFrames + SOURCES "${JSON_TESTS_DIR}/unitTestReferenceFrames.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # RotationModel -add_executable(test_JsonInterfaceRotationModel "${JSON_TESTS_DIR}/unitTestRotationModel.cpp") -setup_custom_test_program(test_JsonInterfaceRotationModel "") -target_link_libraries(test_JsonInterfaceRotationModel ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceRotationModel + SOURCES "${JSON_TESTS_DIR}/unitTestRotationModel.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # ShapeModel -add_executable(test_JsonInterfaceShapeModel "${JSON_TESTS_DIR}/unitTestShapeModel.cpp") -setup_custom_test_program(test_JsonInterfaceShapeModel "") -target_link_libraries(test_JsonInterfaceShapeModel ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceShapeModel + SOURCES "${JSON_TESTS_DIR}/unitTestShapeModel.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # SimulationSingleSatellite -add_executable(test_JsonInterfaceSimulationSingleSatellite "${JSON_TESTS_DIR}/unitTestSimulationSingleSatellite.cpp") -setup_custom_test_program(test_JsonInterfaceSimulationSingleSatellite "") -target_link_libraries(test_JsonInterfaceSimulationSingleSatellite ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceSimulationSingleSatellite + SOURCES "${JSON_TESTS_DIR}/unitTestSimulationSingleSatellite.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # SimulationSinglePerturbedSatellite -add_executable(test_JsonInterfaceSimulationSinglePerturbedSatellite "${JSON_TESTS_DIR}/unitTestSimulationSinglePerturbedSatellite.cpp") -setup_custom_test_program(test_JsonInterfaceSimulationSinglePerturbedSatellite "") -target_link_libraries(test_JsonInterfaceSimulationSinglePerturbedSatellite ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceSimulationSinglePerturbedSatellite + SOURCES "${JSON_TESTS_DIR}/unitTestSimulationSinglePerturbedSatellite.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # SimulationInnerSolarSystem -add_executable(test_JsonInterfaceSimulationInnerSolarSystem "${JSON_TESTS_DIR}/unitTestSimulationInnerSolarSystem.cpp") -setup_custom_test_program(test_JsonInterfaceSimulationInnerSolarSystem "") -target_link_libraries(test_JsonInterfaceSimulationInnerSolarSystem ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceSimulationInnerSolarSystem + SOURCES "${JSON_TESTS_DIR}/unitTestSimulationInnerSolarSystem.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # SimulationGalileoConstellation -add_executable(test_JsonInterfaceSimulationGalileoConstellation "${JSON_TESTS_DIR}/unitTestSimulationGalileoConstellation.cpp") -setup_custom_test_program(test_JsonInterfaceSimulationGalileoConstellation "") -target_link_libraries(test_JsonInterfaceSimulationGalileoConstellation ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceSimulationGalileoConstellation + SOURCES "${JSON_TESTS_DIR}/unitTestSimulationGalileoConstellation.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # SimulationThrustAlongVelocityVector -add_executable(test_JsonInterfaceSimulationThrustAlongVelocityVector "${JSON_TESTS_DIR}/unitTestSimulationThrustAlongVelocityVector.cpp") -setup_custom_test_program(test_JsonInterfaceSimulationThrustAlongVelocityVector "") -target_link_libraries(test_JsonInterfaceSimulationThrustAlongVelocityVector ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceSimulationThrustAlongVelocityVector + SOURCES "${JSON_TESTS_DIR}/unitTestSimulationThrustAlongVelocityVector.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # SimulationThrustAccelerationFromFile -add_executable(test_JsonInterfaceSimulationThrustAccelerationFromFile "${JSON_TESTS_DIR}/unitTestSimulationThrustAccelerationFromFile.cpp") -setup_custom_test_program(test_JsonInterfaceSimulationThrustAccelerationFromFile "") -target_link_libraries(test_JsonInterfaceSimulationThrustAccelerationFromFile ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceSimulationThrustAccelerationFromFile + SOURCES "${JSON_TESTS_DIR}/unitTestSimulationThrustAccelerationFromFile.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Spice -add_executable(test_JsonInterfaceSpice "${JSON_TESTS_DIR}/unitTestSpice.cpp") -setup_custom_test_program(test_JsonInterfaceSpice "") -target_link_libraries(test_JsonInterfaceSpice ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceSpice + SOURCES "${JSON_TESTS_DIR}/unitTestSpice.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # State -add_executable(test_JsonInterfaceState "${JSON_TESTS_DIR}/unitTestState.cpp") -setup_custom_test_program(test_JsonInterfaceState "") -target_link_libraries(test_JsonInterfaceState ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceState + SOURCES "${JSON_TESTS_DIR}/unitTestState.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Termination -add_executable(test_JsonInterfaceTermination "${JSON_TESTS_DIR}/unitTestTermination.cpp") -setup_custom_test_program(test_JsonInterfaceTermination "") -target_link_libraries(test_JsonInterfaceTermination ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceTermination + SOURCES "${JSON_TESTS_DIR}/unitTestTermination.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Thrust -add_executable(test_JsonInterfaceThrust "${JSON_TESTS_DIR}/unitTestThrust.cpp") -setup_custom_test_program(test_JsonInterfaceThrust "") -target_link_libraries(test_JsonInterfaceThrust ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceThrust + SOURCES "${JSON_TESTS_DIR}/unitTestThrust.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Torque -add_executable(test_JsonInterfaceTorque "${JSON_TESTS_DIR}/unitTestTorque.cpp") -setup_custom_test_program(test_JsonInterfaceTorque "") -target_link_libraries(test_JsonInterfaceTorque ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceTorque + SOURCES "${JSON_TESTS_DIR}/unitTestTorque.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) # Variable -add_executable(test_JsonInterfaceVariable "${JSON_TESTS_DIR}/unitTestVariable.cpp") -setup_custom_test_program(test_JsonInterfaceVariable "") -target_link_libraries(test_JsonInterfaceVariable ${JSON_PROPAGATION_LIBRARIES}) +tudat_add_test( + TARGET test_JsonInterfaceVariable + SOURCES "${JSON_TESTS_DIR}/unitTestVariable.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) if( BUILD_WITH_ESTIMATION_TOOLS ) -add_executable(test_JsonInterfaceObservation "${JSON_TESTS_DIR}/unitTestObservation.cpp") -setup_custom_test_program(test_JsonInterfaceObservation "") -target_link_libraries(test_JsonInterfaceObservation ${JSON_PROPAGATION_LIBRARIES}) -add_executable(test_JsonInterfaceParameter "${JSON_TESTS_DIR}/unitTestParameter.cpp") -setup_custom_test_program(test_JsonInterfaceParameter "") -target_link_libraries(test_JsonInterfaceParameter ${JSON_PROPAGATION_LIBRARIES}) + tudat_add_test( + TARGET test_JsonInterfaceObservation + SOURCES "${JSON_TESTS_DIR}/unitTestObservation.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) + + tudat_add_test( + TARGET test_JsonInterfaceParameter + SOURCES "${JSON_TESTS_DIR}/unitTestParameter.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) + + tudat_add_test( + TARGET test_JsonInterfaceSimulationSingleSatelliteVariational + SOURCES "${JSON_TESTS_DIR}/unitTestSimulationSingleSatelliteVariational.cpp" + LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) -add_executable(test_JsonInterfaceSimulationSingleSatelliteVariational "${JSON_TESTS_DIR}/unitTestSimulationSingleSatelliteVariational.cpp") -setup_custom_test_program(test_JsonInterfaceSimulationSingleSatelliteVariational "") -target_link_libraries(test_JsonInterfaceSimulationSingleSatelliteVariational ${JSON_PROPAGATION_LIBRARIES}) + #tudat_add_test( + # TARGET test_JsonInterfaceSimulationSingleSatelliteEstimation + # SOURCES "${JSON_TESTS_DIR}/unitTestSimulationSingleSatelliteEstimation.cpp" + # LINK_LIBRARIES ${JSON_PROPAGATION_LIBRARIES}) -#add_executable(test_JsonInterfaceSimulationSingleSatelliteEstimation "${JSON_TESTS_DIR}/unitTestSimulationSingleSatelliteEstimation.cpp") -#setup_custom_test_program(test_JsonInterfaceSimulationSingleSatelliteEstimation "") -#target_link_libraries(test_JsonInterfaceSimulationSingleSatelliteEstimation ${JSON_PROPAGATION_LIBRARIES}) endif( ) diff --git a/Tudat/Mathematics/BasicMathematics/CMakeLists.txt b/Tudat/Mathematics/BasicMathematics/CMakeLists.txt index 7f214d8355..42638d829c 100755 --- a/Tudat/Mathematics/BasicMathematics/CMakeLists.txt +++ b/Tudat/Mathematics/BasicMathematics/CMakeLists.txt @@ -49,38 +49,49 @@ add_library(tudat_basic_mathematics STATIC ${BASICMATHEMATICS_SOURCES} ${BASICMA setup_tudat_library_target(tudat_basic_mathematics "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics") # Add unit tests. -add_executable(test_MathematicalConstants "${SRCROOT}${BASICMATHEMATICSDIR}/UnitTests/unitTestMathematicalConstants.cpp") -setup_custom_test_program(test_MathematicalConstants "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics") -target_link_libraries(test_MathematicalConstants tudat_basic_mathematics ${Boost_LIBRARIES}) +set(BASIC_MATHS_TEST_DIR "${SRCROOT}${BASICMATHEMATICSDIR}/UnitTests") -add_executable(test_LinearAlgebra "${SRCROOT}${BASICMATHEMATICSDIR}/UnitTests/unitTestLinearAlgebra.cpp") -setup_custom_test_program(test_LinearAlgebra "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics") -target_link_libraries(test_LinearAlgebra tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_MathematicalConstants + SOURCES "${BASIC_MATHS_TEST_DIR}/unitTestMathematicalConstants.cpp" + LINK_LIBRARIES tudat_basic_mathematics ${Boost_LIBRARIES}) -add_executable(test_CoordinateConversions "${SRCROOT}${BASICMATHEMATICSDIR}/UnitTests/unitTestCoordinateConversions.cpp") -setup_custom_test_program(test_CoordinateConversions "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics") -target_link_libraries(test_CoordinateConversions tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_LinearAlgebra + SOURCES "${BASIC_MATHS_TEST_DIR}/unitTestLinearAlgebra.cpp" + LINK_LIBRARIES tudat_basic_mathematics ${Boost_LIBRARIES}) -add_executable(test_NearestNeighbourSearch "${SRCROOT}${BASICMATHEMATICSDIR}/UnitTests/unitTestNearestNeighbourSearch.cpp") -setup_custom_test_program(test_NearestNeighbourSearch "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics") -target_link_libraries(test_NearestNeighbourSearch tudat_input_output tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_CoordinateConversions + SOURCES "${BASIC_MATHS_TEST_DIR}/unitTestCoordinateConversions.cpp" + LINK_LIBRARIES tudat_basic_mathematics ${Boost_LIBRARIES}) -add_executable(test_NumericalDerivative "${SRCROOT}${BASICMATHEMATICSDIR}/UnitTests/unitTestNumericalDerivative.cpp") -setup_custom_test_program(test_NumericalDerivative "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics") -target_link_libraries(test_NumericalDerivative tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_NearestNeighbourSearch + SOURCES "${BASIC_MATHS_TEST_DIR}/unitTestNearestNeighbourSearch.cpp" + LINK_LIBRARIES tudat_input_output tudat_basic_mathematics ${Boost_LIBRARIES}) -add_executable(test_LegendrePolynomials "${SRCROOT}${BASICMATHEMATICSDIR}/UnitTests/unitTestLegendrePolynomials.cpp") -setup_custom_test_program(test_LegendrePolynomials "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics") -target_link_libraries(test_LegendrePolynomials tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_NumericalDerivative + SOURCES "${BASIC_MATHS_TEST_DIR}/unitTestNumericalDerivative.cpp" + LINK_LIBRARIES tudat_basic_mathematics ${Boost_LIBRARIES}) -add_executable(test_SphericalHarmonics "${SRCROOT}${BASICMATHEMATICSDIR}/UnitTests/unitTestSphericalHarmonics.cpp") -setup_custom_test_program(test_SphericalHarmonics "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics") -target_link_libraries(test_SphericalHarmonics tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_LegendrePolynomials + SOURCES "${BASIC_MATHS_TEST_DIR}/unitTestLegendrePolynomials.cpp" + LINK_LIBRARIES tudat_basic_mathematics ${Boost_LIBRARIES}) -add_executable(test_RotationAboutArbitraryAxis "${SRCROOT}${BASICMATHEMATICSDIR}/UnitTests/unitTestRotationAboutArbitraryAxis.cpp") -setup_custom_test_program(test_RotationAboutArbitraryAxis "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics") -target_link_libraries(test_RotationAboutArbitraryAxis tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_SphericalHarmonics + SOURCES "${BASIC_MATHS_TEST_DIR}/unitTestSphericalHarmonics.cpp" + LINK_LIBRARIES tudat_basic_mathematics ${Boost_LIBRARIES}) -add_executable(test_RotationPartials "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics/UnitTests/unitTestRotationPartials.cpp") -setup_custom_test_program(test_RotationPartials "${SRCROOT}${MATHEMATICSDIR}/BasicMathematics") -target_link_libraries(test_RotationPartials tudat_reference_frames tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_RotationAboutArbitraryAxis + SOURCES "${BASIC_MATHS_TEST_DIR}/unitTestRotationAboutArbitraryAxis.cpp" + LINK_LIBRARIES tudat_basic_mathematics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RotationPartials + SOURCES "${BASIC_MATHS_TEST_DIR}/unitTestRotationPartials.cpp" + LINK_LIBRARIES tudat_reference_frames tudat_basic_mathematics ${Boost_LIBRARIES}) diff --git a/Tudat/Mathematics/GeometricShapes/CMakeLists.txt b/Tudat/Mathematics/GeometricShapes/CMakeLists.txt index 20eddc825b..69e622524f 100755 --- a/Tudat/Mathematics/GeometricShapes/CMakeLists.txt +++ b/Tudat/Mathematics/GeometricShapes/CMakeLists.txt @@ -22,7 +22,7 @@ set(GEOMETRICSHAPES_SOURCES ) # Add header files. -set(GEOMETRICSHAPES_HEADERS +set(GEOMETRICSHAPES_HEADERS "${SRCROOT}${MATHEMATICSDIR}/GeometricShapes/capsule.h" "${SRCROOT}${MATHEMATICSDIR}/GeometricShapes/compositeSurfaceGeometry.h" "${SRCROOT}${MATHEMATICSDIR}/GeometricShapes/conicalFrustum.h" @@ -40,6 +40,7 @@ add_library(tudat_geometric_shapes STATIC ${GEOMETRICSHAPES_SOURCES}) setup_tudat_library_target(tudat_geometric_shapes "${SRCROOT}${MATHEMATICSDIR}/GeometricShapes") # Add unit tests. -add_executable(test_LawgsSurfaceGeometry "${SRCROOT}${MATHEMATICSDIR}/GeometricShapes/UnitTests/unitTestLawgsSurfaceGeometry.cpp") -setup_custom_test_program(test_LawgsSurfaceGeometry "${SRCROOT}${MATHEMATICSDIR}/GeometricShapes") -target_link_libraries(test_LawgsSurfaceGeometry tudat_geometric_shapes tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_LawgsSurfaceGeometry + SOURCES "${SRCROOT}${MATHEMATICSDIR}/GeometricShapes/UnitTests/unitTestLawgsSurfaceGeometry.cpp" + LINK_LIBRARIES tudat_geometric_shapes tudat_basic_mathematics ${Boost_LIBRARIES}) diff --git a/Tudat/Mathematics/Interpolators/CMakeLists.txt b/Tudat/Mathematics/Interpolators/CMakeLists.txt index 5b4d45aa1f..b79f9ded59 100755 --- a/Tudat/Mathematics/Interpolators/CMakeLists.txt +++ b/Tudat/Mathematics/Interpolators/CMakeLists.txt @@ -38,24 +38,46 @@ add_library(tudat_interpolators STATIC ${INTERPOLATORS_SOURCES} ${INTERPOLATORS_ setup_tudat_library_target(tudat_interpolators "${SRCROOT}${MATHEMATICSDIR}/Interpolators") # Add unit tests. -add_executable(test_CubicSplineInterpolator "${SRCROOT}${MATHEMATICSDIR}/Interpolators/UnitTests/unitTestCubicSplineInterpolator.cpp") -setup_custom_test_program(test_CubicSplineInterpolator "${SRCROOT}${MATHEMATICSDIR}") -target_link_libraries(test_CubicSplineInterpolator tudat_input_output tudat_interpolators tudat_basic_mathematics ${Boost_LIBRARIES}) +set(MATHS_INTERP_TEST_DIR "${SRCROOT}${MATHEMATICSDIR}/Interpolators/UnitTests") -add_executable(test_HermiteCubicSplineInterpolator "${SRCROOT}${MATHEMATICSDIR}/Interpolators/UnitTests/unitTestHermiteCubicSplineInterpolator.cpp") -setup_custom_test_program(test_HermiteCubicSplineInterpolator "${SRCROOT}${MATHEMATICSDIR}") -target_link_libraries(test_HermiteCubicSplineInterpolator tudat_input_output tudat_interpolators tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_CubicSplineInterpolator + SOURCES "${MATHS_INTERP_TEST_DIR}/unitTestCubicSplineInterpolator.cpp" + LINK_LIBRARIES tudat_input_output + tudat_interpolators + tudat_basic_mathematics + ${Boost_LIBRARIES}) -add_executable(test_LinearInterpolator "${SRCROOT}${MATHEMATICSDIR}/Interpolators/UnitTests/unitTestLinearInterpolator.cpp") -setup_custom_test_program(test_LinearInterpolator "${SRCROOT}${MATHEMATICSDIR}") -target_link_libraries(test_LinearInterpolator tudat_input_output tudat_interpolators tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_HermiteCubicSplineInterpolator + SOURCES "${MATHS_INTERP_TEST_DIR}/unitTestHermiteCubicSplineInterpolator.cpp" + LINK_LIBRARIES tudat_input_output + tudat_interpolators + tudat_basic_mathematics + ${Boost_LIBRARIES}) -add_executable(test_MultiLinearInterpolator "${SRCROOT}${MATHEMATICSDIR}/Interpolators/UnitTests/unitTestMultiLinearInterpolator.cpp") -setup_custom_test_program(test_MultiLinearInterpolator "${SRCROOT}${MATHEMATICSDIR}") -target_link_libraries(test_MultiLinearInterpolator tudat_input_output tudat_interpolators tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_LinearInterpolator + SOURCES "${MATHS_INTERP_TEST_DIR}/unitTestLinearInterpolator.cpp" + LINK_LIBRARIES tudat_input_output + tudat_interpolators + tudat_basic_mathematics + ${Boost_LIBRARIES}) -add_executable(test_LagrangeInterpolator "${SRCROOT}${MATHEMATICSDIR}/Interpolators/UnitTests/unitTestLagrangeInterpolators.cpp") -setup_custom_test_program(test_LagrangeInterpolator "${SRCROOT}${MATHEMATICSDIR}") -target_link_libraries(test_LagrangeInterpolator tudat_input_output tudat_interpolators tudat_basic_mathematics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_MultiLinearInterpolator + SOURCES "${MATHS_INTERP_TEST_DIR}/unitTestMultiLinearInterpolator.cpp" + LINK_LIBRARIES tudat_input_output + tudat_interpolators + tudat_basic_mathematics + ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_LagrangeInterpolator + SOURCES "${MATHS_INTERP_TEST_DIR}/unitTestLagrangeInterpolators.cpp" + LINK_LIBRARIES tudat_input_output + tudat_interpolators + tudat_basic_mathematics + ${Boost_LIBRARIES}) diff --git a/Tudat/Mathematics/NumericalIntegrators/CMakeLists.txt b/Tudat/Mathematics/NumericalIntegrators/CMakeLists.txt index 2b5e95ec6b..a3a15a4ddb 100755 --- a/Tudat/Mathematics/NumericalIntegrators/CMakeLists.txt +++ b/Tudat/Mathematics/NumericalIntegrators/CMakeLists.txt @@ -23,7 +23,7 @@ set(NUMERICALINTEGRATORS_SOURCES ) # Add header files. -set(NUMERICALINTEGRATORS_HEADERS +set(NUMERICALINTEGRATORS_HEADERS "${SRCROOT}${NUMERICALINTEGRATORSDIR}/adamsBashforthMoultonIntegrator.h" "${SRCROOT}${NUMERICALINTEGRATORSDIR}/createNumericalIntegrator.h" "${SRCROOT}${NUMERICALINTEGRATORSDIR}/bulirschStoerVariableStepsizeIntegrator.h" @@ -43,48 +43,59 @@ add_library(tudat_numerical_integrators STATIC ${NUMERICALINTEGRATORS_SOURCES} $ setup_tudat_library_target(tudat_numerical_integrators "${SRCROOT}${NUMERICALINTEGRATORSDIR}") # Add unit tests. - -add_executable(test_AdamsBashforthMoultonIntegrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests/unitTestAdamsBashforthMoultonIntegrator.cpp") -setup_custom_test_program(test_AdamsBashforthMoultonIntegrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}") -target_link_libraries(test_AdamsBashforthMoultonIntegrator tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_EulerIntegrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests/unitTestEulerIntegrator.cpp") -setup_custom_test_program(test_EulerIntegrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}") -target_link_libraries(test_EulerIntegrator tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_NumericalIntegrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests/unitTestNumericalIntegrator.cpp") -setup_custom_test_program(test_NumericalIntegrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}") -target_link_libraries(test_NumericalIntegrator tudat_numerical_integrators ${Boost_LIBRARIES}) - -add_executable(test_RungeKutta4Integrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests/unitTestRungeKutta4Integrator.cpp") -setup_custom_test_program(test_RungeKutta4Integrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}") -target_link_libraries(test_RungeKutta4Integrator tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_RungeKuttaVariableStepSizeIntegrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests/unitTestRungeKuttaVariableStepSizeIntegrator.cpp") -setup_custom_test_program(test_RungeKuttaVariableStepSizeIntegrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}") -target_link_libraries(test_RungeKuttaVariableStepSizeIntegrator tudat_numerical_integrators ${Boost_LIBRARIES}) - -add_executable(test_RungeKuttaCoefficients "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests/unitTestRungeKuttaCoefficients.cpp") -setup_custom_test_program(test_RungeKuttaCoefficients "${SRCROOT}${NUMERICALINTEGRATORSDIR}") -target_link_libraries(test_RungeKuttaCoefficients tudat_numerical_integrators ${Boost_LIBRARIES}) - -add_executable(test_RungeKuttaFehlberg45Integrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests/unitTestRungeKuttaFehlberg45Integrator.cpp") -setup_custom_test_program(test_RungeKuttaFehlberg45Integrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}") -target_link_libraries(test_RungeKuttaFehlberg45Integrator tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_RungeKuttaFehlberg56Integrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests/unitTestRungeKuttaFehlberg56Integrator.cpp") -setup_custom_test_program(test_RungeKuttaFehlberg56Integrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}") -target_link_libraries(test_RungeKuttaFehlberg56Integrator tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_RungeKuttaFehlberg78Integrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests/unitTestRungeKuttaFehlberg78Integrator.cpp") -setup_custom_test_program(test_RungeKuttaFehlberg78Integrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}") -target_link_libraries(test_RungeKuttaFehlberg78Integrator tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_RungeKutta87DormandPrinceIntegrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests/unitTestRungeKutta87DormandPrinceIntegrator.cpp") -setup_custom_test_program(test_RungeKutta87DormandPrinceIntegrator "${SRCROOT}${NUMERICALINTEGRATORSDIR}") -target_link_libraries(test_RungeKutta87DormandPrinceIntegrator tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) - -add_executable(test_BulirschStoerVariableStepSizeIntegrator "${SRCROOT}${MATHEMATICSDIR}/NumericalIntegrators/UnitTests/unitTestBulirschStoerVariableStepSizeIntegrator.cpp") -setup_custom_test_program(test_BulirschStoerVariableStepSizeIntegrator "${SRCROOT}${MATHEMATICSDIR}/NumericalIntegrators") -target_link_libraries(test_BulirschStoerVariableStepSizeIntegrator tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) - +set(MATHS_DEINT_TEST_DIR "${SRCROOT}${NUMERICALINTEGRATORSDIR}/UnitTests") + +tudat_add_test( + TARGET test_AdamsBashforthMoultonIntegrator + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestAdamsBashforthMoultonIntegrator.cpp" + LINK_LIBRARIES tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_EulerIntegrator + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestEulerIntegrator.cpp" + LINK_LIBRARIES tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_NumericalIntegrator + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestNumericalIntegrator.cpp" + LINK_LIBRARIES tudat_numerical_integrators ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RungeKutta4Integrator + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestRungeKutta4Integrator.cpp" + LINK_LIBRARIES tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RungeKuttaVariableStepSizeIntegrator + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestRungeKuttaVariableStepSizeIntegrator.cpp" + LINK_LIBRARIES tudat_numerical_integrators ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RungeKuttaCoefficients + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestRungeKuttaCoefficients.cpp" + LINK_LIBRARIES tudat_numerical_integrators ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RungeKuttaFehlberg45Integrator + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestRungeKuttaFehlberg45Integrator.cpp" + LINK_LIBRARIES tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RungeKuttaFehlberg56Integrator + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestRungeKuttaFehlberg56Integrator.cpp" + LINK_LIBRARIES tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RungeKuttaFehlberg78Integrator + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestRungeKuttaFehlberg78Integrator.cpp" + LINK_LIBRARIES tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RungeKutta87DormandPrinceIntegrator + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestRungeKutta87DormandPrinceIntegrator.cpp" + LINK_LIBRARIES tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_BulirschStoerVariableStepSizeIntegrator + SOURCES "${MATHS_DEINT_TEST_DIR}/unitTestBulirschStoerVariableStepSizeIntegrator.cpp" + LINK_LIBRARIES tudat_numerical_integrators tudat_input_output ${Boost_LIBRARIES}) diff --git a/Tudat/Mathematics/NumericalQuadrature/CMakeLists.txt b/Tudat/Mathematics/NumericalQuadrature/CMakeLists.txt index 8dc48acd26..fc85bbabd8 100755 --- a/Tudat/Mathematics/NumericalQuadrature/CMakeLists.txt +++ b/Tudat/Mathematics/NumericalQuadrature/CMakeLists.txt @@ -29,11 +29,14 @@ setup_tudat_library_target(tudat_numerical_quadrature "${SRCROOT}${MATHEMATICSDI set_target_properties(tudat_numerical_quadrature PROPERTIES LINKER_LANGUAGE CXX) # Add unit tests. -add_executable(test_TrapezoidalIntegrator "${SRCROOT}${MATHEMATICSDIR}/NumericalQuadrature/UnitTests/unitTestTrapezoidQuadrature.cpp") -setup_custom_test_program(test_TrapezoidalIntegrator "${SRCROOT}${MATHEMATICSDIR}/NumericalQuadrature") -target_link_libraries(test_TrapezoidalIntegrator tudat_numerical_quadrature ${Boost_LIBRARIES}) +set(MATHS_QUAD_TEST_DIR "${SRCROOT}${MATHEMATICSDIR}/NumericalQuadrature/UnitTests") -add_executable(test_GaussianQuadrature "${SRCROOT}${MATHEMATICSDIR}/NumericalQuadrature/UnitTests/unitTestGaussianQuadrature.cpp") -setup_custom_test_program(test_GaussianQuadrature "${SRCROOT}${MATHEMATICSDIR}/NumericalQuadrature") -target_link_libraries(test_GaussianQuadrature tudat_input_output tudat_numerical_quadrature ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_TrapezoidalIntegrator + SOURCES "${MATHS_QUAD_TEST_DIR}/unitTestTrapezoidQuadrature.cpp" + LINK_LIBRARIES tudat_numerical_quadrature ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_GaussianQuadrature + SOURCES "${MATHS_QUAD_TEST_DIR}/unitTestGaussianQuadrature.cpp" + LINK_LIBRARIES tudat_input_output tudat_numerical_quadrature ${Boost_LIBRARIES}) diff --git a/Tudat/Mathematics/RootFinders/CMakeLists.txt b/Tudat/Mathematics/RootFinders/CMakeLists.txt index 8a436704c7..6320d4ba46 100755 --- a/Tudat/Mathematics/RootFinders/CMakeLists.txt +++ b/Tudat/Mathematics/RootFinders/CMakeLists.txt @@ -9,7 +9,7 @@ # # Add header files. -set(ROOTFINDERS_HEADERS +set(ROOTFINDERS_HEADERS "${SRCROOT}${MATHEMATICSDIR}/RootFinders/halleyRootFinder.h" "${SRCROOT}${MATHEMATICSDIR}/RootFinders/newtonRaphson.h" "${SRCROOT}${MATHEMATICSDIR}/RootFinders/rootFinder.h" @@ -45,6 +45,7 @@ setup_tudat_library_target(tudat_root_finders "${SRCROOT}${MATHEMATICSDIR}/RootF set_target_properties(tudat_root_finders PROPERTIES LINKER_LANGUAGE CXX) # Add unit tests. -add_executable(test_RootFinders ${ROOTFINDERS_TESTS}) -setup_custom_test_program(test_RootFinders "${SRCROOT}${MATHEMATICSDIR}/RootFinders") -target_link_libraries(test_RootFinders tudat_root_finders ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_RootFinders + SOURCES ${ROOTFINDERS_TESTS} + LINK_LIBRARIES tudat_root_finders ${Boost_LIBRARIES}) diff --git a/Tudat/Mathematics/Statistics/CMakeLists.txt b/Tudat/Mathematics/Statistics/CMakeLists.txt index 999425a148..669b943e23 100755 --- a/Tudat/Mathematics/Statistics/CMakeLists.txt +++ b/Tudat/Mathematics/Statistics/CMakeLists.txt @@ -21,7 +21,7 @@ set(STATISTICS_SOURCES ) # Add header files. -set(STATISTICS_HEADERS +set(STATISTICS_HEADERS "${SRCROOT}${MATHEMATICSDIR}/Statistics/basicStatistics.h" "${SRCROOT}${MATHEMATICSDIR}/Statistics/simpleLinearRegression.h" "${SRCROOT}${MATHEMATICSDIR}/Statistics/multiVariateGaussianProbabilityDistributions.h" @@ -37,26 +37,34 @@ add_library(tudat_statistics STATIC ${STATISTICS_SOURCES} ${STATISTICS_HEADERS}) setup_tudat_library_target(tudat_statistics "${SRCROOT}${MATHEMATICSDIR}/Statistics") # Add unit tests. -add_executable(test_SimpleLinearRegression "${SRCROOT}${MATHEMATICSDIR}/Statistics/UnitTests/unitTestSimpleLinearRegression.cpp") -setup_custom_test_program(test_SimpleLinearRegression "${SRCROOT}${MATHEMATICSDIR}/Statistics") -target_link_libraries(test_SimpleLinearRegression tudat_statistics ${Boost_LIBRARIES}) +set(MATHS_STAT_TEST_DIR "${SRCROOT}${MATHEMATICSDIR}/Statistics/UnitTests") -add_executable(test_BasicStatistics "${SRCROOT}${MATHEMATICSDIR}/Statistics/UnitTests/unitTestBasicStatistics.cpp") -setup_custom_test_program(test_BasicStatistics "${SRCROOT}${MATHEMATICSDIR}/Statistics") -target_link_libraries(test_BasicStatistics tudat_statistics tudat_basics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_SimpleLinearRegression + SOURCES "${MATHS_STAT_TEST_DIR}/unitTestSimpleLinearRegression.cpp" + LINK_LIBRARIES tudat_statistics ${Boost_LIBRARIES}) -add_executable(test_MultiVariateProbabilityDistributions "${SRCROOT}${MATHEMATICSDIR}/Statistics/UnitTests/unitTestMultiVariateGaussianProbabilityDistributions.cpp") -setup_custom_test_program(test_MultiVariateProbabilityDistributions "${SRCROOT}${MATHEMATICSDIR}/Statistics") -target_link_libraries(test_MultiVariateProbabilityDistributions tudat_statistics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_BasicStatistics + SOURCES "${MATHS_STAT_TEST_DIR}/unitTestBasicStatistics.cpp" + LINK_LIBRARIES tudat_statistics tudat_basics ${Boost_LIBRARIES}) -add_executable(test_BoostDistributions "${SRCROOT}${MATHEMATICSDIR}/Statistics/UnitTests/unitTestBoostRandomVariables.cpp") -setup_custom_test_program(test_BoostDistributions "${SRCROOT}${MATHEMATICSDIR}/Statistics") -target_link_libraries(test_BoostDistributions tudat_statistics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_MultiVariateProbabilityDistributions + SOURCES "${MATHS_STAT_TEST_DIR}/unitTestMultiVariateGaussianProbabilityDistributions.cpp" + LINK_LIBRARIES tudat_statistics ${Boost_LIBRARIES}) -add_executable(test_KernelDensityDistribution "${SRCROOT}${MATHEMATICSDIR}/Statistics/UnitTests/unitTestKernelDensityDistribution.cpp") -setup_custom_test_program(test_KernelDensityDistribution "${SRCROOT}${MATHEMATICSDIR}/Statistics") -target_link_libraries(test_KernelDensityDistribution tudat_statistics ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_BoostDistributions + SOURCES "${MATHS_STAT_TEST_DIR}/unitTestBoostRandomVariables.cpp" + LINK_LIBRARIES tudat_statistics ${Boost_LIBRARIES}) -add_executable(test_RandomSampling "${SRCROOT}${MATHEMATICSDIR}/Statistics/UnitTests/unitTestRandomSampling.cpp") -setup_custom_test_program(test_RandomSampling "${SRCROOT}${MATHEMATICSDIR}/Statistics") -target_link_libraries(test_RandomSampling tudat_statistics ${TUDAT_EXTERNAL_LIBRARIES} ${Boost_LIBRARIES}) +tudat_add_test( + TARGET test_KernelDensityDistribution + SOURCES "${MATHS_STAT_TEST_DIR}/unitTestKernelDensityDistribution.cpp" + LINK_LIBRARIES tudat_statistics ${Boost_LIBRARIES}) + +tudat_add_test( + TARGET test_RandomSampling + SOURCES "${MATHS_STAT_TEST_DIR}/unitTestRandomSampling.cpp" + LINK_LIBRARIES tudat_statistics ${TUDAT_EXTERNAL_LIBRARIES} ${Boost_LIBRARIES}) diff --git a/Tudat/SimulationSetup/CMakeLists.txt b/Tudat/SimulationSetup/CMakeLists.txt index 4fc60e94ab..da4352d5e8 100644 --- a/Tudat/SimulationSetup/CMakeLists.txt +++ b/Tudat/SimulationSetup/CMakeLists.txt @@ -28,12 +28,15 @@ get_target_property(SIMULATION_PROPAGATION_SETUP_SOURCES tudat_propagation_setup # Add unit tests. if(USE_CSPICE) - add_executable(test_EnvironmentCreation "${SRCROOT}${SIMULATIONSETUPDIR}/UnitTests/unitTestEnvironmentModelSetup.cpp") - setup_custom_test_program(test_EnvironmentCreation "${SRCROOT}${SIMULATIONSETUPDIR}/") - target_link_libraries(test_EnvironmentCreation ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) - add_executable(test_AccelerationModelCreation "${SRCROOT}${SIMULATIONSETUPDIR}/UnitTests/unitTestAccelerationModelSetup.cpp") - setup_custom_test_program(test_AccelerationModelCreation "${SRCROOT}${SIMULATIONSETUPDIR}/") - target_link_libraries(test_AccelerationModelCreation ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + tudat_add_test( + TARGET test_EnvironmentCreation + SOURCES "${SRCROOT}${SIMULATIONSETUPDIR}/UnitTests/unitTestEnvironmentModelSetup.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) + + tudat_add_test( + TARGET test_AccelerationModelCreation + SOURCES "${SRCROOT}${SIMULATIONSETUPDIR}/UnitTests/unitTestAccelerationModelSetup.cpp" + LINK_LIBRARIES ${TUDAT_PROPAGATION_LIBRARIES} ${Boost_LIBRARIES}) endif()