1
1

* add test for init_finalize of orte (useful for memory leak checks)

* update ORTE tests to cope with change in prototype for orte_init()

This commit was SVN r7081.
Этот коммит содержится в:
Brian Barrett 2005-08-29 19:32:46 +00:00
родитель 660ce0a486
Коммит 07b589100e
4 изменённых файлов: 76 добавлений и 5 удалений

Просмотреть файл

@ -18,9 +18,10 @@
include $(top_srcdir)/test/support/Makefile.options
check_PROGRAMS = \
opal_init_finalize \
orte_init_finalize \
sigchld \
start_shut \
opal_init_finalize
start_shut
TESTS = \
$(check_PROGRAMS)
@ -41,6 +42,14 @@ start_shut_LDADD = \
$(top_builddir)/test/support/libsupport.a
start_shut_DEPENDENCIES = $(start_shut_LDADD)
orte_init_finalize_SOURCES = \
orte_init_finalize.c
orte_init_finalize_LDADD = \
$(top_builddir)/orte/liborte.la \
$(top_builddir)/opal/libopal.la \
$(top_builddir)/test/support/libsupport.a
orte_init_finalize_DEPENDENCIES = $(orte_init_finalize_LDADD)
opal_init_finalize_SOURCES = \
opal_init_finalize.c
opal_init_finalize_LDADD = \

62
test/runtime/orte_init_finalize.c Обычный файл
Просмотреть файл

@ -0,0 +1,62 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "orte/include/orte_constants.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include "support.h"
#include "orte/runtime/runtime.h"
#define NUM_ITERS 3
FILE *test_out;
int main (int argc, char* argv[])
{
int rc, i;
test_init("orte_start_shut");
test_out = stderr;
fprintf(test_out, "initialize the system\n");
if (ORTE_SUCCESS != (rc = orte_init(true))) {
fprintf(test_out, "couldn't complete init - error code %d\n", rc);
exit(1);
}
fprintf(test_out, "shut system down\n");
if (ORTE_SUCCESS != (rc = orte_finalize())) {
fprintf(test_out, "couldn't complete finalize - error code %d\n", rc);
exit(1);
}
fprintf(test_out, "orte_init_finalize: successful\n");
rc = test_finalize();
return rc;
}

Просмотреть файл

@ -48,7 +48,7 @@ int main(int argc, char *argv[])
return 77;
#endif
orte_init();
orte_init(true);
pid = fork();
if (pid > 0) {

Просмотреть файл

@ -43,7 +43,7 @@ int main (int argc, char* argv[])
test_out = stderr;
fprintf(test_out, "initialize the system\n");
if (ORTE_SUCCESS != (rc = orte_init())) {
if (ORTE_SUCCESS != (rc = orte_init(true))) {
fprintf(test_out, "couldn't complete init - error code %d\n", rc);
exit(1);
}
@ -54,7 +54,7 @@ int main (int argc, char* argv[])
exit(1);
}
fprintf(test_out, "\tfinalize successful\n");
if (ORTE_SUCCESS != (rc = orte_system_init())) {
if (ORTE_SUCCESS != (rc = orte_system_init(true))) {
fprintf(test_out, "iter %d: couldn't complete orte system init - error code %d\n", i, rc);
exit(1);
}