added a way to find test data wihout copy

This commit is contained in:
Erik Frojdh
2024-03-14 10:14:34 +01:00
parent 954db79c36
commit 5f8d8a8c0b
4 changed files with 42 additions and 12 deletions

View File

@ -1 +1,17 @@
//Empty file to satisfy CMake when no other tests are added
#include <catch2/catch_test_macros.hpp>
#include <fstream>
#include <filesystem>
#include "test_config.hpp"
TEST_CASE("Test suite can find data assets"){
auto fpath = test_data_path()/ "test_numpy_file.npy";
REQUIRE(std::filesystem::exists(fpath));
}
TEST_CASE("Test suite can open data assets"){
auto fpath = test_data_path()/ "test_numpy_file.npy";
auto f = std::ifstream(fpath, std::ios::binary);
REQUIRE(f.is_open());
}