diff options
-rw-r--r-- | SConstruct | 58 | ||||
-rwxr-xr-x | regress-driver | 2 | ||||
-rw-r--r-- | tests/test_bits.c (renamed from test_bits.c) | 2 | ||||
-rw-r--r-- | tests/test_float.c (renamed from test_float.c) | 0 | ||||
-rw-r--r-- | tests/test_geoid.c (renamed from test_geoid.c) | 2 | ||||
-rw-r--r-- | tests/test_gpsmm.cpp (renamed from test_gpsmm.cpp) | 0 | ||||
-rw-r--r-- | tests/test_json.c (renamed from test_json.c) | 6 | ||||
-rw-r--r-- | tests/test_libgps.c (renamed from test_libgps.c) | 6 | ||||
-rw-r--r-- | tests/test_matrix.c (renamed from test_matrix.c) | 7 | ||||
-rw-r--r-- | tests/test_mktime.c (renamed from test_mktime.c) | 5 | ||||
-rwxr-xr-x | tests/test_nmea2000 (renamed from test_nmea2000) | 0 | ||||
-rw-r--r-- | tests/test_packet.c (renamed from test_packet.c) | 2 | ||||
-rw-r--r-- | tests/test_timespec.c (renamed from test_timespec.c) | 11 | ||||
-rw-r--r-- | tests/test_trig.c (renamed from test_trig.c) | 0 |
14 files changed, 62 insertions, 39 deletions
@@ -1334,26 +1334,27 @@ if env["ncurses"]: bin_binaries += [cgps, gpsmon] # Test programs - always link locally and statically -test_bits = env.Program('test_bits', ['test_bits.c'], +test_bits = env.Program('tests/test_bits', ['tests/test_bits.c'], LIBS=['gps_static']) -test_float = env.Program('test_float', ['test_float.c']) -test_geoid = env.Program('test_geoid', ['test_geoid.c'], +test_float = env.Program('tests/test_float', ['tests/test_float.c']) +test_geoid = env.Program('tests/test_geoid', ['tests/test_geoid.c'], LIBS=['gpsd', 'gps_static'], parse_flags=gpsdflags) -test_matrix = env.Program('test_matrix', ['test_matrix.c'], +test_matrix = env.Program('tests/test_matrix', ['tests/test_matrix.c'], LIBS=['gpsd', 'gps_static'], parse_flags=gpsdflags) -test_mktime = env.Program('test_mktime', ['test_mktime.c'], +test_mktime = env.Program('tests/test_mktime', ['tests/test_mktime.c'], LIBS=['gps_static'], parse_flags=["-lm"]) -test_packet = env.Program('test_packet', ['test_packet.c'], +test_packet = env.Program('tests/test_packet', ['tests/test_packet.c'], LIBS=['gpsd', 'gps_static'], parse_flags=gpsdflags) -test_timespec = env.Program('test_timespec', ['test_timespec.c'], +test_timespec = env.Program('tests/test_timespec', ['tests/test_timespec.c'], LIBS=['gpsd', 'gps_static'], parse_flags=gpsdflags) -test_trig = env.Program('test_trig', ['test_trig.c'], parse_flags=["-lm"]) +test_trig = env.Program('tests/test_trig', ['tests/test_trig.c'], + parse_flags=["-lm"]) # test_libgps for glibc older than 2.17 -test_libgps = env.Program('test_libgps', ['test_libgps.c'], +test_libgps = env.Program('tests/test_libgps', ['tests/test_libgps.c'], LIBS=['gps_static'], parse_flags=["-lm"] + rtlibs + dbusflags) @@ -1362,7 +1363,7 @@ if not env['socket_export']: test_json = None else: test_json = env.Program( - 'test_json', ['test_json.c'], + 'tests/test_json', ['tests/test_json.c'], LIBS=['gps_static'], parse_flags=["-lm"] + rtlibs + usbflags + dbusflags) @@ -1853,7 +1854,8 @@ if env['python']: maidenhead_locator_regress = UtilityWithHerald( 'Testing the Maidenhead Locator conversion...', 'maidenhead-locator-regress', [python_built_extensions], [ - '$PYTHON $PYTHON_COVERAGE $SRCDIR/test_maidenhead.py >/dev/null']) + '$PYTHON $PYTHON_COVERAGE $SRCDIR/test_maidenhead.py ' + ' >/dev/null']) # Sanity-check Python code. # Bletch. We don't really want to suppress W0231 E0602 E0611 E1123, @@ -1995,12 +1997,12 @@ audit = env.Alias('audit', # Unit-test the bitfield extractor bits_regress = Utility('bits-regress', [test_bits], [ - '$SRCDIR/test_bits --quiet' + '$SRCDIR/tests/test_bits --quiet' ]) # Unit-test the bitfield extractor matrix_regress = Utility('matrix-regress', [test_matrix], [ - '$SRCDIR/test_matrix --quiet' + '$SRCDIR/tests/test_matrix --quiet' ]) # using regress-drivers requires socket_export being enabled. @@ -2152,26 +2154,27 @@ Utility('aivdm-makeregress', [gpsdecode], [ packet_regress = UtilityWithHerald( 'Testing detection of invalid packets...', 'packet-regress', [test_packet], [ - '$SRCDIR/test_packet | diff -u $SRCDIR/test/packet.test.chk -', ]) + '$SRCDIR/tests/test_packet | diff -u $SRCDIR/test/packet.test.chk -', ]) # Rebuild the packet-getter regression test Utility('packet-makeregress', [test_packet], [ - '$SRCDIR/test_packet >$SRCDIR/test/packet.test.chk', ]) + '$SRCDIR/tests/test_packet >$SRCDIR/test/packet.test.chk', ]) # Rebuild the geoid test Utility('geoid-makeregress', [test_geoid], [ - '$SRCDIR/test_geoid 37.371192 122.014965 >$SRCDIR/test/geoid.test.chk']) + '$SRCDIR/tests/test_geoid 37.371192 122.014965 ' + ' >$SRCDIR/test/geoid.test.chk']) # Regression-test the geoid tester. geoid_regress = UtilityWithHerald( 'Testing the geoid model...', 'geoid-regress', [test_geoid], [ - '$SRCDIR/test_geoid 37.371192 122.014965' + '$SRCDIR/tests/test_geoid 37.371192 122.014965' ' | diff -u $SRCDIR/test/geoid.test.chk -', ]) # Regression-test the calendar functions time_regress = Utility('time-regress', [test_mktime], [ - '$SRCDIR/test_mktime' + '$SRCDIR/tests/test_mktime' ]) # Regression test the unpacking code in libgps @@ -2194,18 +2197,29 @@ Utility('unpack-makeregress', [test_libgps], [ if not env['socket_export']: json_regress = None else: - json_regress = Utility('json-regress', [test_json], ['$SRCDIR/test_json']) + json_regress = Utility('json-regress', [test_json], + ['$SRCDIR/tests/test_json']) # Unit-test timespec math timespec_regress = Utility('timespec-regress', [test_timespec], [ - '$SRCDIR/test_timespec' + '$SRCDIR/tests/test_timespec' +]) + +# Unit-test float math +float_regress = Utility('float-regress', [test_float], [ + '$SRCDIR/tests/test_float' +]) + +# Unit-test trig math +trig_regress = Utility('trig-regress', [test_trig], [ + '$SRCDIR/tests/test_trig' ]) # consistency-check the driver methods method_regress = UtilityWithHerald( 'Consistency-checking driver methods...', 'method-regress', [test_packet], [ - '$SRCDIR/test_packet -c >/dev/null', ]) + '$SRCDIR/tests/test_packet -c >/dev/null', ]) # Test the xgps/xgpsspeed dependencies if not env['python'] or not env['xgps']: @@ -2241,6 +2255,7 @@ test_nondaemon = [ aivdm_regress, bits_regress, describe, + float_regress, geoid_regress, json_regress, maidenhead_locator_regress, @@ -2253,6 +2268,7 @@ test_nondaemon = [ test_xgps_deps, time_regress, timespec_regress, + # trig_regress, # not ready unpack_regress, ] diff --git a/regress-driver b/regress-driver index fe42970a..0cd09513 100755 --- a/regress-driver +++ b/regress-driver @@ -138,7 +138,7 @@ case $mode in trap 'rm -f ${TMP}/test-$$.chk; exit $errors' EXIT HUP INT TERM case $testing in daemon) TMPDIR=${TMP} ${PYTHON} ${PYTHON_COVERAGE} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} ${ALTFILTER} >${TMP}/test-$$.chk ;; - clientlib) ${GPSD_HOME}/test_libgps -b <${f} >${TMP}/test-$$.chk ;; + clientlib) ${GPSD_HOME}/tests/test_libgps -b <${f} >${TMP}/test-$$.chk ;; esac if [ "${ALTFILTER}" ] then diff --git a/test_bits.c b/tests/test_bits.c index b474996a..a0af7470 100644 --- a/test_bits.c +++ b/tests/test_bits.c @@ -10,7 +10,7 @@ #include <string.h> #include <stdint.h> #include <stdbool.h> -#include "bits.h" +#include "../bits.h" static unsigned char buf[80]; static signed char sb1, sb2; diff --git a/test_float.c b/tests/test_float.c index 8d17f218..8d17f218 100644 --- a/test_float.c +++ b/tests/test_float.c diff --git a/test_geoid.c b/tests/test_geoid.c index b863c85f..cd2213c8 100644 --- a/test_geoid.c +++ b/tests/test_geoid.c @@ -8,7 +8,7 @@ #include <stdlib.h> #include <stdarg.h> -#include "gpsd.h" +#include "../gpsd.h" int main(int argc, char **argv) { diff --git a/test_gpsmm.cpp b/tests/test_gpsmm.cpp index 4106b476..4106b476 100644 --- a/test_gpsmm.cpp +++ b/tests/test_gpsmm.cpp diff --git a/test_json.c b/tests/test_json.c index 82263ac2..01f36d3a 100644 --- a/test_json.c +++ b/tests/test_json.c @@ -10,9 +10,9 @@ #include <stddef.h> #include <getopt.h> -#include "gpsd.h" -#include "gps_json.h" -#include "revision.h" +#include "../gpsd.h" +#include "../gps_json.h" +#include "../revision.h" /* GPSD is built with JSON_MINIMAL. Any !JSON_MINIMAL tests, * like 18, 19 and 20 will thus fail. diff --git a/test_libgps.c b/tests/test_libgps.c index 11f77ea2..050cd443 100644 --- a/test_libgps.c +++ b/tests/test_libgps.c @@ -11,9 +11,9 @@ #include <stdarg.h> #include <ctype.h> -#include "gps.h" -#include "libgps.h" -#include "gpsdclient.h" +#include "../gps.h" +#include "../libgps.h" +#include "../gpsdclient.h" #include <unistd.h> #include <getopt.h> diff --git a/test_matrix.c b/tests/test_matrix.c index b7e78851..a4a342aa 100644 --- a/test_matrix.c +++ b/tests/test_matrix.c @@ -3,6 +3,9 @@ * * Check examples computed at * http://www.elektro-energetika.cz/calculations/matreg.php + * + * This file is Copyright (c) 2010 by the GPSD project + * SPDX-License-Identifier: BSD-2-clause */ #include <stdlib.h> #include <stdbool.h> @@ -10,8 +13,8 @@ #include <stdio.h> #include <math.h> -#include "compiler.h" -#include "matrix.h" +#include "../compiler.h" +#include "../matrix.h" static struct { double mat[4][4]; diff --git a/test_mktime.c b/tests/test_mktime.c index d006010a..46b49556 100644 --- a/test_mktime.c +++ b/tests/test_mktime.c @@ -5,14 +5,15 @@ * This file is Copyright (c) 2010 by the GPSD project * SPDX-License-Identifier: BSD-2-clause */ +#include <math.h> /* for fabs() */ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> -#include "gps.h" -#include "compiler.h" +#include "../gps.h" +#include "../compiler.h" static struct { diff --git a/test_nmea2000 b/tests/test_nmea2000 index d154ef22..d154ef22 100755 --- a/test_nmea2000 +++ b/tests/test_nmea2000 diff --git a/test_packet.c b/tests/test_packet.c index 5106e340..6f486b24 100644 --- a/test_packet.c +++ b/tests/test_packet.c @@ -11,7 +11,7 @@ #include <fcntl.h> #include <unistd.h> -#include "gpsd.h" +#include "../gpsd.h" static int verbose = 0; diff --git a/test_timespec.c b/tests/test_timespec.c index 00b6c8b4..826071b0 100644 --- a/test_timespec.c +++ b/tests/test_timespec.c @@ -1,6 +1,9 @@ /* * Unit test for timespec's * + * This file is Copyright (c) 2010 by the GPSD project + * SPDX-License-Identifier: BSD-2-clause + * */ #include <stdlib.h> #include <stdbool.h> @@ -11,10 +14,10 @@ #include <math.h> #include <unistd.h> -#include "compiler.h" -#include "revision.h" -#include "ppsthread.h" -#include "timespec.h" +#include "../compiler.h" +#include "../revision.h" +#include "../ppsthread.h" +#include "../timespec.h" #define TS_ZERO {0,0} #define TS_ZERO_ONE {0,1} diff --git a/test_trig.c b/tests/test_trig.c index 760dd0e7..760dd0e7 100644 --- a/test_trig.c +++ b/tests/test_trig.c |