/// 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 // 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: Provide benchmarking on test running-time #include #include #include #include int main(int argc, char** argv) { mcolor::windowsSaneify(); jtest::Unit u{"jtest-demo"}; u += jtest::Test{"check_true", [] () { jtest::check(true); }}; u += jtest::Test{"check_false", [] () { jtest::check(false); }}; u += jtest::Test{"check floats", [] () { jtest::check_float_eq(5.01, 5.09, 0.1); }}; u += jtest::Test{"balls", [] () { //jlog::Debug("ass"); }}; u += jtest::Test{"balls", [] () { //jlog::Debug("ass"); }}; u += jtest::Test{"balls", [] () { //jlog::Debug("ass"); }}; u += jtest::Test{"dsads", [](){throw("thisdick");}}; u.Invoke(); }