1 /* Copyright (C) 2003 TSUTSUMI Kikuo.
2 This file is part of the CCUnit Library.
4 The CCUnit Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public License
6 as published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
9 The CCUnit Library is distributed in the hope that it will be
10 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the CCUnit Library; see the file COPYING.LESSER.
16 If not, write to the Free Software Foundation, Inc., 59 Temple
17 Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include <ccunit/CCUnit.h>
27 * test suite: read test suite file.
31 * @defgroup testReadSuite ccuint_readSuite test.
35 * log file input stream.
39 static const char* logname = "testReadSuite.log";
41 static char line[1024];
43 /** @ingroup testReadSuite
44 * test case: read test suite init
51 void test_readSuite_init ()
55 fp = freopen (logname, "w", stderr);
56 CCUNIT_ASSERT_NOT_NULL (fp);
57 rc = ccunit_va_makeSuite ("testReadSuite", "-v",
58 "-o", "suiteReadSuite.log", "testReadSuite.c", NULL);
59 CCUNIT_ASSERT_EQ_INT (0, rc);
64 * end test case: read test suite init
67 /** @ingroup testReadSuite
68 * test case: read test suite
74 void setUp_readSuite ()
76 lfp = fopen (logname, "r");
77 CCUNIT_ASSERT_NOT_NULL (lfp);
83 void tearDown_readSuite ()
89 * test skip doxycomment.
91 void test_readSuite_skip_doxycomment ()
94 while (fgets (line, sizeof (line), lfp) != NULL)
96 char* content = strstr (line, "comment content: ");
97 if (content && strcmp (content, "comment content: "
98 "\"test suite: read test suite file.\"\n") == 0)
104 CCUNIT_ASSERT_EQ_INT (true, found);