FOSSology  4.4.0
Open Source License Compliance by Open Source Software
run_tests.c
1 /*
2  Author: Daniele Fognini, Andreas Wuerl
3  SPDX-FileCopyrightText: © 2013-2015 Siemens AG
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
8 /* local includes */
9 #include <libfocunit.h>
10 
11 /* cunit includes */
12 #include <libfodbreposysconf.h>
13 
14 // #define AGENT_DIR "../"
15 
17 
18 /* ************************************************************************** */
19 /* **** test case sets ****************************************************** */
20 /* ************************************************************************** */
21 
22 extern CU_TestInfo string_operations_testcases[];
23 extern CU_TestInfo file_operations_testcases[];
24 extern CU_TestInfo license_testcases[];
25 extern CU_TestInfo highlight_testcases[];
26 extern CU_TestInfo hash_testcases[];
27 extern CU_TestInfo diff_testcases[];
28 extern CU_TestInfo match_testcases[];
29 extern CU_TestInfo database_testcases[];
30 extern CU_TestInfo encoding_testcases[];
31 extern CU_TestInfo serialize_testcases[];
32 
33 extern int license_setUpFunc();
34 extern int license_tearDownFunc();
35 
36 extern int database_setUpFunc();
37 extern int database_tearDownFunc();
38 
39 /* ************************************************************************** */
40 /* **** create test suite *************************************************** */
41 /* ************************************************************************** */
42 
43 CU_SuiteInfo suites[] = {
44  {"Testing process:", NULL, NULL, NULL, NULL, string_operations_testcases},
45  {"Testing monk:", NULL, NULL, NULL, NULL, file_operations_testcases},
46  {"Testing license:", NULL, NULL, (CU_SetUpFunc)license_setUpFunc, (CU_TearDownFunc)license_tearDownFunc, license_testcases},
47  {"Testing highlighting:", NULL, NULL, NULL, NULL, highlight_testcases},
48  {"Testing hash:", NULL, NULL, NULL, NULL, hash_testcases},
49  {"Testing diff:", NULL, NULL, NULL, NULL, diff_testcases},
50  {"Testing match:", NULL, NULL, NULL, NULL, match_testcases},
51  {"Testing database:", NULL, NULL, (CU_SetUpFunc)database_setUpFunc, (CU_TearDownFunc)database_tearDownFunc, database_testcases},
52  {"Testing encoding:", NULL, NULL, NULL, NULL, encoding_testcases},
53  {"Testing serialize:", NULL, NULL, NULL, NULL, serialize_testcases},
54  CU_SUITE_INFO_NULL
55 };
56 
57 /* ************************************************************************** */
58 /* **** main test functions ************************************************* */
59 /* ************************************************************************** */
60 
61 int main(int argc, char** argv) {
62  dbManager = createTestEnvironment(AGENT_DIR, "monk", 0);
63  const int returnValue = focunit_main(argc, argv, "monk_agent_Tests", suites);
64  if (returnValue == 0) {
65  dropTestEnvironment(dbManager, AGENT_DIR, "monk");
66  } else {
67  printf("preserving test environment in '%s'\n", get_sysconfdir());
68  }
69  return returnValue;
70 }
char * get_sysconfdir()
get sysconfig dir path just created by create_db_repo_sysconf()
fo_dbManager * dbManager
fo_dbManager object
Definition: process.c:16
CU_SuiteInfo suites[]
all test suites for delagent
Definition: run_tests.c:46