From: Leandro Lucarella Date: Wed, 10 Dec 2008 13:54:04 +0000 (-0200) Subject: Add license and a description to all the sources X-Git-Tag: 1.0~10 X-Git-Url: https://git.llucax.com/software/mutest.git/commitdiff_plain/cb606e44a187f9ece06dfd134e9ded8cdcf8f1b8 Add license and a description to all the sources --- diff --git a/mkmutest b/mkmutest index c6b941b..32c0e5a 100755 --- a/mkmutest +++ b/mkmutest @@ -1,14 +1,16 @@ #!/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 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 diff --git a/mutest.c b/mutest.c index 291fdd4..00dd7b8 100644 --- a/mutest.c +++ b/mutest.c @@ -1,3 +1,17 @@ +/* + * This file is part of mutest, a simple micro unit testing framework for C. + * + * mutest was written by Leandro Lucarella 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 /* printf(), fprintf() */ diff --git a/mutest.h b/mutest.h index 938918f..159625b 100644 --- a/mutest.h +++ b/mutest.h @@ -1,3 +1,16 @@ +/* + * This file is part of mutest, a simple micro unit testing framework for C. + * + * mutest was written by Leandro Lucarella 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 /* fprintf() */ diff --git a/py/mutest b/py/mutest index 8535523..b9a4042 100755 --- a/py/mutest +++ b/py/mutest @@ -1,4 +1,17 @@ #!/usr/bin/env python +# +# This file is part of mutest, a simple micro unit testing framework for C. +# +# mutest was written by Leandro Lucarella 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 diff --git a/py/mutest.h b/py/mutest.h index ace3b9c..8c42ca8 100644 --- a/py/mutest.h +++ b/py/mutest.h @@ -1,3 +1,16 @@ +/* + * This file is part of mutest, a simple micro unit testing framework for C. + * + * mutest was written by Leandro Lucarella 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 /* printf(), fprintf() */ diff --git a/sample/Makefile b/sample/Makefile index e7c764d..aa5ec8f 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -1,3 +1,14 @@ +# +# This file is part of mutest, a simple micro unit testing framework for C. +# +# mutest was written by Leandro Lucarella 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 diff --git a/sample/factorial.c b/sample/factorial.c index c178fa0..78d43e9 100644 --- a/sample/factorial.c +++ b/sample/factorial.c @@ -1,3 +1,14 @@ +/* + * This file is part of mutest, a simple micro unit testing framework for C. + * + * mutest was written by Leandro Lucarella 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) diff --git a/sample/factorial.h b/sample/factorial.h index a2d71d2..0fb6f29 100644 --- a/sample/factorial.h +++ b/sample/factorial.h @@ -1,3 +1,14 @@ +/* + * This file is part of mutest, a simple micro unit testing framework for C. + * + * mutest was written by Leandro Lucarella 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); diff --git a/sample/factorial_test.c b/sample/factorial_test.c index 0e0191a..8dc56a8 100644 --- a/sample/factorial_test.c +++ b/sample/factorial_test.c @@ -1,3 +1,15 @@ +/* + * This file is part of mutest, a simple micro unit testing framework for C. + * + * mutest was written by Leandro Lucarella 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" diff --git a/sample/init_fail_test.c b/sample/init_fail_test.c index c92bd7d..b3c7475 100644 --- a/sample/init_fail_test.c +++ b/sample/init_fail_test.c @@ -1,5 +1,18 @@ - -/* 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 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" diff --git a/sample/sum.c b/sample/sum.c index 4d45974..94fd492 100644 --- a/sample/sum.c +++ b/sample/sum.c @@ -1,3 +1,14 @@ +/* + * This file is part of mutest, a simple micro unit testing framework for C. + * + * mutest was written by Leandro Lucarella 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; diff --git a/sample/sum.h b/sample/sum.h index 4f90d44..42ad86f 100644 --- a/sample/sum.h +++ b/sample/sum.h @@ -1,3 +1,14 @@ +/* + * This file is part of mutest, a simple micro unit testing framework for C. + * + * mutest was written by Leandro Lucarella 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); diff --git a/sample/sum_test.c b/sample/sum_test.c index 7ef32e8..505f814 100644 --- a/sample/sum_test.c +++ b/sample/sum_test.c @@ -1,7 +1,20 @@ - -/* 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 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 /* malloc(), free() */