run-all.sh 1.23 KB
Newer Older
1
2
3
#!/bin/bash

if [ "$#" -ne 3 ]; then
4
5
    echo "Usage: run-all.sh <darshan_install_path> <tmp_path> <platform>" 1>&2
    echo "Example: ./run-all.sh ~/darshan-install /tmp/test ws" 1>&2
6
7
8
9
10
11
12
13
14
15
    exit 1
fi

# set variables for use by other sub-scripts
export DARSHAN_PATH=$1
export DARSHAN_TMP=$2
export DARSHAN_PLATFORM=$3

# check darshan path
if [ ! -x $DARSHAN_PATH/bin/darshan-parser ]; then
16
    echo "Error: $DARSHAN_PATH doesn't contain a valid Darshan install." 1>&2
17
18
19
20
21
22
23
24
25
    exit 1
fi

# check and/or create tmp path
if [ ! -d $DARSHAN_TMP ]; then
    mkdir -p $DARSHAN_TMP
fi

if [ ! -d $DARSHAN_TMP ]; then
26
    echo "Error: unable to find or create $DARSHAN_TMP" 1>&2
27
28
29
    exit 1
fi
if [ ! -w $DARSHAN_TMP ]; then
30
    echo "Error: unable to write to $DARSHAN_TMP" 1>&2
31
32
33
34
35
    exit 1
fi

# make sure that we have sub-scripts for the specified platform
if [ ! -d $DARSHAN_PLATFORM ]; then
36
    echo "Error: unable to find scripts for platform $DARSHAN_PLATFORM" 1>&2
37
38
39
    exit 1
fi

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# set up c compiler for this platform
DARSHAN_CC=`$DARSHAN_PLATFORM/setup-cc.sh`
if [ $? != 0 ]; then
    exit 1
fi

export DARSHAN_CC

for i in `ls test-cases/*.sh`; do
    $i
    if [ $? != 0 ]; then
        echo "Error: failed to execute test case $i"
        exit 1
    fi
done

56
exit 0