File: test_build_dir

package info (click to toggle)
pocl 6.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,320 kB
  • sloc: lisp: 149,513; ansic: 103,778; cpp: 54,947; python: 1,513; sh: 949; ruby: 255; pascal: 226; tcl: 180; makefile: 175; java: 72; xml: 49
file content (69 lines) | stat: -rwxr-xr-x 1,396 bytes parent folder | download | duplicates (5)
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
#!/bin/bash

# Runs the PyOpenCL tests against a pocl build dir located in the
# current working directory. Assumes an ICD build in PWD.

pyopencl_root=$1
if [ -z "$pyopencl_root" ]; then
  pyopencl_root=`dirname $0`
fi

if [ -z "$OCL_ICD_VENDORS" ]; then

pushd . > /dev/null
cd $pyopencl_root
pyopencl_root=$PWD
popd > /dev/null

# Go to the build root directory.

if ! test -d ocl-vendors;
then
    cd ../..
fi

if ! test -d ocl-vendors;
then
    echo "Start the script either in the build dir or under build dir's examples/PyOpenCL"
    exit -1
fi

export POCL_BUILDING=1
export OCL_ICD_VENDORS=$PWD/ocl-vendors

else

echo "###### NOTE: using OCL_ICD_VENDORS already set to: $OCL_ICD_VENDORS, POCL_BUILDING set to: $POCL_BUILDING"

fi

export OPENCL_VENDOR_PATH=$OCL_ICD_VENDORS

cd $pyopencl_root/PyOpenCL-build || exit -1
source mypy/bin/activate || exit -1

cd pyopencl/test
test_log=`mktemp`
{ PYOPENCL_TEST=portable py.test --tb=native
} > $test_log 2>&1
fail_count=`cat $test_log | tail -1 | grep -Eo "[0-9]*" | head -1`

if ! grep -i "passed" $test_log;
then
    cat $test_log
    rm $test_log
    echo "Nothing passed!"
    exit -1
fi

rm -f $test_log

if test $fail_count -le 10;
then
# 10 failures with LLVM 4.0 has not the kernabi patch.
    echo "OK number of failing tests ($fail_count)."
    exit 0
else
    echo "Unexpectedly many failing tests ($fail_count)."
    exit -1
fi