diff options
author | Camil Staps | 2015-12-02 22:23:32 +0100 |
---|---|---|
committer | Camil Staps | 2015-12-02 22:23:32 +0100 |
commit | 2eec4c98cc47835ff410676a00c7e1796ff2da54 (patch) | |
tree | 2eab519f2fcdd27b2ede172534cf6161624f15ab /cstest.h | |
parent | First version (diff) |
Rename CSTest to MinCTest; is more to-the-point
Diffstat (limited to 'cstest.h')
-rw-r--r-- | cstest.h | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/cstest.h b/cstest.h deleted file mode 100644 index 6fb3280..0000000 --- a/cstest.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * CSTest - Minimalistic C unit test framework - * Copyright (C) 2015 Camil Staps - - * 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 <http://www.gnu.org/licenses/>. - */ -#include <inttypes.h> -#include <stdbool.h> - -typedef struct { - uint16_t passed; // Number of passed tests - uint16_t failed; // Number of failed tests - bool show_pass; // Whether or not to print a message when a test passes -} cstester; - -/** - * Initialize a tester struct - * - * This allocates a cstester on the heap. Don't forget to call test_destroy to - * free that memory. - * - * @return a struct on the heap for use in the other test_* functions - */ -cstester* test_initialize(void); - -/** - * Show summarised data about the tester - * - * Shows a green message when all tests passed, otherwise a red message that - * some failed. Shows passed/failed counts as well. - * - * @param cstester* a pointer to a cstester from test_initialize - */ -void test_wrapup(cstester*); - -/** - * Destroy a cstester struct - * - * Essentially frees the memory that was allocated for the struct. - * - * @param cstester* a pointer to a cstester from test_initialize - */ -void test_destroy(cstester*); - -/** - * Exit the program with an appropriate return value - * - * Returns -1 if one or more tests failed, 0 otherwise. Exits the program. - * - * @param cstester* a pointer to a cstester from test_initialize - * @return don't expect this to return - */ -void test_exit(cstester*); - -/** - * Test for truth on a bool - * - * Outputs a red message for failure, and a green one for passing if - * cstester->show_pass is true. Adds this test to the summarised data in the - * cstester. - * - * @param cstester* a pointer to a cstester from test_initialize - * @param check the boolean that should be true - * @param test a custom message to show - */ -void test_true(cstester* tester, bool check, const char* text); - |