Files
jtest/include/jtest/Test.hpp

29 lines
883 B
C++

/// Josh's Test Library
/// A no-frills, straightforward unit testing module in and for Modern C++.
/// Created by Joshua O'Leary @ Redacted Software, June 2024
/// Maintained by Maxine Hayes @ Redacted Software.
/// This work is dedicated to the public domain.
/// Contact: josh@redacted.cc, maxi@redacted.cc
/// @file UnitLogger.hpp
/// @desc
/// @edit 2024-08-21
#pragma once
#include <jlog/Logger.hpp>
namespace jtest {
class Test {
public:
explicit Test(const std::string& name, std::function<void()> callback, std::source_location = std::source_location::current());
public:
void operator()() { callback(); };
std::string Name() { return name; };
std::source_location Location() { return location; };
protected:
std::string name;
std::function<void()> callback;
std::source_location location;
};
}