1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/test/unit/run.c

38 lines
821 B
C
Raw Normal View History

#include "units.h"
#include <CUnit/Basic.h>
#include <stdio.h>
#include <stdlib.h>
/* Setup SuiteInfo struct in a compatible way across different CUnit versions */
/* old version of CUnit has used char* for .pName, so using cast here */
#define USE(n) { \
.pName = (char*) #n, \
.pInitFunc = n##_init, \
.pCleanupFunc = n##_fini, \
.pTests = n##_list }
CU_SuiteInfo suites[] = {
USE(bitset),
USE(config),
USE(dmlist),
2015-11-30 22:54:52 +03:00
USE(dmstatus),
USE(regex),
USE(string),
CU_SUITE_INFO_NULL
};
int main(int argc, char **argv) {
if (CU_initialize_registry() != CUE_SUCCESS) {
printf("Initialization of Test Registry failed.\n");
return CU_get_error();
}
CU_register_suites(suites);
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
return (CU_get_number_of_failures() != 0);
}