# make unit tests
add_executable(testImuPoseEstimator unit/testImuPoseEstimator.cpp)
target_link_libraries(testImuPoseEstimator bioslam ${BIOSLAMLIBS})
add_executable(testLowerBodyPoseEstimator unit/testLowerBodyPoseEstimator.cpp)
target_link_libraries(testLowerBodyPoseEstimator bioslam ${BIOSLAMLIBS})
add_executable(testMagnetometerFactors unit/testMagnetometerFactors.cpp)
target_link_libraries(testMagnetometerFactors bioslam ${BIOSLAMLIBS})
add_executable(testImuNoiseModelHandler unit/testImuNoiseModelHandler.cpp)
target_link_libraries(testImuNoiseModelHandler bioslam ${BIOSLAMLIBS})
add_executable(testMaxPoint3MagnitudeFactor unit/testMaxPoint3MagnitudeFactor.cpp)
target_link_libraries(testMaxPoint3MagnitudeFactor bioslam ${BIOSLAMLIBS})
add_executable(testSegmentLengthMagnitudeFactor unit/testSegmentLengthMagnitudeFactor.cpp)
target_link_libraries(testSegmentLengthMagnitudeFactor bioslam ${BIOSLAMLIBS})
add_executable(testConstrainedJointCenterPositionFactor unit/testConstrainedJointCenterPositionFactor.cpp)
target_link_libraries(testConstrainedJointCenterPositionFactor bioslam ${BIOSLAMLIBS})
add_executable(testConstrainedJointCenterNormPositionFactor unit/testConstrainedJointCenterNormPositionFactor.cpp)
target_link_libraries(testConstrainedJointCenterNormPositionFactor bioslam ${BIOSLAMLIBS})
add_executable(testMaxMinSegmentLengthMagnitudeFactors unit/testMaxMinSegmentLengthMagnitudeFactors.cpp)
target_link_libraries(testMaxMinSegmentLengthMagnitudeFactors bioslam ${BIOSLAMLIBS})
add_executable(testAngularVelocityFactor unit/testAngularVelocityFactor.cpp)
target_link_libraries(testAngularVelocityFactor bioslam ${BIOSLAMLIBS})
add_executable(testConstrainedJointCenterVelocityFactor unit/testConstrainedJointCenterVelocityFactor.cpp)
target_link_libraries(testConstrainedJointCenterVelocityFactor bioslam ${BIOSLAMLIBS})
add_executable(testConstrainedJointCenterNormVelocityFactor unit/testConstrainedJointCenterNormVelocityFactor.cpp)
target_link_libraries(testConstrainedJointCenterNormVelocityFactor bioslam ${BIOSLAMLIBS})
add_executable(testHingeJointConstraintVectorErrorEstAngVel unit/testHingeJointConstraintVectorErrorEstAngVel.cpp)
target_link_libraries(testHingeJointConstraintVectorErrorEstAngVel bioslam ${BIOSLAMLIBS})
add_executable(testHingeJointConstraintNormErrorEstAngVel unit/testHingeJointConstraintNormErrorEstAngVel.cpp)
target_link_libraries(testHingeJointConstraintNormErrorEstAngVel bioslam ${BIOSLAMLIBS})
add_executable(testSegmentLengthDiscrepancyFactor unit/testSegmentLengthDiscrepancyFactor.cpp)
target_link_libraries(testSegmentLengthDiscrepancyFactor bioslam ${BIOSLAMLIBS})
add_executable(testAngleBetweenAxisAndSegmentFactor unit/testAngleBetweenAxisAndSegmentFactor.cpp)
target_link_libraries(testAngleBetweenAxisAndSegmentFactor bioslam ${BIOSLAMLIBS})
add_executable(testMaxAngleBetweenAxisAndSegmentFactor unit/testMaxAngleBetweenAxisAndSegmentFactor.cpp)
target_link_libraries(testMaxAngleBetweenAxisAndSegmentFactor bioslam ${BIOSLAMLIBS})
add_executable(testMinAngleBetweenAxisAndSegmentFactor unit/testMinAngleBetweenAxisAndSegmentFactor.cpp)
target_link_libraries(testMinAngleBetweenAxisAndSegmentFactor bioslam ${BIOSLAMLIBS})
add_executable(testPoint3MagnitudeDifferenceFactor unit/testPoint3MagnitudeDifferenceFactor.cpp)
target_link_libraries(testPoint3MagnitudeDifferenceFactor bioslam ${BIOSLAMLIBS})
add_executable(testEKF unit/testEkf.cpp)
target_link_libraries(testEKF bioslam ${BIOSLAMLIBS})
add_executable(testDistalImuAdjustmentPerJointAngles unit/testDistalImuAdjustmentPerJointAngles.cpp)
target_link_libraries(testDistalImuAdjustmentPerJointAngles bioslam ${BIOSLAMLIBS})
add_executable(testJointAngleCalculation unit/testJointAngleCalculation.cpp)
target_link_libraries(testJointAngleCalculation bioslam ${BIOSLAMLIBS})
add_executable(testGenericMath unit/testGenericMath.cpp)
target_link_libraries(testGenericMath bioslam ${BIOSLAMLIBS})
add_executable(testRotateImuStateAboutPointAxisAngle unit/testRotateImuStateAboutPointAxisAngle.cpp)
target_link_libraries(testRotateImuStateAboutPointAxisAngle bioslam ${BIOSLAMLIBS})
add_executable(testPose3TranslationPrior unit/testPose3TranslationPrior.cpp)
target_link_libraries(testPose3TranslationPrior bioslam ${BIOSLAMLIBS})
add_executable(testPose3CompassPrior unit/testPose3CompassPrior.cpp)
target_link_libraries(testPose3CompassPrior bioslam ${BIOSLAMLIBS})
add_executable(testImu unit/testImu.cpp)
target_link_libraries(testImu bioslam ${BIOSLAMLIBS})

# make solution tests. these test expected solutions of different estimators.
add_executable(testImuEstimationSolution solution/testImuEstimationSolution.cpp)
target_link_libraries(testImuEstimationSolution bioslam ${BIOSLAMLIBS})
add_executable(testLowerBodyEstimationSolution solution/testLowerBodyEstimationSolution.cpp)
target_link_libraries(testLowerBodyEstimationSolution bioslam ${BIOSLAMLIBS})

# add tests runners
add_test(RUN_testImuPoseEstimator testImuPoseEstimator)
add_test(RUN_testLowerBodyPoseEstimator testLowerBodyPoseEstimator)
add_test(RUN_testMagnetometerFactors testMagnetometerFactors)
add_test(RUN_testImuNoiseModelHandler testImuNoiseModelHandler)
add_test(RUN_testMaxPoint3MagnitudeFactor testMaxPoint3MagnitudeFactor)
add_test(RUN_testSegmentLengthMagnitudeFactor testSegmentLengthMagnitudeFactor)
add_test(RUN_testConstrainedJointCenterPositionFactor testConstrainedJointCenterPositionFactor)
add_test(RUN_testConstrainedJointCenterNormPositionFactor testConstrainedJointCenterNormPositionFactor)
add_test(RUN_testMaxMinSegmentLengthMagnitudeFactors testMaxMinSegmentLengthMagnitudeFactors)
add_test(RUN_testAngularVelocityFactor testAngularVelocityFactor)
add_test(RUN_testConstrainedJointCenterVelocityFactor testConstrainedJointCenterVelocityFactor)
add_test(RUN_testConstrainedJointCenterNormVelocityFactor testConstrainedJointCenterNormVelocityFactor)
add_test(RUN_testHingeJointConstraintVectorErrorEstAngVel testHingeJointConstraintVectorErrorEstAngVel)
add_test(RUN_testHingeJointConstraintNormErrorEstAngVel testHingeJointConstraintNormErrorEstAngVel)
add_test(RUN_testSegmentLengthDiscrepancyFactor testSegmentLengthDiscrepancyFactor)
add_test(RUN_testAngleBetweenAxisAndSegmentFactor testAngleBetweenAxisAndSegmentFactor)
add_test(RUN_testMaxAngleBetweenAxisAndSegmentFactor testMaxAngleBetweenAxisAndSegmentFactor)
add_test(RUN_testMinAngleBetweenAxisAndSegmentFactor testMinAngleBetweenAxisAndSegmentFactor)
add_test(RUN_testPoint3MagnitudeDifferenceFactor testPoint3MagnitudeDifferenceFactor)
add_test(RUN_testEKF testEKF)
add_test(RUN_testDistalImuAdjustmentPerJointAngles testDistalImuAdjustmentPerJointAngles)
add_test(RUN_testJointAngleCalculation testJointAngleCalculation)
add_test(RUN_testGenericMath testGenericMath)
add_test(RUN_testImuEstimationSolution testImuEstimationSolution)
add_test(RUN_testLowerBodyEstimationSolution testLowerBodyEstimationSolution)
add_test(RUN_testPose3TranslationPrior testPose3TranslationPrior)
add_test(RUN_testPose3CompassPrior testPose3CompassPrior)
add_test(RUN_testRotateImuStateAboutPointAxisAngle testRotateImuStateAboutPointAxisAngle)
add_test(RUN_testImu testImu)
