2023-11-07 15:29:08 -05:00
|
|
|
/*
|
|
|
|
|
|
|
|
9unit
|
|
|
|
Copyright (C) Jonathan Lamothe <jonathan@jlamothe.net>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
2023-11-09 18:24:48 -05:00
|
|
|
it under the terms of the GNU Lesser General Public License as
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
License, or (at your option) any later version.
|
2023-11-07 15:29:08 -05:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2023-11-09 18:24:48 -05:00
|
|
|
Lesser General Public License for more details.
|
2023-11-07 15:29:08 -05:00
|
|
|
|
2023-11-09 18:24:48 -05:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this program. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>.
|
2023-11-07 15:29:08 -05:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <u.h>
|
|
|
|
#include <libc.h>
|
|
|
|
|
2023-11-07 18:44:53 -05:00
|
|
|
#include "../9unit.h"
|
2023-11-07 19:20:33 -05:00
|
|
|
#include "initial-state.h"
|
2023-11-08 18:38:42 -05:00
|
|
|
#include "run-test.h"
|
2023-11-10 15:30:44 -05:00
|
|
|
#include "append-test-log.h"
|
2023-11-15 18:46:25 -05:00
|
|
|
#include "test-context.h"
|
2023-11-07 18:44:53 -05:00
|
|
|
|
|
|
|
// Internal Prototypes
|
|
|
|
|
|
|
|
static void tests(TestState *);
|
|
|
|
|
|
|
|
// Public Functions
|
|
|
|
|
2023-11-07 15:29:08 -05:00
|
|
|
void
|
|
|
|
main()
|
|
|
|
{
|
2023-11-08 17:10:09 -05:00
|
|
|
run_tests(tests);
|
2023-11-07 15:29:08 -05:00
|
|
|
exits(0);
|
|
|
|
}
|
|
|
|
|
2023-11-07 18:44:53 -05:00
|
|
|
// Internal Functions
|
|
|
|
|
|
|
|
static void
|
|
|
|
tests(TestState *s)
|
|
|
|
{
|
|
|
|
if (!s) exits("ERROR: no TestState");
|
|
|
|
|
2023-11-19 23:50:42 -05:00
|
|
|
// Make a copy of the initial TestState
|
2023-11-07 18:44:53 -05:00
|
|
|
TestState scpy;
|
|
|
|
memcpy(&scpy, s, sizeof(TestState));
|
|
|
|
|
2023-11-19 23:50:42 -05:00
|
|
|
test_context_with(s, "initial state", test_initial_state, &scpy);
|
2023-11-21 00:12:41 -05:00
|
|
|
test_context(s, "run_test()", test_run_test);
|
2023-11-19 23:50:42 -05:00
|
|
|
test_context(s, "append_test_log()", test_append_test_log);
|
2023-11-15 18:46:25 -05:00
|
|
|
test_context(s, "test_context()", test_test_context);
|
2023-11-07 18:44:53 -05:00
|
|
|
}
|
|
|
|
|
2023-11-07 15:29:08 -05:00
|
|
|
//jl
|