stuff-from-scratch/test/test_utils/TestFramework.h

19 lines
515 B
C
Raw Normal View History

2022-11-29 18:00:19 +00:00
#pragma once
#include "TestCaseRunner.h"
struct Holder
{
Holder(const std::string& name, const std::string& tags, std::function<void()> func)
{
TestCaseRunner::getInstance().addTestCase(name, tags, func);
}
};
#define TEST_CASE(NAME, TAGS) \
static void Test##NAME(); \
namespace{Holder holder##NAME( #NAME, #TAGS, &Test##NAME );} \
static void Test##NAME() \