From: tsntsumi Date: Wed, 18 Aug 2010 12:41:26 +0000 (+0000) Subject: rewrite X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=49869b309855f54f653e3542b6f9fd1a80e5b0d6;p=ccunit%2Fccunit.git rewrite --- diff --git a/doc/cookbook.dox b/doc/cookbook.dox index 983184a..7729efd 100644 --- a/doc/cookbook.dox +++ b/doc/cookbook.dox @@ -173,6 +173,22 @@ different results. °Û¤Ê¤ë·ë²Ì¤òÄ´¤Ù¤ë¤³¤È¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£ @~ +@dot +digraph TestFixture { + node [ fontsize=9, fontname=Helvetica ] + edge [ fontsize=9, dir=back, arrowtail=vee ] + gv [ label="Global variables", shape=box ] + { rank=same; + su [ label="setUp ()" ]; + tc [ label="TestCase" ]; + td [ label="tearDown ()" ]; + } + gv -> su [ label="initialize" ]; + gv -> tc [ label="access" ]; + gv -> td [ label="clean-up" ]; +} +@enddot + @~english When you have a common fixture, here is what you do: @~japanese @@ -219,27 +235,11 @@ When you have a common fixture, here is what you do: @~japanese @link CCUnitTestCase TestCase @endlink ¥ª¥Ö¥¸¥§¥¯¥È¤ò @link CCUnitTestFixture TestFixture @endlink - ¥Õ¥£¥¯¥¹¥Á¥ã¥ª¥Ö¥¸¥§¥¯¥È¤ËÅÐÏ¿¤·¤Þ¤¹¡£ + ¥ª¥Ö¥¸¥§¥¯¥È¤ËÅÐÏ¿¤·¤Þ¤¹¡£ @~ -@dot -digraph TestFixture { - node [ fontsize=9, fontname=Helvetica ] - edge [ fontsize=9, dir=back, arrowtail=vee ] - gv [ label="Global variables", shape=box ] - { rank=same; - su [ label="setUp ()" ]; - tc [ label="TestCase" ]; - td [ label="tearDown ()" ]; - } - gv -> su [ label="initialize" ]; - gv -> tc [ label="access" ]; - gv -> td [ label="clean-up" ]; -} -@enddot - @~english For example, to write several test cases, first create a fixture: @@ -271,8 +271,8 @@ void tearDown_complex_test () complex_delete (s11_2); } -... - +int main () +{ CCUnitTestFixture* fixture; fixture = ccunit_newTestFixture ("complex test", CCUNIT_NEWTESTFUNC(setUp_complex_test), @@ -318,6 +318,10 @@ void test_complex_equals () ... +int main () +{ + ... + ccunit_addNewTestCase (fixture, "test_complex_equals", "complex equals test", @@ -334,6 +338,23 @@ One may create and run objects for each test case like this: @code CCUnitTestResult* result; result = ccunit_runTestFixture (fixture); + return 0; +} +@endcode + +@english +The sample code made in the above is in the directory examples/complex, +the files testComplex.c and runTestFixture.c. +@japanese +¤³¤³¤Þ¤Ç¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï¡¢examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Î +testComplex.c, runTestFixture.c ¤Ë¤¢¤ê¤Þ¤¹¡£ + +¥³¥ó¥Ñ¥¤¥ë¤ª¤è¤Ó¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£ +@endif + +@code +$ gcc -I. -o runTestFixture runTestFixture.c testComplex.c complex.c -lccunit +$ ./runTestFixture @endcode @~english @@ -344,8 +365,8 @@ no diagnostics will be displayed. One will normally use a display the results. @~japanese ¥Æ¥¹¥È¥Õ¥£¥¯¥¹¥Á¥ã¤¬¼Â¹Ô¤µ¤ì¤ë¤È¡¢ -ÆÃÄê¤Î¥Æ¥¹¥È´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£ -¤³¤ì¤Ï¤¢¤Þ¤êÊØÍø¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡¢ +»ØÄꤷ¤¿¥Æ¥¹¥È´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£ +¤³¤ì¤Ï¤Þ¤À¤¢¤Þ¤êÊØÍø¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡¢ ¤Ê¤¼¤Ê¤é¡¢¿ÇÃǤ¬É½¼¨¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¹¡£ Ä̾ï¤Ï @link ExecutingTest TestRunner @endlink (@ref test_runner ¸å½Ò) @@ -394,21 +415,25 @@ To create a suite of two or more tests, you do the following: @~ @code -CCUnitTestSuite* suite; -CCUnitTestFixture* fixture; -CCUnitTestResult* result; -suite = ccunit_newTestSuite ("Complex test suite"); -fixture = ccunit_newTestFixture ("Complex Tests", - CCUNIT_NEWTESTFUNC(setUp_complex_test), - CCUNIT_NEWTESTFUNC(tearDown_complex_test)); -ccunit_addNewTestCase (fixture, "test_complex_equals", "complex equals test", - test_complex_equals); -ccunit_addNewTestCase (fixture, "test_complex_add", "complex add test", - test_complex_add); -ccunit_addNewTestCase (fixture, "test_complex_sub", "complex sub test", - test_complex_sub); -ccunit_addTestFixture (suite, fixtuer); -result = ccunit_runTestSuite (suite, NULL); +int main () +{ + CCUnitTestSuite* suite; + CCUnitTestFixture* fixture; + CCUnitTestResult* result; + suite = ccunit_newTestSuite ("Complex test suite"); + fixture = ccunit_newTestFixture ("Complex Tests", + CCUNIT_NEWTESTFUNC(setUp_complex_test), + CCUNIT_NEWTESTFUNC(tearDown_complex_test)); + ccunit_addNewTestCase (fixture, "test_complex_equals", "complex equals test", + test_complex_equals); + ccunit_addNewTestCase (fixture, "test_complex_add", "complex add test", + test_complex_add); + ccunit_addNewTestCase (fixture, "test_complex_sub", "complex sub test", + test_complex_sub); + ccunit_addTestFixture (suite, fixtuer); + result = ccunit_runTestSuite (suite, NULL); + return 0; +} @endcode @~english @@ -442,14 +467,30 @@ contains both: @~ @code -CCUnitTestSuite* suite; -CCUnitTestResult* result; -suite = ccunit_newTestSuite ("Complex add/sub/mul/div test suite"); -ccunit_addTestSuite (suite, complex_add_sub_suite ()); -ccunit_addTestSuite (suite, complex_mul_div_suite ()); -result = ccunit_runTestSuite(suite, NULL); + CCUnitTestSuite* suite; + CCUnitTestResult* result; + suite = ccunit_newTestSuite ("Complex add/sub/mul/div test suite"); + ccunit_addTestSuite (suite, complex_add_sub_suite ()); + ccunit_addTestSuite (suite, complex_mul_div_suite ()); + result = ccunit_runTestSuite(suite, NULL); @endcode +@english +The sample code made in the above is in the directory examples/complex, +the files testComplex.c, testComplexMulDiv.c, +complexTestSuite.c and runTestSuite.c. +@japanese +¤³¤³¤Þ¤Ç¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï¡¢examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Î +testComplex.c, testComplexMulDiv.c, complexTestSuite.c, runTestSuite.c +¤Ë¤¢¤ê¤Þ¤¹¡£ + +¥³¥ó¥Ñ¥¤¥ë¤ª¤è¤Ó¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£ +@endif + +@code +$ gcc -I. -o runTestSuite runTestSuite.c testComplex.c testComplexMulDiv.c complexTestSuite.c complex.c -lccunit +$ ./runTestSuite +@endcode @english @section test_runner TestRunner @@ -465,48 +506,22 @@ How do you run your tests and collect their results? @~english Once you have a test suite, you'll want to run it. %CCUnit -provides tools to define the suite to be run and to display -its results. You make your suite accessible to a @link -CreatingTestSuite ccunit_makeSuite @endlink tool that generate a -creating test suite code. +provides @link ExecutingTest TestRunner @endlink +to define the suite to be run and to display +its results. @~japanese °ì¤Ä¥Æ¥¹¥È¥¹¡¼¥Ä¤ò½ñ¤¤¤¿¤é¡¢ ¤½¤ì¤ò¼Â¹Ô¤·¤¿¤¤¤Ç¤·¤ç¤¦¡£ CCUnit ¤Ï¥¹¡¼¥Ä¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤ËÄêµÁ¤·¡¢ -·ë²Ì¤òɽ¼¨¤¹¤ë¤¿¤á¤Î¥Ä¡¼¥ë¤òÄ󶡤·¤Þ¤¹¡£ -¥¹¡¼¥Ä¤ò @link CreatingTestSuite ccunit_makeSuite @endlink -¥Ä¡¼¥ë¤ËÆþÎϤǤ­¤ë¤è¤¦¤Ê·Á¼°¤Ç½ñ¤¯¤³¤È¤Ç¡¢ -¥Æ¥¹¥È¥¹¡¼¥Ä¤òºîÀ®¤¹¤ë¥³¡¼¥É¤ò¼«Æ°Åª¤ËÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +·ë²Ì¤òɽ¼¨¤¹¤ë¤¿¤á¤Î@link ExecutingTest TestRunner @endlink¤òÄ󶡤·¤Þ¤¹¡£ @~ @~english -For example, to make a ComplexTest suite available to a -@link CreatingTestSuite ccunit_makeSuite @endlink, -excute the following tool to -testComplex.c: +To use the @link CCUnitTestRunner TestRunner @endlink, +include the header files for the tests in runTestRunner.c: @~japanese -Î㤨¤Ð¡¢ComplexTest ¥¹¡¼¥Ä¤ò -@link CreatingTestSuite ccunit_makeSuite @endlink -¤ò»È¤Ã¤Æ»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢ -°Ê²¼¤Î¥Ä¡¼¥ë¤ò testComplex.c ¤Ë¼Â¹Ô¤·¤Þ¤¹¡£ -@~ - -@code -$ ccunit_makeSuite -f complex_suite -o suiteComplex.c testComplex.c -@endcode - -@anchor test_runner_code -@~english -@~japanese -complex_suite ¤È¤¤¤¦´Ø¿ô¤¬ÄêµÁ¤µ¤ì¤¿¡¢ -suiteComplex.c ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£ -@~ - -@~english -To use the TestRunner, include the header files for the tests in runTest.c: -@~japanese -TestRunner ¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢ -Î㤨¤Ð runTest.c ¤Ç¥Æ¥¹¥È¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤Î¥Ø¥Ã¥À¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Þ¤¹¡£ +@link CCUnitTestRunner TestRunner @endlink ¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢ +Î㤨¤Ð runTestRunner.c ¤Ç¥Æ¥¹¥È¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤Î¥Ø¥Ã¥À¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Þ¤¹¡£ @~ @code @@ -526,18 +541,41 @@ ccunit_runTestRunner (CCUnitTestRunner*, CCUnitTestSuite *) @endlink @~ @code -extern CCUnitTestSuite* complex_suite(const char* name); +extern CCUnitTestSuite* complex_add_sub_suite (); +extern CCUnitTestSuite* complex_mul_div_suite (); int main( int argc, char **argv) { CCUnitTestRunner* runner; CCUnitTestSuite* suite; + suite = ccunit_newTestSuite ("complex test suite"); + ccunit_addTestSuite (suite, complex_add_sub_suite ()); + ccunit_addTestSuite (suite, complex_mul_div_suite ()); runner = ccunit_newTestRunner (stdout); - suite = complex_suite ("complex test suite"); return ccunit_runTestRunner (runner, suite); } @endcode +@english +The sample code made in the above is in the directory examples/complex, +the files testComplex.c, complexTestSuite.c and runTestRunner.c. +@japanese +¤³¤³¤Þ¤Ç¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï¡¢examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Î +testComplex.c, complexTestSuite.c, runTestRunner.c +¤Ë¤¢¤ê¤Þ¤¹¡£ + +¥³¥ó¥Ñ¥¤¥ë¤ª¤è¤Ó¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£ +@endif + +@code +$ gcc -I. -o runTestRunner runTestRunner.c testComplex.c testComplexMulDiv.c complexTestSuite.c complex.c -lccunit +$ ./runTestRunner +..... +Time: 0.000066 sec + +OK (5 tests) +@endcode + @~english The @link ExecutingTest TestRunner @endlink will run the tests. If all the tests pass, you'll get an informative message. @@ -545,7 +583,7 @@ If any fail, you'll get the following information: @~japanese @link ExecutingTest TestRunner @endlink ¤Ï¥Æ¥¹¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£ ¤â¤·¤¹¤Ù¤Æ¤Î¥Æ¥¹¥È¤¬¥Ñ¥¹¤¹¤ì¤Ð¡¢¤½¤Î¾ðÊó¤Î¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ -¤â¤·¤É¤ì¤«¤¬¼ºÇÔ¤¹¤ì¤Ð¡¢¤½¤ì¤Ë¤Ä¤¤¤Æ°Ê²¼¤Î¤è¤¦¤Ê¾ðÊó¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ +¤É¤ì¤«¤¬¼ºÇÔ¤¹¤ì¤Ð¡¢¤½¤ì¤Ë¤Ä¤¤¤Æ°Ê²¼¤Î¤è¤¦¤Ê¾ðÊó¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ @~ @english +@japanese +»î¤·¤Ë @c testComplex.c ¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Ç¤ï¤¶¤È´Ö°ã¤¨¤Æ¤ß¤Þ¤·¤ç¤¦¡£ +!complex_equals ¤Î ! ¤ò¤È¤Ã¤Æ¤ß¤Þ¤¹¡£ +@endif + +@code +//* testComplex.c *\/ +//** test equals *\/ +void test_complex_equals () +{ + CCUNIT_ASSERT_TEST_OBJ (s10_1, complex_equals, s10_1, complex_to_string); +//*CCUNIT_ASSERT_TEST_OBJ (s10_1, !complex_equals, s1_1, complex_to_string);*\/ + CCUNIT_ASSERT_TEST_OBJ (s10_1, complex_equals, s1_1, complex_to_string); +} +@endcode + +@code +$ gcc -I. -o runTestRunner runTestRunner.c testComplex.c testComplexMulDiv.c complexTestSuite.c complex.c -lccunit +$ ./runTestRunner +.F.... +Time: 0.000059 sec + +FAILURES!!! +Test Results: +Run 5, Failures 1 +There was 1 failure: +testComplex.c:53: complex equals test: + complex_equals (s10_1, s1_1) + expect: 10+1i + actual: 1+1i +@endcode + + +@english @section helper_macros Helper Tool @japanese @section helper_macros ¥Ø¥ë¥Ñ¡¼¥Ä¡¼¥ë @@ -591,7 +663,7 @@ command have been created to automatically implements the @~japanese ¤ªµ¤¤Å¤­¤Î¤è¤¦¤Ë¡¢¥Õ¥£¥¯¥¹¥Á¥ã¤Î suite ()´Ø¿ô¤ò¼ÂÁõ¤¹¤ë¤Î¤Ï¡¢ È¿ÉüŪ¤Ç´Ö°ã¤¤¤ä¤¹¤¤ºî¶È¤Ç¤¹¡£ -@ref CreatingTestSuite ¤Î´Ø¿ô¤Î¥»¥Ã¥È¤È¥³¥Þ¥ó¥É¤Ïsuite () +@ref CreatingTestSuite ¤Î´Ø¿ô¤Î½¸¤Þ¤ê¤È¥³¥Þ¥ó¥É¤Ïsuite () ´Ø¿ô¤Î¼ÂÁõ¤ò¼«Æ°Åª¤ËºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @~ @@ -600,13 +672,9 @@ command have been created to automatically implements the @~english The following code is a rewrite of ComplexTest using those command: @~japanese -°Ê²¼¤Î¥³¡¼¥É¤Ï¤½¤ì¤é¤Î¥³¥Þ¥ó¥É¤¬»È¤¦¤è¤¦¤ËComplexTest¤ò½ñ´¹¤¨¤¿¤â¤Î¤Ç¤¹¡£ +°Ê²¼¤Î¥³¡¼¥É¤Ï¤½¤ì¤é¤Î¥³¥Þ¥ó¥É¤¬»È¤¦¤è¤¦¤Ë testComplex.c ¤ò½ñ´¹¤¨¤¿¤â¤Î¤Ç¤¹¡£ @~ -@code -#include -@endcode - @~english First, you declare the fixture, passing the test fixture name to the javaDoc style comment, which consist of a @@ -619,6 +687,8 @@ javaDoc @~ @code +#include + //** test case: complex number test *\/ @endcode @@ -631,7 +701,6 @@ name by the -f option of the Then, you define each test case of the fixture with prefix test, setUp, tearDown: - @~japanese @link CCUnitTestSuite TestSuite @endlink ¤òºîÀ®¤¹¤ë´Ø¿ô¤Ï ccunit_suite ¤Ç¤¹¡¢ @@ -701,6 +770,12 @@ Finally, you end the fixture declaration: //** end test case *\/ @endcode +@english +@japanese +¤Ò¤È¤Ä¤Î¥Õ¥¡¥¤¥ë¤ÎÃæ¤ËÊ£¿ô¤Î¥Õ¥£¥¯¥¹¥Á¥ã¤òÄêµÁ¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ +¤½¤Î¾ì¹ç¤Ï¡¢¥Õ¥£¥¯¥¹¥Á¥ã¤Î½ª¤ï¤ê¤ÎÀë¸À¤Î¸å¤Ë³¤±¤Æ¥Õ¥£¥¯¥¹¥Á¥ã¤òÄêµÁ¤·¤Æ¤¯¤À¤µ¤¤¡£ +@endif + @~english To generate creating suite function code, run ccunit_makeSuite tool. @@ -788,6 +863,24 @@ $ @endcode @english +Fixtures can be packaged into test suite. +You declare the suite before fixtures. +@japanese +¤Ê¤ª¡¢¤¤¤¯¤Ä¤«¤Î¥Õ¥£¥¯¥¹¥Á¥ã¤ò¥Æ¥¹¥È¥¹¡¼¥Ä¤Ë¤Þ¤È¤á¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ +¤½¤Î¤¿¤á¤Ë¤Ï¡¢¥Õ¥£¥¯¥¹¥Á¥ã¤ÎÄêµÁ¤ÎÁ°¤Ë¥Æ¥¹¥È¥¹¡¼¥Ä¤òÀë¸À¤·¤Þ¤¹¡£ +@endif + +@code +//** test suite: complex number test suite *\/ +//** test case: complex number equality test *\/ +... +//** test case: complex number compute test *\/ +... +@endcode + +@copydetails CCUnitMakeSuite + +@english @section post_build_check Post-build check @japanese @section post_build_check ¥Ó¥ë¥É¸å¤Î¥Á¥§¥Ã¥¯ @@ -798,8 +891,7 @@ Now that we have our unit tests running, how about integrating unit testing to our build process ? @~japanese ¤µ¤¢¥æ¥Ë¥Ã¥È¥Æ¥¹¥È¤ò¼Â¹Ô¤¹¤ë½àÈ÷¤¬¤Ç¤­¤Þ¤·¤¿¡£ -¤Ç¤Ï¥Ó¥ë¥É¥×¥í¥»¥¹¤Ë¥æ¥Ë¥Ã¥È¥Æ¥¹¥È¤òÅý¹ç¤¹¤ë¤Ë¤Ï¤É¤¦¤·¤¿¤é¤¤ -¤¤¤Ç¤·¤ç¤¦¡£ +¤Ç¤Ï¥Ó¥ë¥É¥×¥í¥»¥¹¤Ë¥æ¥Ë¥Ã¥È¥Æ¥¹¥È¤òÅý¹ç¤¹¤ë¤Ë¤Ï¤É¤¦¤·¤¿¤é¤¤¤¤¤Ç¤·¤ç¤¦¡£ @~ @~english @@ -807,7 +899,7 @@ To do that, the application must returns a value different than 0 to indicate th there was an error. @~japanese ¤½¤¦¤¹¤ë¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤³¤È¤ò¼¨¤¹ -£°°Ê³°¤ÎÃͤòÊÖ¤µ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +0 °Ê³°¤ÎÃͤòÊÖ¤µ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ @~ @~english @@ -827,13 +919,15 @@ Updating our main programm, we obtains: @code #include +extern CCUnitTestSuite* complex_suite(const char* name); + int main (int argc, char** argv) { CCUnitTestRunner* runner; CCUnitTestSuite* suite; int wasSucessful; runner = ccunit_newTestRunner (stdout); - suite = ccunit_suite (); + suite = complex_suite ("complex test suite"); wasSucessful = ccunit_runTestRunner (runner, suite); return wasSucessful; } @@ -841,10 +935,56 @@ int main (int argc, char** argv) @~english Now, you need to run your application after compilation. -The sample program made in the above is in the examples/complex directory. @~japanese ¤½¤ì¤Ç¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤¿¸å¤Ë¼Â¹Ô¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£ -°Ê¾å¤ÇºîÀ®¤·¤¿¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£ @~ +@code +$ gcc -I. -o runTest runTest.c testComplex.c suiteComplex.c complex.c -lccunit +$ ./runTest +... +Time: 0.000032 sec + +OK (3 tests) +@endcode + +@code +$ ccunit_makeSuite -f complex_suite -o suiteComplex.c testComplex.c testComplexMulDiv.c +$ gcc -I. -o runTest runTest.c testComplex.c testComplexMulDiv.c suiteComplex.c complex.c -lccunit +$ ./runTest +..... +Time: 0.000045 sec + +OK (5 tests) +@endcode + +@~english +The sample program made in the above is in the @c examples/complex directory. +@~japanese +°Ê¾å¤ÇºîÀ®¤·¤¿¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï @c examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£ +@~ + +- complex - @~english some complex number library test cases + @~japanese Ê£ÁÇ¿ô¤ò·×»»¤¹¤ë¥é¥¤¥Ö¥é¥ê¤È¤½¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Î¥µ¥ó¥×¥ë¤Ç¤¹¡£@~ + - libcomplex.a - complex number library + - complex.c + - complex.h + - runTestFixture @~japanese - ¤â¤Ã¤È¤âñ½ã¤Ê¥Æ¥¹¥È¥±¡¼¥¹¤ò¼Â¹Ô¤¹¤ë¥µ¥ó¥×¥ë¤Ç¤¹¡£@~ + - runTestFixture.c - main program + - testComplex.c - test cases + - runTestSuite @~japanese - ¥Æ¥¹¥È¥¹¡¼¥Ä¤Î¥µ¥ó¥×¥ë¤Ç¤¹¡£@~ + - runTestSuite.c - main program + - testComplex.c - test cases + - testComplexMulDiv.c - test cases + - complexTestSuite.c - create test suite function + - runTestRunner @~japanese - ¥Æ¥¹¥È¥¹¡¼¥Ä¤ò¥Æ¥¹¥È¥é¥ó¥Ê¡¼¤Ç¼Â¹Ô¤¹¤ë¥µ¥ó¥×¥ë¤Ç¤¹¡£@~ + - runTestRunner.c - main program + - testComplex.c - test cases + - testComplexMulDiv.c - test cases + - complexTestSuite.c - create test suite function + - runTest @~japanese - ¥Æ¥¹¥È¥¹¡¼¥Ä¤ò¼«Æ°À¸À®¤¹¤ë¥µ¥ó¥×¥ë¤Ç¤¹¡£@~ + - runTest.c - main program + - testComplex.c - test cases + - suiteComplex.c - auto generated test suite from testComplex.c + */