From 2eec4c98cc47835ff410676a00c7e1796ff2da54 Mon Sep 17 00:00:00 2001
From: Camil Staps
Date: Wed, 2 Dec 2015 22:23:32 +0100
Subject: Rename CSTest to MinCTest; is more to-the-point
---
cstest.c | 67 ----------------------------------------------------------------
1 file changed, 67 deletions(-)
delete mode 100644 cstest.c
(limited to 'cstest.c')
diff --git a/cstest.c b/cstest.c
deleted file mode 100644
index 1b2a3ef..0000000
--- a/cstest.c
+++ /dev/null
@@ -1,67 +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 .
- */
-#include
-#include
-#include
-#include "cstest.h"
-
-// Colours for terminal output
-#define KRED "\x1B[31m"
-#define KGRN "\x1B[32m"
-#define RESET "\x1B[0m"
-
-cstester* test_initialize(void) {
- cstester* test = malloc(sizeof(cstester));
- if (test == NULL) return NULL;
- test->passed = 0;
- test->failed = 0;
- test->show_pass = true;
- return test;
-}
-
-void test_wrapup(cstester* tester) {
- if (tester->failed == 0) {
- printf(KGRN "\nAll tests passed (%d)\n" RESET, tester->passed);
- } else {
- printf(KRED "\n%d test%s failed" RESET " (%d passed)\n",
- tester->failed, tester->failed > 1 ? "s" : "", tester->passed);
- }
-}
-
-void test_destroy(cstester* tester) {
- free(tester);
-}
-
-void test_exit(cstester* tester) {
- bool all_passed = tester->failed == 0;
- test_destroy(tester);
- exit(all_passed ? 0 : -1);
-}
-
-void test_true(cstester* tester, bool check, const char* text) {
- if (!check || tester->show_pass) {
- printf(check ? KGRN : KRED);
- printf(check ? "Test passed" : "Test failed");
- if (text != NULL)
- printf(": %s", text);
- printf("\n" RESET);
- }
-
- *(check ? &tester->passed : &tester->failed) += 1;
-}
-
--
cgit v1.2.3