Files
jtest/main.cpp
2024-08-21 19:28:56 -04:00

43 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
/// 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 <jtest/Unit.hpp>
#include <jlog/Logger.hpp>
#include <jtest/jtest.hpp>
#include <cassert>
int main(int argc, char** argv)
{
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();
}