add common test support functions and reporting
This commit was SVN r1984.
Этот коммит содержится в:
родитель
a815163347
Коммит
a452bc44fd
@ -14,6 +14,7 @@
|
|||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/os_path.h"
|
#include "util/os_path.h"
|
||||||
#include "util/os_create_dirpath.h"
|
#include "util/os_create_dirpath.h"
|
||||||
|
#include "support.h"
|
||||||
|
|
||||||
static bool test1(void); /* trivial test */
|
static bool test1(void); /* trivial test */
|
||||||
static bool test2(void); /* test existing path, both with and without correct mode */
|
static bool test2(void); /* test existing path, both with and without correct mode */
|
||||||
@ -22,36 +23,36 @@ static bool test3(void); /* test making a directory tree */
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
bool test1f, test2f, test3f;
|
test_init("ompi_os_create_dirpath_t");
|
||||||
|
|
||||||
test1f = test2f = test3f = false;
|
|
||||||
|
|
||||||
ompi_sys_info(); /* initialize system info */
|
ompi_sys_info(); /* initialize system info */
|
||||||
|
|
||||||
/* All done */
|
/* All done */
|
||||||
|
|
||||||
if (test1()) {
|
if (test1()) {
|
||||||
printf("test1 passed\n");
|
test_success();
|
||||||
test1f = true;
|
}
|
||||||
|
else {
|
||||||
|
test_failure("ompi_os_create_dirpath test1 failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (test2()) {
|
if (test2()) {
|
||||||
printf("test2 passed\n");
|
test_success();
|
||||||
test2f = true;
|
}
|
||||||
|
else {
|
||||||
|
test_failure("ompi_os_create_dirpath test2 failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (test3()) {
|
if (test3()) {
|
||||||
printf("test3 passed\n");
|
test_success();
|
||||||
test3f = true;
|
}
|
||||||
|
else {
|
||||||
|
test_failure("ompi_os_create_dirpath test3 failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (test1f && test2f && test3f) {
|
test_finalize();
|
||||||
printf("test succeeded\n");
|
return 0;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("test failed\n");
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user