diff --git a/darshan-runtime/test/Makefile.am b/darshan-runtime/test/Makefile.am index 4e15d25e0..48c3c2a12 100644 --- a/darshan-runtime/test/Makefile.am +++ b/darshan-runtime/test/Makefile.am @@ -10,6 +10,9 @@ check_PROGRAMS = if BUILD_MPIIO_MODULE check_PROGRAMS += tst_mpi_io tst_mpi_io_SOURCES = tst_mpi_io.c + TESTS = tst_runs.sh +else + TESTS = endif AM_TESTS_ENVIRONMENT = export TESTMPIRUN="$(TESTMPIRUN)"; @@ -20,8 +23,9 @@ AM_TESTS_ENVIRONMENT += export HAVE_MPI_LARGE_COUNT="$(HAVE_MPI_LARGE_COUNT)"; AM_TESTS_ENVIRONMENT += export HAVE_OPEN_MPI="$(HAVE_OPEN_MPI)"; AM_TESTS_ENVIRONMENT += export check_PROGRAMS="$(check_PROGRAMS)"; -TESTS = tst_runs.sh TEST_EXTENSIONS = .sh EXTRA_DIST = tst_runs.sh +CLEANFILES = testfile.dat + diff --git a/darshan-runtime/test/tst_runs.sh b/darshan-runtime/test/tst_runs.sh index 63192e4aa..7510529c6 100755 --- a/darshan-runtime/test/tst_runs.sh +++ b/darshan-runtime/test/tst_runs.sh @@ -12,23 +12,28 @@ fi if test -f $DARSHAN_INSTALL_DIR/bin/darshan-parser ; then DARSHAN_PARSER=$DARSHAN_INSTALL_DIR/bin/darshan-parser -else +elif test -f ../../darshan-util/darshan-parser ; then DARSHAN_PARSER=../../darshan-util/darshan-parser +else + DARSHAN_PARSER= fi echo "DARSHAN_PARSER=$DARSHAN_PARSER" if test -f $DARSHAN_INSTALL_DIR/bin/darshan-config ; then DARSHAN_CONFIG=$DARSHAN_INSTALL_DIR/bin/darshan-config else - DARSHAN_CONFIG=../../darshan-util/darshan-config + DARSHAN_CONFIG=../../darshan-runtime/darshan-config fi echo "DARSHAN_CONFIG=$DARSHAN_CONFIG" echo "" TODAY_DATE_PATH=`date "+%Y/%-m/%-d"` -LOG_PATH_ENV=`$DARSHAN_CONFIG --log-path-by-env` +LOG_PATH_ENV=`sh $DARSHAN_CONFIG --log-path-by-env` +echo "LOG_PATH_ENV=$LOG_PATH_ENV" + if test "x${LOG_PATH_ENV}" != x ; then - if test "x${!LOG_PATH_ENV}" = x ; then + TOKEN1=`echo ${LOG_PATH_ENV} | cut -d, -f1` + if test "x${!TOKEN1}" = x ; then echo "" echo "Warning: ---------------------------------------------------------" echo " Darshan was configure with --log-path-by-env set to $LOG_PATH_ENV" @@ -54,7 +59,7 @@ df -T ${TST_DARSHAN_LOG_PATH} echo "findmnt -n -o FSTYPE --target ${TST_DARSHAN_LOG_PATH}" findmnt -n -o FSTYPE --target ${TST_DARSHAN_LOG_PATH} -$DARSHAN_CONFIG --all +sh $DARSHAN_CONFIG --all # run NP number of MPI processes, default 2 if test "x$NP" = x ; then @@ -303,13 +308,17 @@ for exe in ${check_PROGRAMS} ; do echo "ls -l ${DARSHAN_LOG_FILE}" ls -l ${DARSHAN_LOG_FILE} - echo "parsing ${DARSHAN_LOG_FILE}" - EXPECT_NBYTE=`stat -c %s $TEST_FILE` - nbytes=`$DARSHAN_PARSER ${DARSHAN_LOG_FILE} | grep $DARSGAN_FIELD | cut -f5` - # echo "EXPECT_NBYTE=$EXPECT_NBYTE nbytes=$nbytes" - if test "x$nbytes" != "x$EXPECT_NBYTE" ; then - echo "Error: CMD=$CMD nbytes=$nbytes" - exit 1 + if test "x$DARSHAN_PARSER" = x ; then + echo "Warning: darshan-parser is not available, skip test" + else + echo "parsing ${DARSHAN_LOG_FILE}" + EXPECT_NBYTE=`stat -c %s $TEST_FILE` + nbytes=`$DARSHAN_PARSER ${DARSHAN_LOG_FILE} | grep $DARSGAN_FIELD | cut -f5` + # echo "EXPECT_NBYTE=$EXPECT_NBYTE nbytes=$nbytes" + if test "x$nbytes" != "x$EXPECT_NBYTE" ; then + echo "Error: CMD=$CMD nbytes=$nbytes" + exit 1 + fi fi done @@ -325,12 +334,16 @@ for exe in ${check_PROGRAMS} ; do rm -f $DARSHAN_LOG_FILE $CMD - echo "parsing ${DARSHAN_LOG_FILE}" - nbytes=`$DARSHAN_PARSER ${DARSHAN_LOG_FILE} | grep $DARSGAN_FIELD | cut -f5` - # echo "EXPECT_NBYTE=$EXPECT_NBYTE nbytes=$nbytes" - if test "x$nbytes" != "x$EXPECT_NBYTE" ; then - echo "Error: CMD=$CMD nbytes=$nbytes" - exit 1 + if test "x$DARSHAN_PARSER" = x ; then + echo "Warning: darshan-parser is not available, skip test" + else + echo "parsing ${DARSHAN_LOG_FILE}" + nbytes=`$DARSHAN_PARSER ${DARSHAN_LOG_FILE} | grep $DARSGAN_FIELD | cut -f5` + # echo "EXPECT_NBYTE=$EXPECT_NBYTE nbytes=$nbytes" + if test "x$nbytes" != "x$EXPECT_NBYTE" ; then + echo "Error: CMD=$CMD nbytes=$nbytes" + exit 1 + fi fi done fi diff --git a/darshan-test/regression/test-cases/src/fprintf-fscanf-test.c b/darshan-test/regression/test-cases/src/fprintf-fscanf-test.c index 19252fa58..90aedbf2d 100644 --- a/darshan-test/regression/test-cases/src/fprintf-fscanf-test.c +++ b/darshan-test/regression/test-cases/src/fprintf-fscanf-test.c @@ -31,15 +31,14 @@ int main(int argc, char **argv) int namelen; char processor_name[MPI_MAX_PROCESSOR_NAME]; FILE *file; - char buffer[128] = {0}; int number = 0; /* startup MPI and determine the rank of this process */ MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - MPI_Get_processor_name(processor_name, &namelen); - + MPI_Get_processor_name(processor_name, &namelen); + /* parse the command line arguments */ parse_args(argc, argv); @@ -68,7 +67,7 @@ int main(int argc, char **argv) static int parse_args(int argc, char **argv) { int c; - + while ((c = getopt(argc, argv, "f:")) != EOF) { switch (c) { case 'f': /* filename */ @@ -101,6 +100,6 @@ static void usage(void) * * vim: ts=3 * End: - */ + */