FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
testlibs.c
1 /*********************************************************************
2 Copyright (C) 2011 Hewlett-Packard Development Company, L.P.
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 version 2 as published by the Free Software Foundation.
7 
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 *********************************************************************/
21 #include <libfocunit.h>
22 #include <libfodbreposysconf.h>
23 
24 /* ************************************************************************** */
25 /* * test case sets * */
26 /* * when adding the tests for a library, simply add the "extern" * */
27 /* * declaration and add it to the suites array * */
28 /* ************************************************************************** */
29 
30 char* dbConf;
31 
32 extern CU_TestInfo fossconfig_testcases[];
33 extern CU_TestInfo fossscheduler_testcases[];
34 extern CU_TestInfo libfossdb_testcases[];
35 extern CU_TestInfo libfossdbmanager_testcases[];
36 
43 #if CU_VERSION_P == 213
44 CU_SuiteInfo suites[] =
45  {
46  {"Testing libfossdb", NULL, NULL, NULL, NULL, libfossdb_testcases},
47  {"Testing fossconfig", NULL, NULL, NULL, NULL, fossconfig_testcases},
48  {"Testing libfossdbmanger", NULL, NULL, NULL, NULL, libfossdbmanager_testcases},
49  // TODO fix { "Testing fossscheduler", NULL, NULL, fossscheduler_testcases },
50  CU_SUITE_INFO_NULL
51  };
52 #else
53 CU_SuiteInfo suites[] =
54  {
55  {"Testing libfossdb", NULL, NULL, libfossdb_testcases},
56  {"Testing fossconfig", NULL, NULL, fossconfig_testcases},
57  {"Testing libfossdbmanger", NULL, NULL, libfossdbmanager_testcases},
58  // TODO fix { "Testing fossscheduler", NULL, NULL, fossscheduler_testcases },
59  CU_SUITE_INFO_NULL
60  };
61 #endif
62 
63 /* ************************************************************************** */
64 /* **** main function ******************************************************* */
65 /* ************************************************************************** */
66 
67 int main(int argc, char** argv) {
68  fo_dbManager* dbManager = NULL;
69 
70  if (argc > 1) {
71  dbConf = argv[1];
72  } else {
73  dbManager = createTestEnvironment("..", NULL, 0);
74  dbConf = get_dbconf();
75  }
76 
77  const int returnValue = focunit_main(argc, argv, "lib c Tests", suites);
78 
79  if (dbManager)
80  dropTestEnvironment(dbManager, "..", NULL);
81  return returnValue;
82 }
CU_SuiteInfo suites[]
all test suites for delagent
Definition: testRun.h:54
char * get_dbconf()
get Db.conf path just created by create_db_repo_sysconf()
fo_dbManager * dbManager
fo_dbManager object
Definition: process.c:28