FOSSology  4.4.0
Open Source License Compliance by Open Source Software
testRun.c File Reference

Unit tests for scheduler. More...

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <CUnit/CUnit.h>
#include <CUnit/Automated.h>
#include <gio/gio.h>
#include <glib.h>
#include <libfossology.h>
#include <testRun.h>
#include <agent.h>
#include <database.h>
#include <event.h>
#include <host.h>
#include <interface.h>
#include <logging.h>
#include <scheduler.h>
Include dependency graph for testRun.c:

Go to the source code of this file.

Functions

int init_suite (void)
 
int clean_suite (void)
 
int main (int argc, char *argv[])
 

Variables

char * testdb = NULL
 
CU_SuiteInfo suites []
 all test suites for delagent More...
 

Detailed Description

Unit tests for scheduler.

Definition in file testRun.c.

Function Documentation

◆ clean_suite()

int clean_suite ( void  )

Since we changed the log file in the initializations, we need to close it and set the pointer to NULL so that the logging system can reset it to the correct value.

Returns
-1 of failure, 0 on success

Definition at line 65 of file testRun.c.

◆ init_suite()

int init_suite ( void  )

Check if main log is not NULL, destroy it else create a new log on ./founit.log

Returns
-1 on failure, 0 of success

Definition at line 43 of file testRun.c.

Variable Documentation

◆ suites

CU_SuiteInfo suites[]
Initial value:
=
{
{"Host", NULL, NULL, (CU_SetUpFunc)init_suite, (CU_TearDownFunc)clean_suite, tests_host },
{"Interface", NULL, NULL, (CU_SetUpFunc)init_suite, (CU_TearDownFunc)clean_suite, tests_interface },
{"InterfaceThread", NULL, NULL, (CU_SetUpFunc)init_suite, (CU_TearDownFunc)clean_suite, tests_interface_thread },
{"Database", NULL, NULL, (CU_SetUpFunc)init_suite, (CU_TearDownFunc)clean_suite, tests_database },
{"Email", NULL, NULL, (CU_SetUpFunc)init_suite, (CU_TearDownFunc)clean_suite, tests_email },
{"Scheduler", NULL, NULL, (CU_SetUpFunc)init_suite, (CU_TearDownFunc)clean_suite, tests_scheduler },
{"MetaAgent", NULL, NULL, (CU_SetUpFunc)init_suite, (CU_TearDownFunc)clean_suite, tests_meta_agent },
{"Agent", NULL, NULL, (CU_SetUpFunc)init_suite, (CU_TearDownFunc)clean_suite, tests_agent },
{"Event", NULL, NULL, (CU_SetUpFunc)init_suite, (CU_TearDownFunc)clean_suite, tests_event },
CU_SUITE_INFO_NULL
}
int init_suite(void)
Definition: testRun.c:43
int clean_suite(void)
Definition: testRun.c:65

all test suites for delagent

Todo:
tests_job is not running

Definition at line 80 of file testRun.c.