OSDN Git Service

TestRunner example
authortsntsumi <tsntsumi@users.sourceforge.jp>
Fri, 20 Aug 2010 23:22:08 +0000 (23:22 +0000)
committertsntsumi <tsntsumi@users.sourceforge.jp>
Fri, 20 Aug 2010 23:22:08 +0000 (23:22 +0000)
examples/complex/runTestCaseRunner.c [new file with mode: 0644]

diff --git a/examples/complex/runTestCaseRunner.c b/examples/complex/runTestCaseRunner.c
new file mode 100644 (file)
index 0000000..cde0713
--- /dev/null
@@ -0,0 +1,49 @@
+/* Copyright (C) 2003 TSUTSUMI Kikuo.
+   This file is part of the CCUnit Library.
+
+   The CCUnit Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License
+   as published by the Free Software Foundation; either version 2.1 of
+   the License, or (at your option) any later version.
+
+   The CCUnit Library is distributed in the hope that it will be
+   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the CCUnit Library; see the file COPYING.LESSER.
+   If not, write to the Free Software Foundation, Inc., 59 Temple
+   Place - Suite 330, Boston, MA 02111-1307, USA.  
+*/
+
+/*
+ * $Id$
+ */
+
+#include <ccunit/CCUnitTestCase.h>
+#include <ccunit/CCUnitTestSuite.h>
+#include <ccunit/CCUnitTestRunner.h>
+
+extern void test_complex_new ();
+extern void test_complex_equals ();
+
+int main ()
+{
+  CCUnitTestCase* testCase;
+  CCUnitTestSuite* suite;
+  CCUnitTestRunner* runner;
+  testCase = ccunit_newTestCase ("complex test");
+  ccunit_addNewTestFunc (testCase,
+                         "test_complex_new",
+                         "test new",
+                         test_complex_new);
+  ccunit_addNewTestFunc (testCase, 
+                         "test_complex_equals",
+                         "complex equals test",
+                         test_complex_equals);
+  suite = ccunit_newTestSuite ("complex test suite");
+  ccunit_addTestCase (suite, testCase);
+  runner = ccunit_newTestRunner (stdout);
+  return ccunit_runTestRunner (runner, suite);
+}