+Wed Jul 11, 2001:
+Released Check 0.7.0
+
+Included a primitive logging function (at the moment, it only prints a
+copy of the CRVERBOSE output to the log file), added the ability for
+an SRunner to run multiple suites (and reorganized the Check tests to
+take advantage of that), and added the magic to allow Check to be used
+with C++.
+
+Also added Doxygen markup to the header file, but I'm not terribly
+satisfied withe clarity of the output. I may switch to CWEB... Next
+release should include API docs and improved logging, if nothing else
+comes up...
+
+
Wed Jun 27, 2001:
+
Released Check 0.6.1
-Bug fix for srunner_failures (bad version actually returned all results), added srunner_results to do what srunner_failures used to do, and added corrected unit tests for both.
-Also changed the API for reporting the number of failed tests from srunner_nfailed to srunner_ntests_failed, to harmonized better with new function srunner_ntests_run. This unfortunately may break some unit tests slightly -- that's why the major release number is 0 :-)
+Bug fix for srunner_failures (bad version actually returned all
+results), added srunner_results to do what srunner_failures used to
+do, and added corrected unit tests for both.
+
+Also changed the API for reporting the number of failed tests from
+srunner_nfailed to srunner_ntests_failed, to harmonized better with
+new function srunner_ntests_run. This unfortunately may break some
+unit tests slightly -- that's why the major release number is 0 :-)
Thu Jun 21, 2001:
Released Check 0.6.0
-Features improved unit test reporting options, more complete unit tests, and end-to-end test, and a full API into TestResults
+
+Features improved unit test reporting options, more complete unit
+tests, and end-to-end test, and a full API into TestResults
Check 0.5.2
Minor edits
-A simple library for performing unit tests. See check_check.c and check_list.c for examples of unit tests using this library; do a make check to see some example output.
+Check is a unit test framework for C. It features a simple interface
+for defining unit tests, putting little in the way of the
+developer. Tests are run in a separate address space, so Check can
+catch both assertion failures and code errors that cause segmentation
+faults or other signals. The output from unit tests can be used within
+source code editors and IDEs.
+
+See http://check.sourceforge.net for more information, including a
+tutorial.
Arien Malec
\layout Date
-29 May, 2001
+11 July, 2001
\layout Standard
Let's rerun make check now: we get the following satisfying output:
\layout Code
-Running suite: Money
+Running suite(s): Money
\layout Code
0%: Checks: 1, Failures: 1, Errors: 0
What's this? The output is now as follows:
\layout Code
-Running suite: Money
+Running suite(s): Money
\layout Code
0%: Checks: 1, Failures: 0, Errors: 1
{
\layout Code
- fail_unless (money_amount(five_dollars) == 5, "Amount not set correctly
- on creation");
+ fail_unless (money_amount(five_dollars) == 5,
\layout Code
- fail_unless (strcmp(money_currency(five_dollars),"USD") == 0, "Currency
- not set correctly on creation");
+ "Amount not set correctly on creation");
+\layout Code
+
+ fail_unless (strcmp(money_currency(five_dollars),"USD") == 0,
+\layout Code
+
+ "Currency not set correctly on creation");
\layout Code
}
\end_deeper
\layout Subsection
+Multiple suites run through the same SRunner
+\layout Standard
+
+In a large program, it will be convenient to create mutiple suites, each
+ testing a module of the program.
+ While one can create several test programs, each running one Suite, it
+ may be convenient to create one main test program, and use it to run multiple
+ suites.
+ The Check test suite provides an example of how to do this.
+ The main testing program is called check_check, and has a header file that
+ declares suite creation functions for all the module tests:
+\layout Code
+
+Suite *make_sub_suite(void);
+\layout Code
+
+Suite *make_sub2_suite(void);
+\layout Code
+
+Suite *make_master_suite(void);
+\layout Code
+
+Suite *make_list_suite(void);
+\layout Code
+
+Suite *make_msg_suite(void);
+\layout Code
+
+Suite *make_log_suite(void);
+\layout Standard
+
+The function srunner_add_suite is used to add additional suites to an SRunner.
+ Here is the code to setup and run the SRunner in the main function:
+\layout Code
+
+SRunner *sr;
+\layout Code
+
+sr = srunner_create (make_master_suite());
+\layout Code
+
+srunner_add_suite(sr, make_list_suite());
+\layout Code
+
+srunner_add_suite(sr, make_msg_suite());
+\layout Code
+
+srunner_add_suite(sr, make_log_suite());
+\layout Subsection
+
Conclusion
\layout Standard
Summary: A unit test framework for C
Name: check
-Version: 0.6.1
+Version: 0.7.0
Release: 1
Epoch: 1
-Source: http://prdownloads.sourceforge.net/check/check-0.6.1.tar.gz
+Source: http://prdownloads.sourceforge.net/check/check-0.7.0.tar.gz
Group: Development/Tools
Copyright: GPL
URL: http://check.sourceforge.net
%doc %{_prefix}/share/doc/%{name}-%{version}/money/config.h.in
%changelog
+* Tue Jul 10 2001 Arien Malec <arien_malec@yahoo.com>
+- Updated for 0.7.0
* Wed Jun 27 2001 Arien Malec <arien_malec@yahoo.com>
- Updated for 0.6.1
* Thu Jun 21 2001 Arien Malec <arien_malec@yahoo.com>
\subsection running Running suites
-\par Suites are run through an SRunner, which is created with #srunner_create, freed with #srunner_free
+\par
+Suites are run through an SRunner, which is created with #srunner_create, freed with #srunner_free. Additional suites can be added to an SRunner with #srunner_add_suite.
-\par Use #srunner_run_all to run a suite and print results.
+\par
+Use #srunner_run_all to run a suite and print results.
*/
For the moment, test cases can only be run through a suite */
typedef struct TCase TCase;
-/* type for a test function */
+/*! type for a test function */
typedef void (*TFun) (int);
/*! type for a setup/teardown function */
exit or signal (e.g., segfault) */
void tc_set_fixture(TCase *tc, SFun setup, SFun teardown);
-/* Internal functions to mark the start and end of a test function */
+/*! Internal function to mark the start of a test function */
void tcase_fn_start (int msqid, char *fname, char *file, int line);
/*! Start a unit test with START_TEST(unit_name), end with END_TEST
/*! Fail the test case unless result is true */
#define fail_unless(result,msg) _fail_unless(__msqid,result,__FILE__,__LINE__,msg)
+
+/*! Non macro version of #fail_unless, with more complicated interface */
void _fail_unless (int msqid, int result, char *file, int line, char *msg);
/*! Always fail */
/*! Mark the last point reached in a unit test
(useful for tracking down where a segfault, etc. occurs */
#define mark_point() _mark_point(__msqid,__FILE__,__LINE__)
+/*! Non macro version of #mark_point */
void _mark_point (int msqid, char *file, int line);
/*! @} */
Suite *s;
TCase *tc_core;
- s = suite_create("Log Suite");
+ s = suite_create("Log");
tc_core = tcase_create("Core");
suite_add_tcase(s, tc_core);
int n;
- Suite *s;
SRunner *sr;
- s = make_master_suite();
- sr = srunner_create (s);
+ sr = srunner_create (make_master_suite());
srunner_add_suite(sr, make_list_suite());
srunner_add_suite(sr, make_msg_suite());
srunner_add_suite(sr, make_log_suite());
cleanup();
n = srunner_ntests_failed(sr);
srunner_free(sr);
- suite_free(s);
return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}