Implements ticket:3 and fixes ticket:42. The common functionality of
[debian/gnuradio] / run_tests.sh.in
1 #!/bin/sh
2
3 # First argument is absolute path to top of component source directory
4 # Second argument is absolute path to top of component build directory
5 # Third argument is component source directory for qa tests
6
7 # Where to find my swig generated shared library
8 mylibdir=$2/src:$2/src/.libs:$2/src/lib:$2/src/lib/.libs
9
10 # Where to find my swig generated python module
11 mysrcdir=$1/src:$1/src/lib
12
13 # Where to find my hand written python modules
14 mypydir=$1/src:$1/src/python
15
16 # Where to find core's swig generated shared libraries
17 grswigdir=@abs_top_builddir@/gnuradio-core/src/lib/swig
18 grswigdir=$grswigdir:$grswigdir/.libs
19
20 # Where to find core's python modules
21 grpydir=@abs_top_srcdir@/gnuradio-core/src/python
22
23 # Where to find core's master library files
24 grlibdir=@abs_top_srcdir@/gnuradio-core/src/lib
25 grlibdir=$grlibdir:$grlibdir/.libs
26
27 # Construct search path for python modules
28 PYTHONPATH="$mylibdir:$mysrcdir:$mypydir:$grswigdir:$grpydir:$PYTHONPATH"
29 export PYTHONPATH
30
31 # For OS/X
32 DYLD_LIBRARY_PATH=$grlibdir
33 export DYLD_LIBRARY_PATH
34
35 # Don't load user or system prefs
36 GR_DONT_LOAD_PREFS=1
37 export GR_DONT_LOAD_PREFS
38
39 # Run everything that matches qa_*.py and return the final result.
40
41 ok=yes
42 for file in $3/qa_*.py
43 do
44   if ! $file
45   then
46     ok=no
47   fi  
48 done
49
50 if [ $ok = yes ]
51 then
52   exit 0
53 else
54   exit 1
55 fi