--- /dev/null
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+*.sto
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+check
+template
+
+# Libraries
+*.a
+*.so
+*.dylib
+*.lib
+*.dll
+
+# Depend files
+*.d
+
+# Subdirectories
+obj/
+build/
+CMakeFiles/
+
+# Make stuff
+CMakeCache.txt
+cmake_install.cmake
+CmakeLists.txtt
+*.sh
+
+# swap files
+*.sw*
+
+# krita
+*.kra
+*.kra~
+*.png~
+
+# Valgrind log
+log
--- /dev/null
+# test-template
+
+template repo for quickly creating testable modules
+
+## usage
+* create a new repo with [generate](https://github.com/AbyssalThistle/test-template/generate)
+* add the new repo as a git submodule into your codebase
+* navigate to the submodule directory and run `./init_tests $module` where
+`$module` is the name of your cecse module, this should match your include headers.
--- /dev/null
+#include "check_template.h"
+#include "template.h"
+#include <check.h>
+
+static void setup()
+{
+}
+
+static void teardown()
+{
+}
+
+START_TEST(test_template)
+{
+}
+END_TEST
+
+Suite *template_suite(void)
+{
+ Suite *s;
+ TCase *tc;
+
+ s = suite_create("template suite");
+ tc = tcase_create("template");
+
+ tcase_add_unchecked_fixture(tc, setup, teardown);
+ tcase_add_test(tc, test_template);
+
+ suite_add_tcase(s, tc);
+ return s;
+}
--- /dev/null
+#pragma once
+#include <check.h>
+Suite * template_suite(void);
--- /dev/null
+#!/bin/bash
+
+function error()
+{
+ echo "provide a name"
+ exit 1
+}
+
+function init()
+{
+ echo "renaming template file & lines to $1"
+ upper=$(echo $1 | tr '[:lower:]' '[:upper:]')
+ under=$(echo $1 | tr '-' '_')
+ dashes=$(echo $1 | tr '_' '-')
+
+ mv check_template.h check_$under.h
+ mv check_template.c check_$under.c
+ find . -type f -name '*.[c|h]' -exec sed -i "s/template/$under/g" {} +
+ sed -i "s/template/$dashes/g" .gitignore
+ sed -i "s/TEMPLATE/$upper/g" module.mk
+
+ # clearing README
+ echo "# test-$dashes" > README.md
+}
+
+# do we have a name parameter?
+[ $# -eq 1 ] && init $1 || error
+rm -- "$0"
+
+# clearing up source control
+git rm check_template.c check_template.h $0
+git add check_$under.c check_$under.h README.md .gitignore main.c
+
+git commit -m "initilised repo"
+git push
--- /dev/null
+#include "runner.h"
+#include "check_template.h"
+#include <stdlib.h>
+
+int main()
+{
+ int failed_count = run_suite_forkless(template_suite());
+ return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
--- /dev/null
+#include "runner.h"
+#include <check.h>
+
+int run_suite(Suite *s)
+{
+ int failed_count = 0;
+ SRunner *sr = srunner_create(s);
+ srunner_run_all(sr, CK_NORMAL);
+ failed_count += srunner_ntests_failed(sr);
+ srunner_free(sr);
+ return failed_count;
+}
+
+int run_suite_forkless(Suite *s)
+{
+ int failed_count = 0;
+ SRunner *sr = srunner_create(s);
+ srunner_set_fork_status(sr, CK_NOFORK);
+ srunner_run_all(sr, CK_NORMAL);
+ failed_count += srunner_ntests_failed(sr);
+ srunner_free(sr);
+ return failed_count;
+}
--- /dev/null
+#pragma once
+#include <check.h>
+int run_suite(Suite *s);
+int run_suite_forkless(Suite *s);