Fixes ticket:26, ticket:27, and ticket:32.
[debian/gnuradio] / gr-atsc / src / python / run_tests.in
1 #!/bin/sh
2
3 # All this strange PYTHONPATH manipulation is required to run our
4 # tests using our just built shared library and swig-generated python
5 # code prior to installation.
6
7 # build tree == src tree unless you're doing a VPATH build.  
8 # If you don't know what a VPATH build is, you're not doing one.  Relax...
9
10 prefix=@prefix@
11 exec_prefix=@exec_prefix@
12
13 # Where to look in the build tree for our shared library
14 libbld=@abs_top_builddir@/gr-atsc/src/lib
15 # Where to look in the src tree for swig generated python code
16 libsrc=@abs_top_srcdir@/gr-atsc/src/lib
17 # Where to look in the src tree for hand written python code
18 py=@abs_top_srcdir@/gr-atsc/src/python
19
20 # Where to look for GNU Radio python modules in current build tree
21 grpythonbld=@abs_top_srcdir@/gnuradio-core/src/python
22 grpythonbld=$grpythonbld:@abs_top_builddir@/gnuradio-core/src/lib/swig
23 grpythonbld=$grpythonbld:@abs_top_builddir@/gnuradio-core/src/lib/swig/.libs
24
25 PYTHONPATH="$grpythonbld:$libbld:$libbld/.libs:$libsrc:$py:$PYTHONPATH"
26 export PYTHONPATH
27
28 # For OS/X
29 DYLD_LIBRARY_PATH="@abs_top_builddir@/gnuradio-core/src/lib/.libs"
30 export DYLD_LIBRARY_PATH
31
32 #
33 # This is the simple part...
34 # Run everything that matches qa_*.py and return the final result.
35 #
36
37 ok=yes
38 for file in @srcdir@/qa_*.py
39 do
40   if ! $file
41   then
42     ok=no
43   fi  
44 done
45
46 if [ $ok = yes ]
47 then
48   exit 0
49 else
50   exit 1
51 fi