usrp2-firmware: fix missing files in tarball
[debian/gnuradio] / run_tests.sh.in
index 1562eeec6dc3ca2cfac9365c2759f45ea981013c..1cb8e170adc361f5618a7a1957de934ad9173871 100644 (file)
@@ -10,14 +10,17 @@ abs_top_srcdir=@abs_top_srcdir@
 # Absolute path to the top of the build directory
 abs_top_builddir=@abs_top_builddir@
 
-# Where to find my swig generated shared library
-mylibdir=$2/src:$2/src/.libs:$2/src/lib:$2/src/lib/.libs
+# current QA srcdir
+export srcdir=$3
+
+# Where to find my C++ and swig generated shared libraries
+mylibdir=$2/src:$2/src/.libs:$2/src/lib:$2/src/lib/.libs:$2/lib:$2/lib/.libs:$2/swig:$2/swig/.libs
 
 # Where to find my swig generated python module
 mysrcdir=$1/src:$1/src/lib
 
 # Where to find my hand written python modules
-mypydir=$1/src:$1/src/python
+mypydir=$1/src:$1/src/python:$1/python
 
 # Where to find core's swig generated shared libraries,
 # and hand generated swig glue
@@ -53,8 +56,8 @@ fi
 PYTHONPATH="$mylibdir:$mysrcdir:$mypydir:$PYTHONPATH"
 export PYTHONPATH
 
-# Where to find omnithread library files
-gromnidir=@omnithread_LIBDIRPATH@
+# Where to find gruel library files
+grueldir=@gruel_LIBDIRPATH@
 
 # Where to find gnuradio core's library files
 grcoredir=@gnuradio_core_LIBDIRPATH@
@@ -62,7 +65,7 @@ grcoredir=@gnuradio_core_LIBDIRPATH@
 # Construct search path for python modules
 # Check each one to make sure it's not "" before adding
 grlibdir=""
-for dir in $gromnidir $grcoredir
+for dir in $grcoredir $grueldir
 do
     if [ "$dir" != "" ]
     then
@@ -75,50 +78,56 @@ do
     fi
 done
 
-# Add the grlibdir paths to the front of any PATH variable
-if [ "$grlibdir" != "" ]
-then
-    # For OS/X
-    if [ "$DYLD_LIBRARY_PATH" = "" ]
-    then
-       DYLD_LIBRARY_PATH=$grlibdir
-    else
-       DYLD_LIBRARY_PATH=$grlibdir:$DYLD_LIBRARY_PATH
-    fi
-
-    # For Win32
-    if [ "$PATH" = "" ]
-    then
-       PATH=$grlibdir
-    else
-       PATH=$grlibdir:$PATH
-    fi
-fi
+# Add 'mylibdir' to the start of the library load path, to get local
+# (to this component) created libraries
 
 # Where to find pre-installed libraries
 withlibdirs=@with_LIBDIRPATH@
 
-# Add the withdirs paths to the end of any PATH variable
-if [ "$withlibdirs" != "" ]
-then
-    # For OS/X
+case "@host_os@" in
+  darwin*)
+    # Special Code for executing on Darwin / Mac OS X only
     if [ "$DYLD_LIBRARY_PATH" = "" ]
     then
-       DYLD_LIBRARY_PATH=$withlibdirs
+       DYLD_LIBRARY_PATH=$mylibdir
     else
+       DYLD_LIBRARY_PATH=$mylibdir:$DYLD_LIBRARY_PATH
+    fi
+    # DYLD_LIBRARY_PATH will not be empty now
+    # Add the grlibdir paths to the front of any library load variable
+    if [ "$grlibdir" != "" ]
+    then
+       DYLD_LIBRARY_PATH=$grlibdir:$DYLD_LIBRARY_PATH
+    fi
+    # Add the withdirs paths to the end of any library load variable
+    if [ "$withlibdirs" != "" ]
+    then
        DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$withlibdirs
     fi
-
-    # For Win32
+    export DYLD_LIBRARY_PATH
+    ;;
+  cygwin*|win*|mingw*)
+    # Special Code for executing on Win32 variants only
     if [ "$PATH" = "" ]
     then
-       PATH=$withlibdirs
+       PATH=$mylibdir
     else
+       PATH=$mylibdir:$PATH
+    fi
+    # PATH will not be empty now
+    # Add the grlibdir paths to the front of any library load variable
+    if [ "$grlibdir" != "" ]
+    then
+       PATH=$grlibdir:$PATH
+    fi
+    # Add the withdirs paths to the end of any library load variable
+    if [ "$withlibdirs" != "" ]
+    then
        PATH=$PATH:$withlibdirs
     fi
-fi
-
-export DYLD_LIBRARY_PATH
+    export PATH
+    ;;
+esac
 
 # Don't load user or system prefs
 GR_DONT_LOAD_PREFS=1
@@ -129,8 +138,15 @@ export GR_DONT_LOAD_PREFS
 ok=yes
 for file in $3/qa_*.py
 do
-  if ! @PYTHON@ $file
+  # echo $file
+  @PYTHON@ $file
+  r=$?
+  if [ $r -ne 0 ]
   then
+    if [ $r -ge 128 ]          # killed by a signal
+    then
+      exit $r
+    fi
     ok=no
   fi  
 done