#include #include #include #include // Forward declarations for test main functions int run_imu_data_provider_tests(); int run_lighthouse_driver_wrapper_tests(); int run_sauna_device_driver_tests(); // Test runner function type typedef int (*TestRunnerFunc)(); // Test suite structure struct TestSuite { std::string name; TestRunnerFunc runner; TestSuite(const std::string& n, TestRunnerFunc r) : name(n), runner(r) {} }; // Main function int main(int argc, char** argv) { std::cout << "=== Sauna Driver Unit Tests ===" << std::endl; // Define the test suites std::vector testSuites = { TestSuite("IMU Data Provider Tests", run_imu_data_provider_tests), TestSuite("Lighthouse Driver Wrapper Tests", run_lighthouse_driver_wrapper_tests), TestSuite("Sauna Device Driver Tests", run_sauna_device_driver_tests) }; // Run all test suites int totalTests = 0; int passedTests = 0; for (const auto& suite : testSuites) { std::cout << "\n=== Running " << suite.name << " ===" << std::endl; int result = suite.runner(); if (result == 0) { std::cout << "=== " << suite.name << " PASSED ===" << std::endl; passedTests++; } else { std::cout << "=== " << suite.name << " FAILED ===" << std::endl; } totalTests++; } // Print summary std::cout << "\n=== Test Summary ===" << std::endl; std::cout << "Total Test Suites: " << totalTests << std::endl; std::cout << "Passed: " << passedTests << std::endl; std::cout << "Failed: " << (totalTests - passedTests) << std::endl; return (totalTests == passedTests) ? 0 : 1; } // Implementation of test main functions // These functions simply call the main function of each test file int run_imu_data_provider_tests() { extern int imu_data_provider_test_main(int argc, char** argv); char* args[] = { (char*)"imu_data_provider_tests" }; return imu_data_provider_test_main(1, args); } int run_lighthouse_driver_wrapper_tests() { extern int lighthouse_driver_wrapper_test_main(int argc, char** argv); char* args[] = { (char*)"lighthouse_driver_wrapper_tests" }; return lighthouse_driver_wrapper_test_main(1, args); } int run_sauna_device_driver_tests() { extern int sauna_device_driver_test_main(int argc, char** argv); char* args[] = { (char*)"sauna_device_driver_tests" }; return sauna_device_driver_test_main(1, args); }