File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66#include < cstring>
77#include < string>
88#include < random>
9+ #include < format>
910
1011using std::cerr;
1112using std::cout;
@@ -46,6 +47,9 @@ using std::uniform_int_distribution;
4647 cerr << " File: " << __FILE__ << " \n " ; \
4748 cerr << " Line: " << __LINE__ << " \n " ; \
4849 abort (); \
50+ } else { \
51+ const auto fmt = std::format (" [OK] [{}:{}]" , BASE_NAME (__FILE__), __LINE__); \
52+ std::cout << fmt << std::format (" {} is {}\n " , #condition, condition); \
4953 } \
5054 } while (0 )
5155
@@ -108,4 +112,13 @@ string rand_source_digits(
108112 return results;
109113}
110114
115+ #define TEST (func_name ) void func_name () { \
116+ std::cout << std::format (" [TEST] {}" , #func_name) << " \n " ;
117+
118+ #define DONE }
119+ #define RUN (func ) func();
120+
121+ #define TEST_MAIN int main () {
122+ #define END_MAIN return 0 ; }
123+
111124#endif // __ASSERT_HXX
You can’t perform that action at this time.
0 commit comments