BioCMAMC-ST
common_test.hpp
1#ifndef __TEST_COMMON_TEST_HPP__
2#define __TEST_COMMON_TEST_HPP__
3#include <cassert>
4#include <filesystem>
5
6#define CHECK(__stmt__) assert((__stmt__) == 0);
7#define CHECK_FALSE(__stmt__) assert((__stmt__) != 0);
8static const auto tmp_dir = std::filesystem::temp_directory_path();
9
10constexpr size_t n_rank = 1;
11constexpr size_t i_rank = 0;
12constexpr size_t id = 123;
13constexpr size_t nt = 4;
14
15constexpr double cx = 1;
16constexpr double ft = 1;
17constexpr double dt = 0.;
18constexpr size_t np = 40;
19constexpr size_t nex = 0;
20
21void test_init(int argc, char** argv);
22void test_exec(int argc, char** argv,std::string_view path);
23void test_exec_err(int argc, char** argv);
24
25void test_apply(int argc, char** argv,std::string_view path);
26void test_apply_err(int argc, char** argv);
27void test_register_result_path(int argc, char** argv);
28void test_register_parameters(int argc, char** argv);
29
30inline std::string get_cma_path(int argc, char** argv)
31{
32
33 if (argc != 2)
34 {
35 assert(false && "Need cma path");
36 }
37
38 return argv[1];
39}
40
41#endif //__TEST_COMMON_TEST_HPP__