library comile complete and begin tests
Some checks failed
CI/CD Pipeline / Create Release Package (push) Has been cancelled
CI/CD Pipeline / Code Linting (push) Has been cancelled
CI/CD Pipeline / Build and Test (Debug, clang, ubuntu-latest) (push) Has been cancelled
CI/CD Pipeline / Build and Test (Debug, gcc, ubuntu-latest) (push) Has been cancelled
CI/CD Pipeline / Build and Test (Release, clang, ubuntu-20.04) (push) Has been cancelled
CI/CD Pipeline / Build and Test (Release, clang, ubuntu-latest) (push) Has been cancelled
CI/CD Pipeline / Build and Test (Release, gcc, ubuntu-20.04) (push) Has been cancelled
CI/CD Pipeline / Build and Test (Release, gcc, ubuntu-latest) (push) Has been cancelled
CI/CD Pipeline / Docker Build Test (push) Has been cancelled
CI/CD Pipeline / Performance Benchmarks (push) Has been cancelled
CI/CD Pipeline / Build Documentation (push) Has been cancelled
Some checks failed
CI/CD Pipeline / Create Release Package (push) Has been cancelled
CI/CD Pipeline / Code Linting (push) Has been cancelled
CI/CD Pipeline / Build and Test (Debug, clang, ubuntu-latest) (push) Has been cancelled
CI/CD Pipeline / Build and Test (Debug, gcc, ubuntu-latest) (push) Has been cancelled
CI/CD Pipeline / Build and Test (Release, clang, ubuntu-20.04) (push) Has been cancelled
CI/CD Pipeline / Build and Test (Release, clang, ubuntu-latest) (push) Has been cancelled
CI/CD Pipeline / Build and Test (Release, gcc, ubuntu-20.04) (push) Has been cancelled
CI/CD Pipeline / Build and Test (Release, gcc, ubuntu-latest) (push) Has been cancelled
CI/CD Pipeline / Docker Build Test (push) Has been cancelled
CI/CD Pipeline / Performance Benchmarks (push) Has been cancelled
CI/CD Pipeline / Build Documentation (push) Has been cancelled
This commit is contained in:
@@ -23,16 +23,31 @@ target_link_libraries(svm_classifier_tests
|
||||
PRIVATE
|
||||
svm_classifier
|
||||
Catch2::Catch2WithMain
|
||||
nlohmann_json::nlohmann_json
|
||||
)
|
||||
|
||||
# Set include directories
|
||||
# Set include directories - Handle external libraries dynamically
|
||||
target_include_directories(svm_classifier_tests
|
||||
PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
${CMAKE_SOURCE_DIR}/external/libsvm
|
||||
${CMAKE_SOURCE_DIR}/external/liblinear
|
||||
)
|
||||
|
||||
# Add libsvm include directory if available
|
||||
if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/../_deps/libsvm-src")
|
||||
target_include_directories(svm_classifier_tests
|
||||
PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../_deps/libsvm-src"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Add liblinear include directories if available
|
||||
if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/../_deps/liblinear-src")
|
||||
target_include_directories(svm_classifier_tests
|
||||
PRIVATE
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/../_deps/liblinear-src"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/../_deps/liblinear-src/blas"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Compiler flags for tests
|
||||
target_compile_features(svm_classifier_tests PRIVATE cxx_std_17)
|
||||
|
||||
|
@@ -7,6 +7,10 @@
|
||||
#include <svm_classifier/data_converter.hpp>
|
||||
#include <torch/torch.h>
|
||||
|
||||
// Include the actual headers for complete struct definitions
|
||||
#include "svm.h" // libsvm structures
|
||||
#include "linear.h" // liblinear structures
|
||||
|
||||
using namespace svm_classifier;
|
||||
|
||||
TEST_CASE("DataConverter Basic Functionality", "[unit][data_converter]")
|
||||
|
@@ -10,7 +10,13 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
// Include the actual headers for complete struct definitions
|
||||
#include "svm.h" // libsvm structures
|
||||
#include "linear.h" // liblinear structures
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using namespace svm_classifier;
|
||||
using json = nlohmann::json;
|
||||
|
||||
/**
|
||||
* @brief Generate large synthetic dataset for performance testing
|
||||
|
@@ -283,7 +283,7 @@ TEST_CASE("SVMClassifier Prediction", "[integration][svm_classifier]")
|
||||
REQUIRE(predictions.size(0) == X_test.size(0));
|
||||
|
||||
// Check that predictions are valid class labels
|
||||
auto unique_preds = torch::unique(predictions);
|
||||
auto unique_preds = std::get<0>(at::_unique(predictions));
|
||||
for (int i = 0; i < unique_preds.size(0); ++i) {
|
||||
int pred_class = unique_preds[i].item<int>();
|
||||
auto classes = svm.get_classes();
|
||||
|
Reference in New Issue
Block a user