
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:
100,
);
return params;
}());
return params;
}());
100,
200,
}());
std::vector< Type_ > simulate_vector(const typename std::vector< Type_ >::size_type length, const SimulateVectorParameters< Type_ > ¶ms)
Definition simulate_vector.hpp:96
SimulatedCompressedSparseMatrix< Data_, Index_, Pointer_ > simulate_compressed_sparse_matrix(Index_ primary, Index_ secondary, const SimulateCompressedSparseMatrixParameters< Data_ > ¶ms)
Definition simulate_compressed_sparse_matrix.hpp:95
Parameters for simulate_compressed_sparse_matrix().
Definition simulate_compressed_sparse_matrix.hpp:24
Parameters for simulate_vector().
Definition simulate_vector.hpp:41
double density
Definition simulate_vector.hpp:45
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};
void compare_almost_equal_containers(const LeftContainer_ &left, const RightContainer_ &right, CompareAlmostEqualParameters params)
Definition compare_almost_equal.hpp:115
bool compare_almost_equal(double left, double right, const CompareAlmostEqualParameters ¶ms)
Definition compare_almost_equal.hpp:55
Quick construction of vectors for use in EXPECT_EQ():
std::vector<double> big_array(1000);
std::vector< Type_ > vector_n(const Type_ *ptr, std::size_t n)
Definition vector_n.hpp:23
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.