Files
SVMClassifier/tests/test_main.cpp
Ricardo Montañana Gómez d6dc083a5a
Some checks failed
CI/CD Pipeline / Code Linting (push) Failing after 22s
CI/CD Pipeline / Build and Test (Debug, clang, ubuntu-latest) (push) Failing after 5m44s
CI/CD Pipeline / Build and Test (Debug, gcc, ubuntu-latest) (push) Failing after 5m33s
CI/CD Pipeline / Build and Test (Release, clang, ubuntu-20.04) (push) Failing after 6m12s
CI/CD Pipeline / Build and Test (Release, clang, ubuntu-latest) (push) Failing after 5m13s
CI/CD Pipeline / Build and Test (Release, gcc, ubuntu-20.04) (push) Failing after 5m30s
CI/CD Pipeline / Build and Test (Release, gcc, ubuntu-latest) (push) Failing after 5m33s
CI/CD Pipeline / Docker Build Test (push) Failing after 13s
CI/CD Pipeline / Performance Benchmarks (push) Has been skipped
CI/CD Pipeline / Build Documentation (push) Successful in 31s
CI/CD Pipeline / Create Release Package (push) Has been skipped
Initial commit as Claude developed it
2025-06-22 12:50:10 +02:00

44 lines
1.2 KiB
C++

/**
* @file test_main.cpp
* @brief Main entry point for Catch2 test suite
*
* This file contains global test configuration and setup for the SVM classifier
* test suite. Catch2 will automatically generate the main() function.
*/
#define CATCH_CONFIG_MAIN
#include <catch2/catch_all.hpp>
#include <torch/torch.h>
#include <iostream>
/**
* @brief Global test setup
*/
struct GlobalTestSetup {
GlobalTestSetup()
{
// Set PyTorch to single-threaded for reproducible tests
torch::set_num_threads(1);
// Set manual seed for reproducibility
torch::manual_seed(42);
// Disable PyTorch warnings for cleaner test output
torch::globalContext().setQEngine(at::QEngine::FBGEMM);
std::cout << "SVM Classifier Test Suite" << std::endl;
std::cout << "=========================" << std::endl;
std::cout << "PyTorch version: " << TORCH_VERSION << std::endl;
std::cout << "Using " << torch::get_num_threads() << " thread(s)" << std::endl;
std::cout << std::endl;
}
~GlobalTestSetup()
{
std::cout << std::endl;
std::cout << "Test suite completed." << std::endl;
}
};
// Global setup instance
static GlobalTestSetup global_setup;