Fixes for ticket:35, allowing use of BSD make instead of GNU make.
[debian/gnuradio] / gr-usrp / src / 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-usrp/src
15 # Where to look in the src tree for swig generated python code
16 libsrc=@abs_top_srcdir@/gr-usrp/src
17 # Where to look in the src tree for hand written python code
18 py=@abs_top_srcdir@/gr-usrp/src
19
20 # Where to look for GNU Radio python modules in current build tree
21 grbld=@abs_top_srcdir@/gnuradio-core/src/python
22 grbld=$grbld:@abs_top_builddir@/gnuradio-core/src/lib/swig
23 grbld=$grbld:@abs_top_builddir@/gnuradio-core/src/lib/swig/.libs
24
25 # Where to look for USRP lib in current build tree
26 usrpbld=@abs_top_builddir@/usrp/host/lib
27
28 PYTHONPATH="$grbld:$libbld:$libbld/.libs:$libsrc:$py:$usrpbld:$PYTHONPATH"
29 export PYTHONPATH
30
31 # For OS/X
32 DYLD_LIBRARY_PATH=@abs_top_builddir@/gnuradio-core/src/lib/.libs:@abs_top_builddir@/usrp/host/lib/.libs
33 export DYLD_LIBRARY_PATH
34
35 #
36 # This is the simple part...
37 # Run everything that matches qa_*.py and return the final result.
38 #
39
40 ok=yes
41 for file in @srcdir@/qa_*.py
42 do
43   if ! $file
44   then
45     ok=no
46   fi  
47 done
48
49 if [ $ok = yes ]
50 then
51   exit 0
52 else
53   exit 1
54 fi