• R/O
  • HTTP
  • SSH
  • HTTPS

ccunit: Commit

A C Unit Test Library for C language.


Commit MetaInfo

Revisiond894e8d05a0a32b9238f22037bfff5ab2c139709 (tree)
Time2010-08-19 20:44:17
Authortsntsumi <>
Commitertsntsumi <>

Log Message

This commit was manufactured by cvs2svn to create tag 'rel-1_2'.

Sprout from master 2010-08-18 04:20:08 UTC tsutsumi 'revert some macros'
Cherrypick from master 2010-08-19 11:44:16 UTC tsutsumi 'specify whether setUp/tearDown isn't necessarily needed.':

doc/cookbook.dox
doc/mainpage.dox

Change Summary

Incremental Difference

--- a/doc/cookbook.dox
+++ b/doc/cookbook.dox
@@ -129,9 +129,24 @@ What if you have two or more tests that operate on the same
129129 similar set of objects?
130130 @~japanese
131131 もし二つ以上のテストがあるなら、
132-同じ類似のデータのセットで操作するのではないでしょうか。
132+同じ類似のデータの集まりで操作するのではないでしょうか。
133133 @~
134134
135+@dot
136+digraph TestCase {
137+ node [ fontsize=9, fontname=Helvetica ]
138+ edge [ fontsize=9, dir=back, arrowtail=vee ]
139+ gv [ label="Global variables", shape=box ]
140+ { rank=same;
141+ tc1 [ label="Test case 1" ];
142+ tcn [ label="Test case n" ];
143+ }
144+ gv -> tc1;
145+ gv -> tcn;
146+ tc1 -> tcn [ style=dotted, arrowtail=none ];
147+}
148+@enddot
149+
135150 @~english
136151 Tests need to run against the background of a known set of
137152 objects. This set of objects is called a test fixture. When
@@ -139,7 +154,7 @@ you are writing tests you will often find that you spend
139154 more time writing the code to set up the fixture than you do
140155 in actually testing values.
141156 @~japanese
142-テストは周知のデータのセットを背景にして実行される必要があります。
157+テストは周知のデータの集まりを背景にして実行される必要があります。
143158 このデータのセットをフィクスチャと呼ぶことにします。
144159 テストを書いていると、
145160 実際のテストする値をフィクスチャにセットアップするコードを書く方に、
@@ -155,9 +170,25 @@ different results.
155170 多くの場合、いくつかの異なったテストのために同じフィクスチャを使うことができます。
156171 それぞれのテストケースは少し異なったメッセージ、
157172 あるいはパラメータをフィクスチャに送り、
158-異なる結果を調べます。
173+異なる結果を調べることになるでしょう。
159174 @~
160175
176+@dot
177+digraph TestFixture {
178+ node [ fontsize=9, fontname=Helvetica ]
179+ edge [ fontsize=9, dir=back, arrowtail=vee ]
180+ gv [ label="Global variables", shape=box ]
181+ { rank=same;
182+ su [ label="setUp ()" ];
183+ tc [ label="TestCase" ];
184+ td [ label="tearDown ()" ];
185+ }
186+ gv -> su [ label="initialize" ];
187+ gv -> tc [ label="access" ];
188+ gv -> td [ label="clean-up" ];
189+}
190+@enddot
191+
161192 @~english
162193 When you have a common fixture, here is what you do:
163194 @~japanese
@@ -195,7 +226,7 @@ When you have a common fixture, here is what you do:
195226 <li>@~english
196227 Create a @link CCUnitTestFixture TestFixture @endlink object
197228 @~japanese
198- @link CCUnitTestFixture CCUnitTestFixture @endlink
229+ @link CCUnitTestFixture TestFixture @endlink
199230 構造体にメモリを割り当てます
200231 @~
201232 </li>
@@ -204,7 +235,7 @@ When you have a common fixture, here is what you do:
204235 @~japanese
205236 @link CCUnitTestCase TestCase @endlink オブジェクトを
206237 @link CCUnitTestFixture TestFixture @endlink
207- フィクスチャオブジェクトに登録します。
238+ オブジェクトに登録します。
208239 @~
209240 </li>
210241 </ol>
@@ -240,8 +271,8 @@ void tearDown_complex_test ()
240271 complex_delete (s11_2);
241272 }
242273
243-...
244-
274+int main ()
275+{
245276 CCUnitTestFixture* fixture;
246277 fixture = ccunit_newTestFixture ("complex test",
247278 CCUNIT_NEWTESTFUNC(setUp_complex_test),
@@ -287,6 +318,10 @@ void test_complex_equals ()
287318
288319 ...
289320
321+int main ()
322+{
323+ ...
324+
290325 ccunit_addNewTestCase (fixture,
291326 "test_complex_equals",
292327 "complex equals test",
@@ -303,6 +338,42 @@ One may create and run objects for each test case like this:
303338 @code
304339 CCUnitTestResult* result;
305340 result = ccunit_runTestFixture (fixture);
341+ return 0;
342+}
343+@endcode
344+
345+@english
346+Calling sequence of test cases in a fixture is following:
347+@japanese
348+ひとつのフィクスチャの中のテストケースの実行シーケンスは次のようになります。
349+@endif
350+
351+@dot
352+digraph FixtureCallingSequence {
353+ node [ fontsize=9, fontname=Helvetica ]
354+ edge [ fontsize=9 ]
355+ rankdir = LR;
356+ setUp -> "TestCase 1" -> tearDown;
357+ setUp2 [ label="setUp" ];
358+ tearDown2 [ label="tearDown" ];
359+ setUp2 -> "TestCase n" -> tearDown2;
360+ tearDown -> setUp2 [ style=dotted ];
361+}
362+@enddot
363+
364+@english
365+The sample code made in the above is in the directory <code>examples/complex</code>,
366+the files <code>testComplex.c</code> and <code>runTestFixture.c</code>.
367+@japanese
368+ここまでのサンプルコードは、<code>examples/complex</code> ディレクトリの
369+<code>testComplex.c, runTestFixture.c</code> にあります。
370+
371+コンパイルおよび実行するには、次のようにします。
372+@endif
373+
374+@code
375+$ gcc -I. -o runTestFixture runTestFixture.c testComplex.c complex.c -lccunit
376+$ ./runTestFixture
306377 @endcode
307378
308379 @~english
@@ -313,8 +384,8 @@ no diagnostics will be displayed. One will normally use a
313384 display the results.
314385 @~japanese
315386 テストフィクスチャが実行されると、
316-特定のテスト関数が呼び出されます。
317-これはあまり便利ではありません、
387+指定したテスト関数が呼び出されます。
388+これはまだあまり便利ではありません、
318389 なぜなら、診断が表示されないからです。
319390 通常は @link ExecutingTest TestRunner @endlink
320391 (@ref test_runner 後述)
@@ -334,6 +405,20 @@ Once you have several tests, organize them into a suite.
334405 @section suite スーツ
335406 @endif
336407
408+@dot
409+digraph TestStructure {
410+ node [ fontsize=9, fontname=Helvetica ];
411+ edge [ dir=back, fontsize=9 ];
412+ TestSuite -> TestSuite [ label="1..n" ];
413+ TestFixture;
414+ TestSuite -> TestFixture [ label="1..n" ];
415+ TestFixture -> setUp [ label="0..1" ];
416+ TestCase;
417+ TestFixture -> TestCase [ label="1..n" ];
418+ TestFixture -> tearDown [ label="0..1" ];
419+}
420+@enddot
421+
337422 @~english
338423 How do you set up your tests so that you can run them all at once?
339424 @~japanese
@@ -363,21 +448,25 @@ To create a suite of two or more tests, you do the following:
363448 @~
364449
365450 @code
366-CCUnitTestSuite* suite;
367-CCUnitTestFixture* fixture;
368-CCUnitTestResult* result;
369-suite = ccunit_newTestSuite ("Complex test suite");
370-fixture = ccunit_newTestFixture ("Complex Tests",
371- CCUNIT_NEWTESTFUNC(setUp_complex_test),
372- CCUNIT_NEWTESTFUNC(tearDown_complex_test));
373-ccunit_addNewTestCase (fixture, "test_complex_equals", "complex equals test",
374- test_complex_equals);
375-ccunit_addNewTestCase (fixture, "test_complex_add", "complex add test",
376- test_complex_add);
377-ccunit_addNewTestCase (fixture, "test_complex_sub", "complex sub test",
378- test_complex_sub);
379-ccunit_addTestFixture (suite, fixtuer);
380-result = ccunit_runTestSuite (suite, NULL);
451+int main ()
452+{
453+ CCUnitTestSuite* suite;
454+ CCUnitTestFixture* fixture;
455+ CCUnitTestResult* result;
456+ suite = ccunit_newTestSuite ("Complex test suite");
457+ fixture = ccunit_newTestFixture ("Complex Tests",
458+ CCUNIT_NEWTESTFUNC(setUp_complex_test),
459+ CCUNIT_NEWTESTFUNC(tearDown_complex_test));
460+ ccunit_addNewTestCase (fixture, "test_complex_equals", "complex equals test",
461+ test_complex_equals);
462+ ccunit_addNewTestCase (fixture, "test_complex_add", "complex add test",
463+ test_complex_add);
464+ ccunit_addNewTestCase (fixture, "test_complex_sub", "complex sub test",
465+ test_complex_sub);
466+ ccunit_addTestFixture (suite, fixtuer);
467+ result = ccunit_runTestSuite (suite, NULL);
468+ return 0;
469+}
381470 @endcode
382471
383472 @~english
@@ -411,14 +500,30 @@ contains both:
411500 @~
412501
413502 @code
414-CCUnitTestSuite* suite;
415-CCUnitTestResult* result;
416-suite = ccunit_newTestSuite ("Complex add/sub/mul/div test suite");
417-ccunit_addTestSuite (suite, complex_add_sub_suite ());
418-ccunit_addTestSuite (suite, complex_mul_div_suite ());
419-result = ccunit_runTestSuite(suite, NULL);
503+ CCUnitTestSuite* suite;
504+ CCUnitTestResult* result;
505+ suite = ccunit_newTestSuite ("Complex add/sub/mul/div test suite");
506+ ccunit_addTestSuite (suite, complex_add_sub_suite ());
507+ ccunit_addTestSuite (suite, complex_mul_div_suite ());
508+ result = ccunit_runTestSuite(suite, NULL);
420509 @endcode
421510
511+@english
512+The sample code made in the above is in the directory <code>examples/complex</code>,
513+the files <code>testComplex.c</code>, <code>testComplexMulDiv.c</code>,
514+<code>complexTestSuite.c</code> and <code>runTestSuite.c</code>.
515+@japanese
516+ここまでのサンプルコードは、<code>examples/complex</code> ディレクトリの
517+<code>testComplex.c, testComplexMulDiv.c, complexTestSuite.c, runTestSuite.c</code>
518+にあります。
519+
520+コンパイルおよび実行するには、次のようにします。
521+@endif
522+
523+@code
524+$ gcc -I. -o runTestSuite runTestSuite.c testComplex.c testComplexMulDiv.c complexTestSuite.c complex.c -lccunit
525+$ ./runTestSuite
526+@endcode
422527
423528 @english
424529 @section test_runner TestRunner
@@ -428,54 +533,47 @@ result = ccunit_runTestSuite(suite, NULL);
428533
429534 @~english
430535 How do you run your tests and collect their results?
536+The fixtures store result of own tests into
537+the @link CCUnitTestResult TestResult @endlink.
431538 @~japanese
432539 どうやってテストを実行し、その結果を集めたら良いでしょうか。
540+フィクスチャはテストケースの実行結果を
541+@link CCUnitTestResult TestResult @endlink に格納します。
433542 @~
434543
544+@dot
545+digraph TestResult {
546+ node [ fontsize=9, fontname=Helvetica ]
547+ { rank=same;
548+ edge [ fontsize=9, fontname=Courier ]
549+ TestFixture -> TestResult [ label="TestFailure", style=dotted, arrowhead=vee ];
550+ }
551+ edge [ fontsize=9, dir=back ]
552+ TestFixture -> setUp;
553+ TestFixture -> "TestCase 1..n";
554+ TestFixture -> tearDown;
555+ TestResult -> "TestFailure 0..m";
556+}
557+@enddot
558+
435559 @~english
436560 Once you have a test suite, you'll want to run it. %CCUnit
437-provides tools to define the suite to be run and to display
438-its results. You make your suite accessible to a @link
439-CreatingTestSuite ccunit_makeSuite @endlink tool that generate a
440-creating test suite code.
561+provides @link ExecutingTest TestRunner @endlink
562+to define the suite to be run and to display
563+its results.
441564 @~japanese
442565 一つテストスーツを書いたら、
443566 それを実行したいでしょう。
444567 CCUnit はスーツを実行するために定義し、
445-結果を表示するためのツールを提供します。
446-スーツを @link CreatingTestSuite ccunit_makeSuite @endlink
447-ツールに入力できるような形式で書くことで、
448-テストスーツを作成するコードを自動的に生成することができます。
449-@~
450-
451-@~english
452-For example, to make a ComplexTest suite available to a
453-@link CreatingTestSuite ccunit_makeSuite @endlink,
454-excute the following tool to
455-testComplex.c:
456-@~japanese
457-例えば、ComplexTest スーツを
458-@link CreatingTestSuite ccunit_makeSuite @endlink
459-を使って使用できるようにするには、
460-以下のツールを testComplex.c に実行します。
461-@~
462-
463-@code
464-$ ccunit_makeSuite -f complex_suite -o suiteComplex.c testComplex.c
465-@endcode
466-
467-@anchor test_runner_code
468-@~english
469-@~japanese
470-<code>complex_suite</code> という関数が定義された、
471-<code>suiteComplex.c</code> というファイルが作成されます。
568+結果を表示するための @link ExecutingTest TestRunner @endlink を提供します。
472569 @~
473570
474571 @~english
475-To use the TestRunner, include the header files for the tests in runTest.c:
572+To use the @link CCUnitTestRunner TestRunner @endlink,
573+include the header files for the tests in runTestRunner.c:
476574 @~japanese
477-TestRunner を使用するには、
478-例えば runTest.c でテストのためのファイルのヘッダをインクルードします。
575+@link CCUnitTestRunner TestRunner @endlink を使用するには、
576+例えば runTestRunner.c でテストのためのファイルのヘッダをインクルードします。
479577 @~
480578
481579 @code
@@ -495,18 +593,41 @@ ccunit_runTestRunner (CCUnitTestRunner*, CCUnitTestSuite *) @endlink
495593 @~
496594
497595 @code
498-extern CCUnitTestSuite* complex_suite(const char* name);
596+extern CCUnitTestSuite* complex_add_sub_suite ();
597+extern CCUnitTestSuite* complex_mul_div_suite ();
499598
500599 int main( int argc, char **argv)
501600 {
502601 CCUnitTestRunner* runner;
503602 CCUnitTestSuite* suite;
603+ suite = ccunit_newTestSuite ("complex test suite");
604+ ccunit_addTestSuite (suite, complex_add_sub_suite ());
605+ ccunit_addTestSuite (suite, complex_mul_div_suite ());
504606 runner = ccunit_newTestRunner (stdout);
505- suite = complex_suite ("complex test suite");
506607 return ccunit_runTestRunner (runner, suite);
507608 }
508609 @endcode
509610
611+@english
612+The sample code made in the above is in the directory <code>examples/complex</code>,
613+the files <code>testComplex.c, complexTestSuite.c</code> and <code>runTestRunner.c</code>.
614+@japanese
615+ここまでのサンプルコードは、<code>examples/complex</code> ディレクトリの
616+<code>testComplex.c, complexTestSuite.c, runTestRunner.c</code>
617+にあります。
618+
619+コンパイルおよび実行するには、次のようにします。
620+@endif
621+
622+@code
623+$ gcc -I. -o runTestRunner runTestRunner.c testComplex.c testComplexMulDiv.c complexTestSuite.c complex.c -lccunit
624+$ ./runTestRunner
625+.....
626+Time: 0.000066 sec
627+
628+OK (5 tests)
629+@endcode
630+
510631 @~english
511632 The @link ExecutingTest TestRunner @endlink will run the tests.
512633 If all the tests pass, you'll get an informative message.
@@ -514,7 +635,12 @@ If any fail, you'll get the following information:
514635 @~japanese
515636 @link ExecutingTest TestRunner @endlink はテストを実行します。
516637 もしすべてのテストがパスすれば、その情報のメッセージが表示されます。
517-もしどれかが失敗すれば、それについて以下のような情報が表示されます。
638+上の例では、最初の「<code>.....</code>」は実行したテストケースです。
639+実行する直前に「<code>.</code>」が出力されます。
640+全てのテストケースの実行が終了すると、
641+実行にかかった時間と実行したテストケースの数が表示されます。
642+
643+どれかが失敗すれば、それについて以下のような情報が表示されます。
518644 @~
519645
520646 <ul>
@@ -546,6 +672,54 @@ If any fail, you'll get the following information:
546672 </ul>
547673
548674 @english
675+@japanese
676+試しに @c testComplex.c のテストケースでわざと間違えてみましょう。
677+<code>!complex_equals</code> の <code>!</code> をとってみます。
678+@endif
679+
680+@code
681+//* testComplex.c *\/
682+//** test equals *\/
683+void test_complex_equals ()
684+{
685+ CCUNIT_ASSERT_TEST_OBJ (s10_1, complex_equals, s10_1, complex_to_string);
686+//*CCUNIT_ASSERT_TEST_OBJ (s10_1, !complex_equals, s1_1, complex_to_string);*\/
687+ CCUNIT_ASSERT_TEST_OBJ (s10_1, complex_equals, s1_1, complex_to_string);
688+}
689+@endcode
690+
691+@code
692+$ gcc -I. -o runTestRunner runTestRunner.c testComplex.c testComplexMulDiv.c complexTestSuite.c complex.c -lccunit
693+$ ./runTestRunner
694+.F....
695+Time: 0.000059 sec
696+
697+FAILURES!!!
698+Test Results:
699+Run 5, Failures 1
700+There was 1 failure:
701+testComplex.c:53: complex equals test:
702+ complex_equals (s10_1, s1_1)
703+ expect: 10+1i
704+ actual: 1+1i
705+@endcode
706+
707+@english
708+@japanese
709+この例ではテストケースを 5 個実行して、
710+ひとつのテストケースで失敗していることがわかります。
711+最初の「<code>.F....</code>」では、
712+ひとつ目のテストケースが失敗していることをあらわしています。
713+
714+また上述のように、
715+失敗したファイル名、行番号、テストケースの名前 (<code>complex equals test</code>)、
716+表明した条件の文字列 (<code>complex_equals (s10_1, s1_1)</code>)、
717+期待した値 (<code>10+1i</code>)、
718+実際の値 (<code>1+1i</code>)
719+が表示されます。
720+@endif
721+
722+@english
549723 @section helper_macros Helper Tool
550724 @japanese
551725 @section helper_macros ヘルパーツール
@@ -560,7 +734,7 @@ command have been created to automatically implements the
560734 @~japanese
561735 お気づきのように、フィクスチャの <code>suite ()</code>関数を実装するのは、
562736 反復的で間違いやすい作業です。
563-@ref CreatingTestSuite の関数のセットとコマンドは<code>suite ()</code>
737+@ref CreatingTestSuite の関数の集まりとコマンドは<code>suite ()</code>
564738 関数の実装を自動的に作成することができます。
565739 @~
566740
@@ -569,13 +743,9 @@ command have been created to automatically implements the
569743 @~english
570744 The following code is a rewrite of ComplexTest using those command:
571745 @~japanese
572-以下のコードはそれらのコマンドが使うようにComplexTestを書換えたものです。
746+以下のコードはそれらのコマンドが使うように testComplex.c を書換えたものです。
573747 @~
574748
575-@code
576-#include <ccunit/CCUnitAssert.h>
577-@endcode
578-
579749 @~english
580750 First, you declare the fixture, passing the test fixture
581751 name to the javaDoc style comment, which consist of a
@@ -588,6 +758,8 @@ javaDoc
588758 @~
589759
590760 @code
761+#include <ccunit/CCUnitAssert.h>
762+
591763 //** test case: complex number test *\/
592764 @endcode
593765
@@ -600,7 +772,6 @@ name by the <code>-f</code> option of the
600772 Then, you define each test case of the fixture with prefix
601773 <code>test</code>, <code>setUp</code>,
602774 <code>tearDown</code>:
603-
604775 @~japanese
605776 @link CCUnitTestSuite TestSuite @endlink
606777 を作成する関数は <code>ccunit_suite</code> です、
@@ -670,6 +841,12 @@ Finally, you end the fixture declaration:
670841 //** end test case *\/
671842 @endcode
672843
844+@english
845+@japanese
846+ひとつのファイルの中に複数のフィクスチャを定義することもできます。
847+その場合は、フィクスチャの終わりの宣言の後に続けてフィクスチャを定義してください。
848+@endif
849+
673850 @~english
674851 To generate creating suite function code, run
675852 <code>ccunit_makeSuite</code> tool.
@@ -757,6 +934,24 @@ $
757934 @endcode
758935
759936 @english
937+Fixtures can be packaged into test suite.
938+You declare the suite before fixtures.
939+@japanese
940+なお、いくつかのフィクスチャをテストスーツにまとめることもできます。
941+そのためには、フィクスチャの定義の前にテストスーツを宣言します。
942+@endif
943+
944+@code
945+//** test suite: complex number test suite *\/
946+//** test case: complex number equality test *\/
947+...
948+//** test case: complex number compute test *\/
949+...
950+@endcode
951+
952+@copydetails CCUnitMakeSuite
953+
954+@english
760955 @section post_build_check Post-build check
761956 @japanese
762957 @section post_build_check ビルド後のチェック
@@ -767,8 +962,7 @@ Now that we have our unit tests running, how about
767962 integrating unit testing to our build process ?
768963 @~japanese
769964 さあユニットテストを実行する準備ができました。
770-ではビルドプロセスにユニットテストを統合するにはどうしたらい
771-いでしょう。
965+ではビルドプロセスにユニットテストを統合するにはどうしたらいいでしょう。
772966 @~
773967
774968 @~english
@@ -776,7 +970,7 @@ To do that, the application must returns a value different than 0 to indicate th
776970 there was an error.
777971 @~japanese
778972 そうするには、アプリケーションは、エラーが発生したことを示す
779-0以外の値を返さなければなりません。
973+0 以外の値を返さなければなりません。
780974 @~
781975
782976 @~english
@@ -796,13 +990,15 @@ Updating our main programm, we obtains:
796990 @code
797991 #include <ccunit/CCUnitTestRunner.h>
798992
993+extern CCUnitTestSuite* complex_suite(const char* name);
994+
799995 int main (int argc, char** argv)
800996 {
801997 CCUnitTestRunner* runner;
802998 CCUnitTestSuite* suite;
803999 int wasSucessful;
8041000 runner = ccunit_newTestRunner (stdout);
805- suite = ccunit_suite ();
1001+ suite = complex_suite ("complex test suite");
8061002 wasSucessful = ccunit_runTestRunner (runner, suite);
8071003 return wasSucessful;
8081004 }
@@ -810,10 +1006,56 @@ int main (int argc, char** argv)
8101006
8111007 @~english
8121008 Now, you need to run your application after compilation.
813-The sample program made in the above is in the examples/complex directory.
8141009 @~japanese
8151010 それではアプリケーションをコンパイルした後に実行してみましょう。
816-以上で作成したサンプルプログラムは examples/complex ディレクトリにあります。
8171011 @~
8181012
1013+@code
1014+$ gcc -I. -o runTest runTest.c testComplex.c suiteComplex.c complex.c -lccunit
1015+$ ./runTest
1016+...
1017+Time: 0.000032 sec
1018+
1019+OK (3 tests)
1020+@endcode
1021+
1022+@code
1023+$ ccunit_makeSuite -f complex_suite -o suiteComplex.c testComplex.c testComplexMulDiv.c
1024+$ gcc -I. -o runTest runTest.c testComplex.c testComplexMulDiv.c suiteComplex.c complex.c -lccunit
1025+$ ./runTest
1026+.....
1027+Time: 0.000045 sec
1028+
1029+OK (5 tests)
1030+@endcode
1031+
1032+@~english
1033+The sample program made in the above is in the @c examples/complex directory.
1034+@~japanese
1035+以上で作成したサンプルプログラムは @c examples/complex ディレクトリにあります。
1036+@~
1037+
1038+- complex - @~english some complex number library test cases
1039+ @~japanese 複素数を計算するライブラリとそのテストケースのサンプルです。@~
1040+ - libcomplex.a - complex number library
1041+ - complex.c
1042+ - complex.h
1043+ - runTestFixture @~japanese - もっとも単純なテストケースを実行するサンプルです。@~
1044+ - runTestFixture.c - main program
1045+ - testComplex.c - test cases
1046+ - runTestSuite @~japanese - テストスーツのサンプルです。@~
1047+ - runTestSuite.c - main program
1048+ - testComplex.c - test cases
1049+ - testComplexMulDiv.c - test cases
1050+ - complexTestSuite.c - create test suite function
1051+ - runTestRunner @~japanese - テストスーツをテストランナーで実行するサンプルです。@~
1052+ - runTestRunner.c - main program
1053+ - testComplex.c - test cases
1054+ - testComplexMulDiv.c - test cases
1055+ - complexTestSuite.c - create test suite function
1056+ - runTest @~japanese - テストスーツを自動生成するサンプルです。@~
1057+ - runTest.c - main program
1058+ - testComplex.c - test cases
1059+ - suiteComplex.c - auto generated test suite from testComplex.c
1060+
8191061 */
--- a/doc/mainpage.dox
+++ b/doc/mainpage.dox
@@ -197,24 +197,105 @@ This library is released under the GNU
197197
198198 */
199199
200-/** @defgroup WritingTestFixture Writing test fixture
200+/**
201+ * @english
202+ * @defgroup Construction
203+ * CCUnit manages test suites, test fixtures, test cases.
204+ * @japanese
205+ * @defgroup Construction 構成
206+ * CCUnit はテストスーツ、テストフィクスチャ、テストケースを管理します。
207+ * @endif
208+ * @dot
209+digraph CCUnitTestStructure {
210+ node [ fontsize=9, fontname=Helvetica ];
211+ edge [ dir=back, fontsize=9 ];
212+ TestSuite -> TestSuite [ label="1..n" ];
213+ TestSuite -> TestFixture [ label="1..n" ];
214+ TestFixture -> setUp [ label="0..1" ];
215+ TestFixture -> TestCase [ label="1..n" ];
216+ TestFixture -> tearDown [ label="0..1" ];
217+}
218+ * @enddot
219+ *
220+ * @english
221+ * Test cases are packaged into a fixture. Fixtures packaged
222+ * into a suite. And suites are packaged into a suite.
223+ * Fixtures can have @c setUp and @c tearDown functions
224+ * which are called before and after running the test cases.
225+ * @japanese
226+ * いくつかのテストケースはテストフィクスチャにまとめられ、
227+ * またいくつかのテストフィクスチャはテストスーツにまとめられます。
228+ * そしてテストスーツもまたテストスーツにまとめられます。
229+ * テストスーツを実行すると、それにまとめられているテストスーツ、
230+ * テストフィクスチャが順番に実行されます。
231+ * テストフィクスチャには @c setUp と @c tearDown 関数を登録することができ、
232+ * テストフィクスチャが実行される際には、
233+ * それぞれのテストケースを実行する前と後に、
234+ * @c setUp と @c teaDown が自動的に実行されます。
235+ * @ endif
201236 */
202237
203-/** @defgroup Assertions Making assertions
238+/**
239+ * @english
240+ * @defgroup Assertions Making assertions
241+ * @japanese
242+ * @defgroup Assertions アサートの宣言
243+ * テストケースで使用するアサートマクロです。
244+ * @endif
204245 */
205246
206-/** @defgroup CreatingTestSuite Creating TestSuite
247+/**
248+ * @english
249+ * @defgroup WritingTestFixture Writing test fixture
250+ * @japanese
251+ * @defgroup WritingTestFixture テストフィクスチャを書く
252+ * 一連のテストケースを、
253+ * 準備をする関数と後処理をする関数でまとめたものをフィクスチャと呼びます。
254+ * @endif
255+ */
256+
257+/**
258+ * @english
259+ * @defgroup CreatingTestSuite Creating TestSuite
260+ * @japanese
261+ * @defgroup CreatingTestSuite テストスーツの生成
262+ * いくつかのテストフィクスチャやテストスーツをまとめて、
263+ * ひとつのテストスーツにします。
264+ * @endif
207265 * @sa CCUnitMakeSuite
208266 */
209267
210-/** @defgroup ExecutingTest Executing test
268+/**
269+ * @english
270+ * @defgroup ExecutingTest Executing test
271+ * @japanese
272+ * @defgroup ExecutingTest テストの実行
273+ * テストスーツを実行します。
274+ * @endif
211275 */
212276
213-/** @defgroup TrackingTestExecution Tracking test execution
277+/**
278+ * @english
279+ * @defgroup TrackingTestExecution Tracking test execution
280+ * @japanese
281+ * @defgroup TrackingTestExecution テストの実行の追跡
282+ * テストの実行を追跡します。
283+ * @endif
214284 */
215285
216-/** @defgroup BrowsingCollectedTestResult Browsing collected test result
286+/**
287+ * @english
288+ * @defgroup BrowsingCollectedTestResult Browsing collected test result
289+ * @japanese
290+ * @defgroup BrowsingCollectedTestResult テスト結果の参照
291+ * テスト結果を参照します。
292+ * @endif
217293 */
218294
219-/** @defgroup ModuleHierarchy Module hierarchy
295+/**
296+ * @english
297+ * @defgroup ModuleHierarchy Module hierarchy
298+ * @japanese
299+ * @defgroup ModuleHierarchy モジュール階層
300+ * @endif
220301 */
Show on old repository browser