mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-10 06:02:10 +08:00
engine: add simple unit-testing (v3?)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#ifndef TESTS_H
|
||||
#define TESTS_H
|
||||
|
||||
#if XASH_ENGINE_TESTS
|
||||
|
||||
struct tests_stats_s
|
||||
{
|
||||
uint passed;
|
||||
uint failed;
|
||||
};
|
||||
|
||||
extern struct tests_stats_s tests_stats;
|
||||
|
||||
#define TRUN( x ) Msg( "Running " #x "\n" ); x
|
||||
|
||||
#define TASSERT( exp ) \
|
||||
if(!( exp )) \
|
||||
{ \
|
||||
tests_stats.failed++; \
|
||||
Msg( "assert failed at %s:%i\n", __FILE__, __LINE__ ) \
|
||||
} \
|
||||
else tests_stats.passed++;
|
||||
|
||||
void Test_RunLibCommon( void );
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* TESTS_H */
|
||||
Reference in New Issue
Block a user