File: macQAT.sh

package info (click to toggle)
klayout 0.30.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 292,204 kB
  • sloc: cpp: 2,068,428; ruby: 47,823; xml: 26,924; python: 14,404; sh: 1,812; tcl: 212; perl: 170; makefile: 112; ansic: 42
file content (90 lines) | stat: -rwxr-xr-x 2,860 bytes parent folder | download
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash

#===============================================================================
# File: "macbuild/macQAT.sh"
#
#  The top Bash script to run "ut_runner" after building KLayout
#  (http://www.klayout.de/index.php) version 0.29.7 or later on different
#  Apple Mac OSX platforms.
#
#  This script must be copied to a "*.macQAT/" directory to run.
#===============================================================================

#----------------------------------------------------------------
# Functions
#----------------------------------------------------------------
function GetPresentDir() {
    path=$1
    array=( `echo $path | tr -s '/' ' '`)
    last_index=`expr ${#array[@]} - 1`
    echo ${array[${last_index}]}
    return 0
}

function HidePrivateDir() {
    if [ -d "../private" ]; then
        ret=$(/bin/mv ../private  ../private.stash)
    fi
}

function ShowPrivateDir() {
    if [ -d "../private.stash" ]; then
        ret=$(/bin/mv ../private.stash  ../private)
    fi
}

#----------------------------------------------------------------
# Variables
#----------------------------------------------------------------
gitSHA1=$(git rev-parse --short HEAD 2>/dev/null)
timestamp=$(date "+%Y_%m%d_%H%M")
presentDir=$(GetPresentDir `pwd`)
logfile=QATest_${gitSHA1}_${timestamp}__${presentDir}.log

#----------------------------------------------------------------
# Environment variables for "ut_runner"
#----------------------------------------------------------------
export TESTSRC=..
export TESTTMP=QATest_${gitSHA1}_${timestamp}__${presentDir}
export DYLD_LIBRARY_PATH=$(pwd):$(pwd)/db_plugins:$(pwd)/lay_plugins:$(pwd)/pymod

#----------------------------------------------------------------
# Environment variables for "ut_runner"
#----------------------------------------------------------------
if [ $# -eq 1 ]; then
    if [ "$1" == "-h" ]; then
        ./ut_runner -h
        exit 0
    fi
    if [ "$1" == "-r" ]; then
        echo "### Dumping the log to" $logfile "..."
        HidePrivateDir
        ./ut_runner -x pymod -c  2>&1 | tee $logfile
        ShowPrivateDir
        exit 0
    else
        echo ""
        echo " Git SHA1   = ${gitSHA1}"
        echo " Time stamp = ${timestamp}"
        echo " Log file   = ${logfile}"
        echo " Usage:"
        echo "  ./macQAT.sh -h: to get the help of 'ut_runner'"
        echo "  ./macQAT.sh -r: to run the tests with '-c' option: continues after an error"
        echo ""
        exit 0
    fi
else
    echo ""
    echo " Git SHA1   = ${gitSHA1}"
    echo " Time stamp = ${timestamp}"
    echo " Log file   = ${logfile}"
    echo " Usage:"
    echo "  ./macQAT.sh -h: to get the help of 'ut_runner'"
    echo "  ./macQAT.sh -r: to run the tests with '-c' option: continues after an error"
    echo ""
    exit 0
fi

#--------------
# End of File
#--------------