From: Niki Roo Date: Fri, 28 Jun 2024 10:49:19 +0000 (+0200) Subject: launcher: do not use a 'main' anymore X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=9e29e2f55d36a2e05a3420825b8ecc33006a45eb;p=cutils.git launcher: do not use a 'main' anymore --- diff --git a/check/launcher.c b/check/launcher.c index cc39935..b7f6ceb 100644 --- a/check/launcher.c +++ b/check/launcher.c @@ -153,7 +153,7 @@ int test_start(int more) { return failed; } -int main(int argc, char **argv) { +int launch_tests(int argc, char **argv) { int more = 0; int cont = 1; diff --git a/check/launcher.h b/check/launcher.h index ffc45e5..eae06a3 100644 --- a/check/launcher.h +++ b/check/launcher.h @@ -1,3 +1,33 @@ +/* + * CUtils: some small C utilities + * + * Copyright (C) 2022 Niki Roo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * @file launcher.h + * @author Niki + * @date 2022 - 2024 + * + * @brief Unit test helper (based upon check) + * + * This file offers a series of help functions for the check C unit + * tests system. + */ + #ifndef _LAUNCHER_H #define _LAUNCHER_H @@ -26,6 +56,11 @@ void assert_sz(const char title[], size_t expected, size_t received); extern int launcher_color; +/** + * Return the test runner (the list of tests to run). + * + * @param more activate more, longer checks (usually memory related) + */ SRunner *get_tests(int more); void test_init(const char name[]); @@ -36,5 +71,7 @@ void test_success(); void test_failure(); +int launch_tests(int argc, char **argv); + #endif