summaryrefslogtreecommitdiff
path: root/run_tests.sh.in
blob: 1562eeec6dc3ca2cfac9365c2759f45ea981013c (plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/sh

# First argument is absolute path to top of component source directory
# Second argument is absolute path to top of component build directory
# Third argument is component source directory for qa tests

# Absolute path to the top of the source directory
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

# 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

# Where to find core's swig generated shared libraries,
# and hand generated swig glue
grswigdir=@gnuradio_core_SWIGDIRPATH@

# Where to find core's python modules
grpydir=@gnuradio_core_PYDIRPATH@

# Construct search path for python modules, if each exists
for dir in $grswigdir $grpydir
do
    if [ "$dir" != "" ]
    then
	if [ "$PYTHONPATH" = "" ]
	then
	    PYTHONPATH="$dir"
	else
	    PYTHONPATH="$dir:$PYTHONPATH"
	fi
    fi
done

# Where to find pre-installed python modules
withpydirs=@with_PYDIRPATH@

# Add the 'with' dirs to the end of the python search path, if it exists
if [ "$withpydirs" != "" ]
then
    PYTHONPATH="$PYTHONPATH:$withpydirs"
fi

# Add the "my" dirs to the absolute front of the python search path
PYTHONPATH="$mylibdir:$mysrcdir:$mypydir:$PYTHONPATH"
export PYTHONPATH

# Where to find omnithread library files
gromnidir=@omnithread_LIBDIRPATH@

# Where to find gnuradio core's library files
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
do
    if [ "$dir" != "" ]
    then
	if [ "$grlibdir" = "" ]
	then
	    grlibdir="$dir"
	else
	    grlibdir="$dir:$grlibdir"
	fi
    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

# 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
    if [ "$DYLD_LIBRARY_PATH" = "" ]
    then
	DYLD_LIBRARY_PATH=$withlibdirs
    else
	DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$withlibdirs
    fi

    # For Win32
    if [ "$PATH" = "" ]
    then
	PATH=$withlibdirs
    else
	PATH=$PATH:$withlibdirs
    fi
fi

export DYLD_LIBRARY_PATH

# Don't load user or system prefs
GR_DONT_LOAD_PREFS=1
export GR_DONT_LOAD_PREFS

# Run everything that matches qa_*.py and return the final result.

ok=yes
for file in $3/qa_*.py
do
  if ! @PYTHON@ $file
  then
    ok=no
  fi  
done

if [ $ok = yes ]
then
  exit 0
else
  exit 1
fi