48 lines
1.3 KiB
C++
48 lines
1.3 KiB
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
|
|
// This work is dedicated to the public domain.
|
|
// Contact: josh@redacted.cc, git.redacted.cc/josh
|
|
|
|
// TODO: Provide introspection insofar as which assertion check failed.
|
|
// TODO: Provide alternate checks (google test has specific assertations for handling floats, for example) (Are these actually necessary??)
|
|
// TODO: Implement log-file-specification-capability in jlog so we can log to test_results.txt specifically.
|
|
// TODO: Provide benchmarking on test running-time
|
|
|
|
#include <jtest/jtest.hpp>
|
|
|
|
void TestA() { jtest::check("Bruh" == "Bruh"); }
|
|
void TestB() { jtest::check(6*6 == 36); }
|
|
void TestC() { jtest::check(6+9 == 69); }
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
|
|
TEST("Test1", []{
|
|
jtest::check(2+2 == 4);
|
|
});
|
|
|
|
TEST("Test2", [] {
|
|
//jtest::check(2+2 == 5);
|
|
jtest::check(2+2 == 4);
|
|
});
|
|
|
|
TEST("Test3", []
|
|
{
|
|
jtest::check(6+9 == 69);
|
|
//jtest::check(2+2 == 4);
|
|
});
|
|
|
|
/*
|
|
TEST("Test4", []
|
|
{
|
|
assert(false);
|
|
});
|
|
*/
|
|
|
|
TEST("TestGroup::A", TestA);
|
|
TEST("TestGroup::B", TestB);
|
|
TEST("TestGroup::C", TestC);
|
|
|
|
jtest::run_tests();
|
|
} |