Compare commits
4 Commits
Prerelease
...
Prerelease
Author | SHA1 | Date | |
---|---|---|---|
21cc5313f2 | |||
ab57cd5774 | |||
e04b742954 | |||
6954f51793 |
@@ -35,8 +35,6 @@ CPMAddPackage(
|
||||
URL https://git.redacted.cc/josh/jlog/archive/Prerelease-5.zip
|
||||
)
|
||||
|
||||
include_directories(${Event_SOURCE_DIR}/include)
|
||||
include_directories(${jlog_SOURCE_DIR}/include)
|
||||
|
||||
if (UNIX)
|
||||
add_library(jtest SHARED ${jtest_SRC})
|
||||
@@ -46,6 +44,10 @@ if (WIN32)
|
||||
add_library(jtest STATIC ${jtest_SRC})
|
||||
endif()
|
||||
|
||||
target_include_directories(jtest PUBLIC ${Event_SOURCE_DIR}/include)
|
||||
target_include_directories(jtest PUBLIC ${jlog_SOURCE_DIR}/include)
|
||||
|
||||
|
||||
target_include_directories(jtest PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
|
||||
|
@@ -15,9 +15,9 @@ namespace jtest {
|
||||
// -maxine
|
||||
struct testdef
|
||||
{
|
||||
const std::string& testname;
|
||||
const std::function<void()>& callback;
|
||||
const std::string file; // <- & is not needed here -maxine
|
||||
std::string testname;
|
||||
std::function<void()> callback;
|
||||
std::string file; // <- & is not needed here -maxine
|
||||
int line;
|
||||
bool passed;
|
||||
};
|
||||
@@ -33,6 +33,9 @@ namespace jtest {
|
||||
testlist.push_back(testdef(testname, callback, file, line));
|
||||
}
|
||||
|
||||
// TODO: Implement check variants
|
||||
// TODO: implement streaming a custom failure message with << operator
|
||||
// i.e. : check(my_cond) << "The condition is not true!"
|
||||
bool check(bool condition) {
|
||||
if (!condition)
|
||||
throw std::runtime_error("Test check failed!!");
|
||||
|
Reference in New Issue
Block a user