![Codecov](https://codecov.io/gh/libscran/scran_tests/graph/badge.svg?token=9OqeoHc56i)
This repository contains utilities for testing other libscran libraries. To include this in a project, just add the following chunk to the test-specific CMakeLists.txt
:
include(FetchContent)
FetchContent_Declare(
scran_tests
GIT_REPOSITORY https://github.com/libscran/scran_tests
GIT_TAG master # or any version of interest
)
FetchContent_MakeAvailable(scran_tests)
target_link_libraries(mylib INTERFACE scran_tests)
This will automatically pull in GoogleTest via FetchContent
so downstream projects don't have to do it themselves. Then, to use the library, we just have to add the header:
Test utilites for libscran.
We can now simulate some random data easily:
return params;
}());
return params;
}());
std::vector< Type_ > simulate_vector(size_t length, const SimulationParameters< Type_ > ¶ms)
Definition simulate_vector.hpp:69
Parameters for simulate_vector().
Definition simulate_vector.hpp:22
double density
Definition simulate_vector.hpp:38
Comparison of almost-equal floating-point numbers, given a relative tolerance:
std::vector<double> v1{1.0, 2.000000001};
std::vector<double> v2{1.000000001, 2.0};
bool compare_almost_equal(double left, double right, double tol=1e-8, bool report=true)
Definition compare_almost_equal.hpp:26
Quick construction of vectors for use in EXPECT_EQ()
:
std::vector<double> big_array(1000);
std::vector< Type_ > vector_n(const Type_ *ptr, size_t n)
Definition vector_n.hpp:22
Expect specific error messages:
void expect_error(Function_ fun, std::string match)
Definition expect_error.hpp:24
Test against zero-initialized assumptions:
int initial_value()
Definition initial_value.hpp:24
Check out the documentation for more details.