1
1

* Fix regression in ompi_argv_delete exposed with the unit tests

* Update a bunch of the unit tests to either be disabled (someone who
  isn't me and knows that code needs to fix them) or to work properly

This commit was SVN r4986.
Этот коммит содержится в:
Brian Barrett 2005-03-22 14:41:45 +00:00
родитель 4b6aecf82d
Коммит 897983ea30
26 изменённых файлов: 144 добавлений и 293 удалений

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

@ -279,9 +279,11 @@ int ompi_argv_delete(int *argc, char ***argv, int start, int num_to_delete)
char **tmp;
/* Check for the bozo cases */
if (NULL == argv || NULL == *argv || 0 == num_to_delete) {
return OMPI_SUCCESS;
}
count = ompi_argv_count(*argv);
if (NULL == argv || NULL == *argv || start > count || 0 == num_to_delete) {
if (start > count) {
return OMPI_SUCCESS;
} else if (start < 0 || num_to_delete < 0) {
return OMPI_ERR_BAD_PARAM;

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

@ -16,6 +16,8 @@
include $(top_srcdir)/config/Makefile.options
AM_CPPFLAGS = -I$(top_srcdir)/test/support -DOMPI_ENABLE_DEBUG_OVERRIDE=1 -g
TESTS_ENVIRONMENT = TEST_WRITE_TO_FILE=1
check_PROGRAMS = \
gpr_internal_fns \
gpr_mem_leaks \

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

@ -317,6 +317,7 @@ int main(int argc, char **argv)
fprintf(stderr, "update multiple keyvals in a container\n");
if(ORTE_SUCCESS != orte_gpr_replica_find_seg(&seg, false, "test-put-segment")) {
fprintf(test_out, "Failure in orte_gpr_replica_find_seg\n");
return -1;
}
@ -404,5 +405,5 @@ int main(int argc, char **argv)
*/
test_finalize();
return(0);
return 0;
}

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

@ -63,8 +63,11 @@ int main(int argc, char **argv)
test_init("test_gpr_replica");
/* test_out = fopen( "test_gpr_replica_out", "w+" ); */
test_out = stderr;
if (getenv("TEST_WRITE_TO_FILE") != NULL) {
test_out = fopen( "test_gpr_replica_out", "w+" );
} else {
test_out = stderr;
}
if( test_out == NULL ) {
test_failure("gpr_test couldn't open test file failed");
test_finalize();

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

@ -72,8 +72,11 @@ int main(int argc, char **argv)
test_init("test_gpr_replica_trigs");
/* test_out = fopen( "test_gpr_replica_out", "w+" ); */
test_out = stderr;
if (getenv("TEST_WRITE_TO_FILE") != NULL) {
test_out = fopen( "test_gpr_replica_out", "w+" );
} else {
test_out = stderr;
}
if( test_out == NULL ) {
test_failure("gpr_test couldn't open test file failed");
test_finalize();
@ -154,7 +157,7 @@ int main(int argc, char **argv)
subscription->cbfunc = test_cbfunc;
subscription->user_tag = NULL;
fprintf(stderr, "register subscription on segment\n");
fprintf(test_out, "register subscription on segment\n");
if (ORTE_SUCCESS != (rc = orte_gpr_replica_subscribe(
ORTE_GPR_NOTIFY_ADD_ENTRY,
1, &subscription,

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

@ -1,58 +0,0 @@
#! /bin/csh -f
# Name
# ====
# run script for mca gpr tests
# Arguements
# ==========
#
# test_list = no args or all runs all tests
# or
# test_gpr_proxy runs ompi gpr proxy tests
# test_gpr_replica runs ompi gpr replica tests
# Usage
#
# =====
# To invoke this script, enter either
# run_tests all
# with no arguments to run all tests, or
# run_tests <test_name>
umask 007
if ("x$1" == "x") then
./test_gpr_proxy;
./test_gpr_replica;
else
foreach target ($argv)
switch ($target)
case "all":
./test_gpr_proxy;
./test_gpr_replica;
breaksw
case "test_gpr_replica":
case "test_gpr_proxy":
./$target;
breaksw
case "help":
echo "correct use: "
echo " run_tests help (this message)"
echo " run_tests all (to run all mca gpr tests)"
echo "or run_tests with any of the following: "
echo " < test_gpr_replica | test_gpr_proxy >"
break
breaksw
default
echo "There is no test <$target> to run"
echo "correct use: "
echo " run_tests help (this message)"
echo " run_tests all (to run all mca gpr tests)"
echo "or run_tests with any of the following: "
echo " < test_gpr_replica | test_gpr_proxy >"
break
endsw
end
endif

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

@ -18,7 +18,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/test/support -DOMPI_ENABLE_DEBUG_OVERRIDE=1
check_PROGRAMS = \
test_ns_replica \
test_ns_proxy
test_ns_proxy \
ns_nds
TESTS = \
$(check_PROGRAMS)
@ -34,3 +35,9 @@ test_ns_proxy_LDADD = \
$(top_builddir)/test/support/libsupport.a \
$(top_builddir)/src/libmpi.la
test_ns_proxy_DEPENDENCIES = $(test_ns_proxy_LDADD)
ns_nds_SOURCES = ns_nds.c
ns_nds_LDADD = \
$(top_builddir)/test/support/libsupport.a \
$(top_builddir)/src/libmpi.la
ns_nds_DEPENDENCIES = $(ns_nds_LDADD)

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

@ -12,10 +12,8 @@
* $HEADER$
*/
#include "orte_config.h"
#include "../src/include/orte_constants.h"
#include "../src/include/orte_types.h"
#include "../src/include/orte_names.h"
#include <stdio.h>
#include <string.h>
@ -28,13 +26,14 @@
#endif
#include "include/constants.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "support.h"
#include "../src/runtime/runtime.h"
#include "../src/mca/base/base.h"
#include "../src/plsnds/plsnds.h"
#include "../src/mca/ns/ns.h"
#include "../src/mca/ns/base/base.h"
#include "runtime/runtime.h"
#include "mca/base/base.h"
#include "mca/ns/ns.h"
#include "mca/ns/base/base.h"
static bool test1(void); /* verify different buffer inits */
static bool test2(void); /* verify int16 */
@ -58,7 +57,7 @@ int main (int argc, char* argv[])
test_out = stderr;
/* open up the mca so we can get parameters */
ompi_init(argc, argv);
orte_init();
/* startup the MCA */
if (OMPI_SUCCESS != mca_base_open()) {
@ -72,8 +71,10 @@ int main (int argc, char* argv[])
exit (1);
}
#if 0 /* XXX - what should this be now? */
/* setup the plsnds */
orte_plsnds_open();
#endif
fprintf(test_out, "executing test1\n");
if (test1()) {
@ -171,9 +172,8 @@ int main (int argc, char* argv[])
test_failure("orte_dps test12 failed");
}
test_finalize();
fclose(test_out);
return (0);
return test_finalize();
}
@ -390,3 +390,4 @@ static bool test12(void)
{
return (true);
}

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

@ -40,6 +40,10 @@ static int exec_client(int argc, char** argv);
int main(int argc, char **argv)
{
printf("Test test_ns_proxy disabled. Does not compile.\n");
return 77;
#if 0
bool multi, hidden;
char *seed;
@ -252,5 +256,7 @@ void run_test(void)
test_failure( "test_ns_replica ompi_name_server get_proc_name_string, etc failed");
}
test_finalize();
#endif
}

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

@ -29,6 +29,10 @@ static char *cmd_str="diff ./test_ns_replica_out ./test_ns_replica_out_std";
int main(int argc, char **argv)
{
printf("Test test_ns_replica disabled. Does not compile.\n");
return 77;
#if 0
orte_process_name_t *test_name;
orte_process_name_t *procs;
int num_procs;
@ -210,4 +214,5 @@ int main(int argc, char **argv)
test_finalize();
return(0);
#endif
}

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

@ -16,6 +16,15 @@
#include "support.h"
#include "mca/oob/oob.h"
int main(int argc, char **argv)
{
printf("Test oob_test disabled. Does not compile.\n");
return 77;
}
#if 0
#define MSG_TYPE_1 1
#define MSG_TYPE_2 2
#define NUM_TESTS 8
@ -258,3 +267,4 @@ void do_recvs(ompi_process_name_t * peer) {
}
#endif

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

@ -15,7 +15,14 @@
#include "mpi.h"
#include "support.h"
#include "mca/oob/oob.h"
#include "util/pack.h"
int main(int argc, char **argv)
{
printf("Test oob_test disabled. Does not compile.\n");
return 77;
}
#if 0
#define TAG 11011
@ -199,3 +206,4 @@ void do_compare () {
test_success();
}
#endif

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

@ -12,6 +12,14 @@
#include "support.h"
#include "mca/oob/oob.h"
int main(int argc, char **argv)
{
printf("Test oob_test disabled. Does not compile.\n");
return 77;
}
#if 0
#define MSG_TYPE_1 1
#define MSG_TYPE_2 2
#define NUM_TESTS 5
@ -162,3 +170,4 @@ int main(int argc, char ** argv)
return 0;
}
#endif

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

@ -1,62 +0,0 @@
#! /bin/csh -f
# Name
# ====
# run script for mca oob tests
# Arguements
# ==========
#
# test_list = no args runs all tests
# or
# oob_test runs ompi mca oob_test
# oob_test_self runs ompi mca oob_test_self test
# oob_test_packed runs ompi mca oob_test_packed test
# Usage
#
# =====
# To invoke this script, enter either
# run_tests
# with no arguments to run all tests, or
# run_tests <test_name>
MPIRUN = mpirun
umask 007
if ("x$1" == "x") then
mpirun -np 2 -- ./oob_test;
mpirun -np 1 -- ./oob_test_self;
mpirun -np 2 -- ./oob_test_packed;
else
foreach target ($argv)
switch ($target)
case "all":
mpirun -np 2 -- ./oob_test;
mpirun -np 1 -- ./oob_test_self;
mpirun -np 2 -- ./oob_test_packed;
breaksw
case "oob_test_self":
mpirun -np 1 -- ./oob_test_self;
breaksw
case "oob_test":
case "oob_test_packed":
mpirun -np 2 -- ./$target;
breaksw
case "help"
echo "correct use: "
echo " run_tests help (this message)"
echo " run_tests (to run all oob tests)"
echo "or run_tests <oob_test | oob_test_self | oob_test_packed>"
break
breaksw
default
echo "There is no test <$target> to run"
echo "correct use: "
echo " run_tests (to run all oob tests)"
echo "or run_tests <oob_test | oob_test_self | oob_test_packed>"
break
endsw
end
endif

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

@ -13,6 +13,14 @@
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
printf("Test oob_test disabled. Does not compile.\n");
return 77;
}
#if 0
#include "support.h"
#include "include/orte_constants.h"
@ -82,3 +90,5 @@ main(int argc, char **argv)
}
}
#endif

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

@ -26,13 +26,13 @@ TESTS = \
ompi_thread_SOURCES = ompi_thread.c
ompi_thread_LDADD = \
$(top_builddir)/test/support/libsupport.la \
$(top_builddir)/test/support/libsupport.a \
$(top_builddir)/src/libmpi.la
ompi_thread_DEPENDENCIES = $(ompi_thread_LDADD)
ompi_condition_SOURCES = ompi_condition.c
ompi_condition_LDADD = \
$(top_builddir)/test/support/libsupport.la \
$(top_builddir)/test/support/libsupport.a \
$(top_builddir)/src/libmpi.la
ompi_condition_DEPENDENCIES = $(ompi_condition_LDADD)

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

@ -10,13 +10,13 @@ static volatile int count = 0;
static void* thr1_run(ompi_object_t* obj)
{
ompi_atomic_add_int(&count, 1);
ompi_atomic_add(&count, 1);
return NULL;
}
static void* thr2_run(ompi_object_t* obj)
{
ompi_atomic_add_int(&count, 2);
ompi_atomic_add(&count, 2);
return NULL;
}

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

@ -1,59 +0,0 @@
#! /bin/csh -f
# Name
# ====
# run script for thread tests
# Arguements
# ==========
#
# test_list = no args runs all tests
# or
# ompi_condition runs ompi_condition tests
# ompi_thread runs ompi_thread tests
# Usage
#
# =====
# To invoke this script, enter either
# run_tests
# with no arguments to run all tests, or
# run_tests <test_name>
umask 007
if ("x$1" == "x") then
./ompi_thread
./ompi_condition
else
foreach target ($argv)
switch ($target)
case "all":
./ompi_condition
./ompi_thread
breaksw
case "ompi_condition":
./ompi_condition
breaksw
case "ompi_thread":
./ompi_thread
breaksw
case "help"
echo "correct use: "
echo " run_tests help (this message)"
echo " run_tests all (to run all thread tests)"
echo "or run_tests and any of the following:"
echo " <omnpi_condition | ompi_thread>"
break
breaksw
default:
echo "There is no program <$target> to run"
echo "correct use: "
echo " run_tests all (to run all thread tests)"
echo "or run_tests and any of the following:"
echo " <omnpi_condition | ompi_thread>"
break
endsw
end
endif

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

@ -75,9 +75,7 @@ int main(int argc, char* argv[])
}
/* All done */
test_finalize();
return 0;
return test_finalize();
}
@ -365,7 +363,7 @@ static bool test9(void)
/* bozo cases */
if (OMPI_SUCCESS != ompi_argv_delete(NULL, 0, 0)) {
if (OMPI_SUCCESS != ompi_argv_delete(NULL, NULL, 0, 0)) {
return false;
}

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

@ -14,7 +14,6 @@
#include "ompi_config.h"
#if 0
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@ -24,12 +23,10 @@
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#endif
#include "runtime/runtime.h"
#include "util/if.h"
#include "support.h"
#include "util/bufpack.h"
#include "include/constants.h"
@ -54,7 +51,7 @@ main(int argc, char *argv[])
{
char hostname[MAXHOSTNAMELEN];
ompi_init(argc, argv);
orte_init();
test_init("ompi_if");
/* 127.0.0.1 */
@ -119,7 +116,7 @@ main(int argc, char *argv[])
}
test_finalize();
ompi_finalize();
orte_finalize();
return 0;
}

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

@ -24,6 +24,14 @@
#endif
#include <sys/stat.h>
int main(int argc, char **argv)
{
printf("Test disabled - Does not compile.\n");
return 77;
}
#if 0
#include "include/constants.h"
#include "util/sys_info.h"
#include "util/os_path.h"
@ -146,3 +154,4 @@ static bool test3(void)
}
return(true);
}
#endif

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

@ -20,6 +20,15 @@
#include <sys/param.h>
#endif
int main(int argc, char **argv)
{
printf("Test disabled - Does not compile.\n");
return 77;
}
#if 0
#include "util/sys_info.h"
#include "util/os_path.h"
#include "support.h"
@ -188,3 +197,4 @@ static bool test5(void)
}
#endif

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

@ -13,6 +13,7 @@
*/
#include "ompi_config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@ -24,6 +25,14 @@
#endif
int main(int argc, char **argv)
{
printf("Test disabled - Does not compile.\n");
return 77;
}
#if 0
#include "util/sys_info.h"
#include "support.h"
#include "../src/util/bufpack.h"
@ -362,3 +371,4 @@ static bool test8(void) /* verify string pack and unpack */
/* return (i); */
/* } */
#endif

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

@ -27,6 +27,14 @@
#endif
#include <sys/stat.h>
int main(int argc, char **argv)
{
printf("Test disabled - Does not compile.\n");
return 77;
}
#if 0
#include "include/constants.h"
#include "util/sys_info.h"
#include "util/os_path.h"
@ -387,3 +395,4 @@ void clear_proc_info(void)
ompi_process_info.proc_session_dir = NULL;
}
#endif

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

@ -20,6 +20,14 @@
#include <sys/param.h>
#endif
int main(int argc, char **argv)
{
printf("Test disabled - Does not compile.\n");
return 77;
}
#if 0
#include "util/sys_info.h"
#include "support.h"
@ -77,3 +85,4 @@ static bool test2(void)
ompi_sys_info();
return(ompi_system_info.init);
}
#endif

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

@ -1,79 +0,0 @@
#! /bin/csh -f
# Name
# ====
# run script for util tests
# Arguements
# ==========
#
# test_list = no args or all runs all tests
# or
# ompi_argv runs ompi_argv tests
# ompi_numtostr runs ompi_numtostr tests
# ompi_os_create_dirpath runs ompi_os_create_dirpath tests,
# ompi_os_path runs ompi_os_path tests,
# ompi_session_dir runs ompi_session_dir tests
# ompi_sys_info runs ompi_sys_info tests
# ompi_pack runs ompi_pack tests
# Usage
#
# =====
# To invoke this script, enter either
# run_tests
# with no arguments to run all tests, or
# run_tests <test_name>
umask 007
if ("x$1" == "x") then
# ./ompi_argv
./ompi_numtostr
./ompi_os_create_dirpath
./ompi_pack
./ompi_os_path
# ./ompi_session_dir
./ompi_sys_info
else
foreach target ($argv)
switch ($target)
case "all":
# ./ompi_argv
./ompi_numtostr
./ompi_os_create_dirpath
./ompi_pack
./ompi_os_path
# ./ompi_session_dir
./ompi_sys_info
breaksw
case "ompi_argv":
case "ompi_numtostr":
case "ompi_os_create_dirpath":
case "ompi_pack":
case "ompi_os_path":
case "ompi_session_dir":
case "ompi_sys_info":
./$target
breaksw
case "help":
echo "correct use: "
echo " run_tests help (this message)"
echo " run_tests all (to run all class tests)"
echo "or run_tests with any of the following: "
echo " <ompi_argv | ompi_numtostr | ompi_os_create_dirpath | "
echo " ompi_os_path | ompi_session_dir | ompi_sys_info>"
break
breaksw
default
echo "There is no test program <$target> to run"
echo "correct use: "
echo " run_tests (to run all class tests)"
echo "or run_tests with any of the following: "
echo " <ompi_argv | ompi_numtostr | ompi_os_create_dirpath | "
echo " ompi_os_path | ompi_session_dir | ompi_sys_info>"
break
endsw
end
endif