#!/bin/bash
-
-# This file is part of mutest, a micro testing framework for C.
#
-# mutest is under the BOLA license, please see the LICENSE file or visit
+# This file is part of mutest, a simple micro unit testing framework for C.
+#
+# mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+# under the BOLA license, please see the LICENSE file or visit:
# http://blitiri.com.ar/p/bola/
#
-# This is a simple script to generate a C file that runs all the test cases
+# This is a simple script to generate a C file that runs all the test suites
# present in .o files passed as arguments.
#
# Please, read the README file for more details.
+#
# the trick here is getting all the test cases present in an object file using
+/*
+ * This file is part of mutest, a simple micro unit testing framework for C.
+ *
+ * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+ * under the BOLA license, please see the LICENSE file or visit:
+ * http://blitiri.com.ar/p/bola/
+ *
+ * This is the main program, it runs all the test suites and shows the
+ * results. The main work (of running the test suite) is done by the (usually)
+ * synthesized mu_run_suites() function, which can be generated using the
+ * mkmutest script (or written manually).
+ *
+ * Please, read the README file for more details.
+ */
#include "mutest.h" /* MU_* constants, mu_print() */
#include <stdio.h> /* printf(), fprintf() */
+/*
+ * This file is part of mutest, a simple micro unit testing framework for C.
+ *
+ * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+ * under the BOLA license, please see the LICENSE file or visit:
+ * http://blitiri.com.ar/p/bola/
+ *
+ * This header file should be included in the source files that will make up
+ * a test suite. If you implement your mu_run_suites() function yourself, you
+ * probably will need to include this header too (see mkmutest).
+ *
+ * Please, read the README file for more details.
+ */
#include <stdio.h> /* fprintf() */
#!/usr/bin/env python
+#
+# This file is part of mutest, a simple micro unit testing framework for C.
+#
+# mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+# under the BOLA license, please see the LICENSE file or visit:
+# http://blitiri.com.ar/p/bola/
+#
+# This is a Python implementation of the mutest main idea. This script load
+# the dynamic shared object (.so file) passed as argument, search them for test
+# cases and run them, collecting statistics.
+#
+# Please, read the README file for more details.
+#
import re
from sys import stdout, stderr
+/*
+ * This file is part of mutest, a simple micro unit testing framework for C.
+ *
+ * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+ * under the BOLA license, please see the LICENSE file or visit:
+ * http://blitiri.com.ar/p/bola/
+ *
+ * This is a Python implementation of the mutest main idea. This header file
+ * should be included in the source files that will make up a test suite, as
+ * a dynamic shared object (.so file).
+ *
+ * Please, read the README file for more details.
+ */
#include <stdio.h> /* printf(), fprintf() */
+#
+# This file is part of mutest, a simple micro unit testing framework for C.
+#
+# mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+# under the BOLA license, please see the LICENSE file or visit:
+# http://blitiri.com.ar/p/bola/
+#
+# This is the samples Makefile.
+#
+# Please, read the README file for more details.
+#
# Show the tests summary
V=-v
+/*
+ * This file is part of mutest, a simple micro unit testing framework for C.
+ *
+ * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+ * under the BOLA license, please see the LICENSE file or visit:
+ * http://blitiri.com.ar/p/bola/
+ *
+ * This is an example module that calculates a factorial.
+ *
+ * Please, read the README file for more details.
+ */
unsigned factorial(unsigned x) {
if (x <= 1)
+/*
+ * This file is part of mutest, a simple micro unit testing framework for C.
+ *
+ * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+ * under the BOLA license, please see the LICENSE file or visit:
+ * http://blitiri.com.ar/p/bola/
+ *
+ * This is the factorial module header.
+ *
+ * Please, read the README file for more details.
+ */
int factorial(int);
+/*
+ * This file is part of mutest, a simple micro unit testing framework for C.
+ *
+ * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+ * under the BOLA license, please see the LICENSE file or visit:
+ * http://blitiri.com.ar/p/bola/
+ *
+ * This is the factorial module test suite. Each (public) function starting
+ * with mu_test will be picked up by mkmutest as a test case.
+ *
+ * Please, read the README file for more details.
+ */
#include "factorial.h"
-
-/* dummy test to illustrate how a test suite initialization could fail */
+/*
+ * This file is part of mutest, a simple micro unit testing framework for C.
+ *
+ * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+ * under the BOLA license, please see the LICENSE file or visit:
+ * http://blitiri.com.ar/p/bola/
+ *
+ * This is a dummy test suite that illustrates how a test suite initialization
+ * can fail. Each (public) function starting with mu_init will be picked up
+ * by mkmutest as an initialization function and executed unless one fails
+ * (returns != 0). Functions starting with mu_test will be used as test cases,
+ * but since an initialization function fails, none will be executed.
+ *
+ * Please, read the README file for more details.
+ */
#ifdef MUTEST_PY
#include "../py/mutest.h"
+/*
+ * This file is part of mutest, a simple micro unit testing framework for C.
+ *
+ * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+ * under the BOLA license, please see the LICENSE file or visit:
+ * http://blitiri.com.ar/p/bola/
+ *
+ * This is an example module that calculates the addition of two integers.
+ *
+ * Please, read the README file for more details.
+ */
int sum(int x, int y) {
return x + y;
+/*
+ * This file is part of mutest, a simple micro unit testing framework for C.
+ *
+ * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+ * under the BOLA license, please see the LICENSE file or visit:
+ * http://blitiri.com.ar/p/bola/
+ *
+ * This is the sum module header.
+ *
+ * Please, read the README file for more details.
+ */
int sum(int, int);
-
-/* see factorial_test.c for more complete examples, this file is mostly to show
- * how to have multiple test suites, test suite initialization and
- * termination, and a test suite that succeed. */
+/*
+ * This file is part of mutest, a simple micro unit testing framework for C.
+ *
+ * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
+ * under the BOLA license, please see the LICENSE file or visit:
+ * http://blitiri.com.ar/p/bola/
+ *
+ * This is the sum module test suite. It shows how to have multiple test
+ * suites, test suite initialization and termination, and a test suite that
+ * succeed. Each (public) function starting with mu_init will be picked up by
+ * mkmutest as an initialization function and executed unless one fails
+ * (returns != 0) Functions starting with mu_term will be used as termination
+ * functions, called after all test cases were executed. Functions starting
+ * with mu_test will be used as test cases.
+ *
+ * Please, read the README file for more details.
+ */
#include "sum.h"
#include <stdlib.h> /* malloc(), free() */