~giuseppe-maxia/mysql-sandbox/mysql-sandbox-3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
if [ ! -f test_versions.txt ]
then
    echo "test_versions.txt not found"
    exit 1
fi

echo "" >> results.txt
echo "## $(date)" >> results.txt
echo "#" >> results.txt
[ -z "$SANDBOX_BINARY" ] && SANDBOX_BINARY=$HOME/opt/mysql


for V in $(grep -v '^\s*#' test_versions.txt)   
do 
    if [ ! -d $SANDBOX_BINARY/$V ]
    then
        echo "# $V not found in $SANDBOX_BINARY"
        echo "# $V skipped" >> results.txt
        continue
    fi 
    echo "# Testing $V"
    perl Makefile.PL 
    if [ "$?" != "0" ] ; then continue ; fi
    make 
    if [ "$?" != "0" ] ; then continue ; fi
    TEST_VERSION=$V make test 
    EC=$? 
    echo "`date` - $V - $EC" >> results.txt   
    running_mysql=$(pgrep mysqld)
    if [ -n "$running_mysql" ]
    then
        pkill mysqld
        sleep 10
    fi
done