33 lines
1.2 KiB
C++
33 lines
1.2 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>
|
|
#include <cassert>
|
|
|
|
//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)
|
|
{
|
|
|
|
jtest::Unit ThisDick{"This Dick"};
|
|
|
|
ThisDick += jtest::Test("bawls", []{ printf("FUCK1\n"); });
|
|
|
|
ThisDick += jtest::Test("more bawls1", []{ printf("FUCK2\n"); });
|
|
|
|
ThisDick += jtest::Test("more bawls2", []{ throw("OH GOD OH FUCK"); });
|
|
|
|
ThisDick += jtest::Test("more bawls3", []{ throw("OH GOD OH FUCK2"); });
|
|
|
|
ThisDick();
|
|
} |