]> granicus.if.org Git - check/commitdiff
Updated docs
authoramalec <amalec@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Wed, 11 Jul 2001 20:46:08 +0000 (20:46 +0000)
committeramalec <amalec@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Wed, 11 Jul 2001 20:46:08 +0000 (20:46 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@55 64e312b2-a51f-0410-8e61-82d0ca0eb02a

check/NEWS
check/README
check/doc/example.lyx
check/rpm/check.spec
check/src/check.h
check/tests/check_check_log.c
check/tests/check_check_main.c

index 266087a34d3cc57bd33c53f35c6a4f965806fa87..bef75a632513ee301b60134d0611e0c7e97a1794 100644 (file)
@@ -1,12 +1,36 @@
+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
index 7b7c1bc552b25f3249a9b4694fca757b51fcd553..aaf8e6952efe7921a2b21e95d5f9c279ed9ba4f8 100644 (file)
@@ -1 +1,9 @@
-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.
index 6c8a4e5371ddfb6f849223aaf4c28daa570b4748..f99a40a0adecb9e62258cf77bb476ec47d4c726d 100644 (file)
@@ -30,7 +30,7 @@ Check Tutorial
 Arien Malec
 \layout Date
 
-29 May, 2001
+11 July, 2001
 \layout Standard
 
 
@@ -602,7 +602,7 @@ The code in main bears some explanation.
  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 
@@ -649,7 +649,7 @@ We will now rerun make check and...
  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 
@@ -881,12 +881,16 @@ START_TEST(test_create)
 { 
 \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
 
 } 
@@ -896,6 +900,56 @@ END_TEST
 \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
 
index c48ae521bcdf8f184b9d0e69061d41ce774a5843..a7b8b1b478c8140450e244f08c3ec28531722434 100644 (file)
@@ -1,9 +1,9 @@
 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
@@ -68,6 +68,8 @@ rm -rf ${RPM_BUILD_ROOT}
 %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>
index ff7afbf0fb055b37abb68f7ed7a852c231382a54..086e58db3ea1d4230684660fcb2e248d536de52f 100644 (file)
@@ -41,9 +41,11 @@ Suites are created with #suite_create, freed with #suite_free; test cases are ad
 
 \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.
 
 */
 
@@ -72,7 +74,7 @@ typedef struct Suite Suite;
   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 */
@@ -108,7 +110,7 @@ void _tcase_add_test (TCase *tc, TFun tf, char *fname);
    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
@@ -124,6 +126,8 @@ void __testname (int __msqid)\
 
 /*! 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 */
@@ -132,6 +136,7 @@ void _fail_unless (int msqid, int result, char *file, int line, char *msg);
 /*! 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);
 
 /*! @} */
index cf6575540ab62ac73de65a355939537e7babb0fc..ae5553311c5c8355a56d907553e57a603b96809b 100644 (file)
@@ -45,7 +45,7 @@ Suite *make_log_suite(void)
   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);
index a0aca1889f879d366b23698fe1622f04f3fa55b4..0065fbb555b082047911e543feef91f7318955e2 100644 (file)
@@ -8,10 +8,8 @@ int main (void)
   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());
@@ -22,6 +20,5 @@ int main (void)
   cleanup();
   n = srunner_ntests_failed(sr);
   srunner_free(sr);
-  suite_free(s);
   return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
 }