2012-11-04 12:18:26 +00:00
|
|
|
/*
|
|
|
|
* minunit.h
|
|
|
|
*
|
|
|
|
* Created on: Nov 2, 2012
|
|
|
|
* Author: attero
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MINUNIT_H_
|
|
|
|
#define MINUNIT_H_
|
|
|
|
|
2012-12-28 16:39:43 +00:00
|
|
|
/**
|
|
|
|
* For my small testing framework I define three macro's
|
|
|
|
* Here they are:
|
|
|
|
*/
|
2012-11-04 12:18:26 +00:00
|
|
|
#define mu_assert(message, test) do { if (!(test)) return message; } while (0)
|
2012-11-04 13:26:36 +00:00
|
|
|
#define muu_assert(message, test) do { if (!(test)) test_report += message "\n"; } while (0)
|
2012-11-04 12:18:26 +00:00
|
|
|
#define mu_run_test(test) do { std::string message = test(); tests++;\
|
|
|
|
if (message != ""){ tests_failed++; \
|
|
|
|
test_report += "in " #test ": " + message + "\n";}\
|
|
|
|
else tests_passed++;} while (0)
|
|
|
|
extern int tests_run;
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* MINUNIT_H_ */
|