FOSSology  4.4.0
Open Source License Compliance by Open Source Software
testlibs.c
1 /*
2  SPDX-FileCopyrightText: © 2011 Hewlett-Packard Development Company, L.P.
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
10 #include <libfocunit.h>
11 #include <libfodbreposysconf.h>
12 
13 /* ************************************************************************** */
14 /* * test case sets * */
15 /* * when adding the tests for a library, simply add the "extern" * */
16 /* * declaration and add it to the suites array * */
17 /* ************************************************************************** */
18 
19 char* dbConf;
20 
21 extern CU_TestInfo fossconfig_testcases[];
22 extern CU_TestInfo fossscheduler_testcases[];
23 extern CU_TestInfo libfossdb_testcases[];
24 extern CU_TestInfo libfossdbmanager_testcases[];
25 
32 CU_SuiteInfo suites[] =
33  {
34  {"Testing libfossdb", NULL, NULL, NULL, NULL, libfossdb_testcases},
35  {"Testing fossconfig", NULL, NULL, NULL, NULL, fossconfig_testcases},
36  {"Testing libfossdbmanger", NULL, NULL, NULL, NULL, libfossdbmanager_testcases},
37  // TODO fix { "Testing fossscheduler", NULL, NULL, fossscheduler_testcases },
38  CU_SUITE_INFO_NULL
39  };
40 
41 /* ************************************************************************** */
42 /* **** main function ******************************************************* */
43 /* ************************************************************************** */
44 
45 int main(int argc, char** argv) {
46  fo_dbManager* dbManager = NULL;
47 
48  if (argc > 1) {
49  dbConf = argv[1];
50  } else {
51  dbManager = createTestEnvironment("..", NULL, 0);
52  dbConf = get_dbconf();
53  }
54 
55  const int returnValue = focunit_main(argc, argv, "lib c Tests", suites);
56 
57  if (dbManager)
58  dropTestEnvironment(dbManager, "..", NULL);
59  return returnValue;
60 }
CU_SuiteInfo suites[]
all test suites for delagent
Definition: testRun.h:36
char * get_dbconf()
get Db.conf path just created by create_db_repo_sysconf()
fo_dbManager * dbManager
fo_dbManager object
Definition: process.c:16