]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Put the sntp tests under sntp/
authorHarlan Stenn <stenn@ntp.org>
Sun, 31 Oct 2010 03:28:54 +0000 (20:28 -0700)
committerHarlan Stenn <stenn@ntp.org>
Sun, 31 Oct 2010 03:28:54 +0000 (20:28 -0700)
---
Put the sntp tests under sntp/

bk: 4ccce276-GfAYIBBAIqc8cgxWfxqOw

39 files changed:
ChangeLog
configure.ac
sntp/Makefile.am
sntp/configure.ac
sntp/tests/Makefile.am [new file with mode: 0644]
sntp/tests/crypto.cpp [moved from tests/sntp/crypto.cpp with 100% similarity]
sntp/tests/data/debug-input-lfp-bin [moved from tests/sntp/data/debug-input-lfp-bin with 100% similarity]
sntp/tests/data/debug-input-lfp-dec [moved from tests/sntp/data/debug-input-lfp-dec with 100% similarity]
sntp/tests/data/debug-input-lfp-hex [moved from tests/sntp/data/debug-input-lfp-hex with 100% similarity]
sntp/tests/data/debug-input-pkt [moved from tests/sntp/data/debug-input-pkt with 100% similarity]
sntp/tests/data/key-test-ascii [moved from tests/sntp/data/key-test-ascii with 100% similarity]
sntp/tests/data/key-test-comments [moved from tests/sntp/data/key-test-comments with 100% similarity]
sntp/tests/data/key-test-empty [moved from tests/sntp/data/key-test-empty with 100% similarity]
sntp/tests/data/key-test-hex [moved from tests/sntp/data/key-test-hex with 100% similarity]
sntp/tests/data/key-test-invalid-hex [moved from tests/sntp/data/key-test-invalid-hex with 100% similarity]
sntp/tests/data/kod-expected-multiple [moved from tests/sntp/data/kod-expected-multiple with 100% similarity]
sntp/tests/data/kod-expected-single [moved from tests/sntp/data/kod-expected-single with 100% similarity]
sntp/tests/data/kod-test-blanks [moved from tests/sntp/data/kod-test-blanks with 100% similarity]
sntp/tests/data/kod-test-correct [moved from tests/sntp/data/kod-test-correct with 100% similarity]
sntp/tests/data/kod-test-empty [moved from tests/sntp/data/kod-test-empty with 100% similarity]
sntp/tests/data/log-expected-debug [moved from tests/sntp/data/log-expected-debug with 100% similarity]
sntp/tests/data/log-expected-log [moved from tests/sntp/data/log-expected-log with 100% similarity]
sntp/tests/fileHandlingTest.h [moved from tests/sntp/fileHandlingTest.h with 100% similarity]
sntp/tests/keyFile.cpp [moved from tests/sntp/keyFile.cpp with 100% similarity]
sntp/tests/kodDatabase.cpp [moved from tests/sntp/kodDatabase.cpp with 100% similarity]
sntp/tests/kodFile.cpp [moved from tests/sntp/kodFile.cpp with 100% similarity]
sntp/tests/logFile.cpp [moved from tests/sntp/logFile.cpp with 100% similarity]
sntp/tests/networking.cpp [moved from tests/sntp/networking.cpp with 100% similarity]
sntp/tests/packetHandling.cpp [moved from tests/sntp/packetHandling.cpp with 100% similarity]
sntp/tests/packetProcessing.cpp [moved from tests/sntp/packetProcessing.cpp with 100% similarity]
sntp/tests/sntptest.cpp [moved from tests/sntp/sntptest.cpp with 100% similarity]
sntp/tests/sntptest.h [moved from tests/sntp/sntptest.h with 100% similarity]
sntp/tests/test-driver [moved from tests/sntp/test-driver with 100% similarity]
sntp/tests/utilities.cpp [moved from tests/sntp/utilities.cpp with 100% similarity]
sntp/tests_main.cpp [moved from tests/tests_main.cpp with 100% similarity]
sntp/tests_main.h [moved from tests/tests_main.h with 100% similarity]
tests/Makefile.am
tests/libntp/Makefile.am
tests/sntp/Makefile.am [deleted file]

index 24e0c4c0cc2430152de52d2886f11da52153dc99..054ed9075a9c363b4bf160cb4e19a7f8b2dfbb0f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* Put the sntp tests under sntp/ .
 * Documentation updates from Dave Mills.
 * Include Linus Karlsson's GSoC 2010 testing code.
 (4.2.7p74) 2010/10/29 Released by Harlan Stenn <stenn@ntp.org>
index bfd076dca8ffa1895273983c0b1576f996c9dfe9..38c6d2bb67062dce324661016a6a8b77d0eb5ada 100644 (file)
@@ -4910,7 +4910,6 @@ AM_CONDITIONAL([GTEST_AVAILABLE], [test x${GTEST_CONFIG} != x])
 
 AC_CONFIG_FILES(tests/Makefile)
 AC_CONFIG_FILES(tests/libntp/Makefile)
-AC_CONFIG_FILES(tests/sntp/Makefile)
 
 AC_CONFIG_SUBDIRS(sntp)
 
index bb0952f9b82a2b7e03d7ef5507098b789cbe48ee..9a470e141e1d0d53f894c6bbe81b1e2609a9a514 100644 (file)
@@ -28,6 +28,7 @@ if NEED_LIBOPTS
 SUBDIRS+= libopts
 endif
 SUBDIRS+= .
+SUBDIRS+= tests
 
 sntp_SOURCES =         \
        crypto.c        \
index 0c907ccd6e8f97e8a5bf0f83e413ad638c742517..00a141eea8af2e811d0c22f8302fce63318e748a 100644 (file)
@@ -43,6 +43,9 @@ AC_CONFIG_HEADER([config.h])
 dnl AC_ARG_PROGRAM
 AC_PREREQ([2.53])
 
+# Expose a cross-compilation indicator to makefiles
+AM_CONDITIONAL(SNTP_CROSSCOMPILE, test $build != $host)
+
 # Checks for programs.
 AC_PROG_CC
 
@@ -790,4 +793,21 @@ AC_SUBST(BINSUBDIR)
 AM_CONDITIONAL(NTP_BINSUBDIR_IS_BIN, test "bin" = "$BINSUBDIR")
 
 AC_CONFIG_FILES([Makefile])
+
+AC_PROG_CXX
+
+AC_PATH_PROG([GTEST_CONFIG], [gtest-config])
+if test x${GTEST_CONFIG} != x ; then
+       GTEST_LDFLAGS=`$GTEST_CONFIG --ldflags`
+       GTEST_LIBS=`$GTEST_CONFIG --libs`
+       GTEST_CXXFLAGS=`$GTEST_CONFIG --cxxflags`
+       GTEST_CPPFLAGS=`$GTEST_CONFIG --cppflags`
+       AC_SUBST(GTEST_LDFLAGS)
+       AC_SUBST(GTEST_LIBS)
+       AC_SUBST(GTEST_CXXFLAGS)
+       AC_SUBST(GTEST_CPPFLAGS)
+fi
+AM_CONDITIONAL([GTEST_AVAILABLE], [test x${GTEST_CONFIG} != x])
+
+AC_CONFIG_FILES(tests/Makefile)
 AC_OUTPUT
diff --git a/sntp/tests/Makefile.am b/sntp/tests/Makefile.am
new file mode 100644 (file)
index 0000000..f373675
--- /dev/null
@@ -0,0 +1,54 @@
+check_PROGRAMS = tests
+
+sntp_objs = ..
+
+sntp_SOURCES_USED =    $(sntp_objs)/crypto.o           \
+                       $(sntp_objs)/kod_management.o   \
+                       $(sntp_objs)/log.o              \
+                       $(sntp_objs)/main.o             \
+                       $(sntp_objs)/networking.o       \
+                       $(sntp_objs)/sntp-opts.o                \
+                       $(sntp_objs)/utilities.o
+
+base_SOURCES =         $(srcdir)/../tests_main.cpp     \
+                       sntptest.cpp
+
+tests_SOURCES = $(base_SOURCES)                \
+               crypto.cpp              \
+               keyFile.cpp             \
+               kodDatabase.cpp         \
+               kodFile.cpp             \
+               logFile.cpp             \
+               networking.cpp          \
+               packetHandling.cpp      \
+               packetProcessing.cpp    \
+               utilities.cpp
+
+LDADD =        @GTEST_LDFLAGS@                 \
+               @GTEST_LIBS@                    \
+               $(LIBOPTS_LDADD)                \
+               @top_builddir@/../libntp/libntp.a       \
+               @LCRYPTO@                       \
+               $(sntp_SOURCES_USED)
+
+AM_CXXFLAGS = @GTEST_CXXFLAGS@
+AM_CPPFLAGS = @GTEST_CPPFLAGS@
+
+INCLUDES = $(LIBOPTS_CFLAGS)                           \
+       -I$(top_srcdir)/../include                      \
+       -I$(top_srcdir)/../lib/isc/include              \
+       -I$(top_srcdir)/../lib/isc/nothreads/include    \
+       -I$(top_srcdir)/../lib/isc/unix/include         \
+       -I$(top_srcdir)/../tests                        \
+       -I$(top_srcdir)
+
+TESTS = 
+
+TEST_INPUT_DIR = $(abs_srcdir)/data
+TEST_OUTPUT_DIR = $(abs_builddir)/data
+
+TESTS_ENVIRONMENT = $(top_srcdir)/tests/test-driver $(TEST_INPUT_DIR) $(TEST_OUTPUT_DIR)
+
+if !SNTP_CROSSCOMPILE
+TESTS += $(check_PROGRAMS)
+endif
similarity index 100%
rename from tests/sntp/crypto.cpp
rename to sntp/tests/crypto.cpp
similarity index 100%
rename from tests/sntp/sntptest.h
rename to sntp/tests/sntptest.h
similarity index 100%
rename from tests/tests_main.cpp
rename to sntp/tests_main.cpp
similarity index 100%
rename from tests/tests_main.h
rename to sntp/tests_main.h
index eea4e89685b047373b413164b05b6149d9c5320e..5b02c6e0d5a8219fc4bb89c8dbeccab1e310d80d 100644 (file)
@@ -1,6 +1,6 @@
 SUBDIRS = 
 
 if GTEST_AVAILABLE
-SUBDIRS += libntp sntp
+SUBDIRS += libntp
 endif
 
index 06a7898bc8272cd20854cc1797cd032bb5d41c4a..bc5c2ffde599a0a630ba1c8ed69cc6dc6d649c90 100644 (file)
@@ -2,7 +2,7 @@ check_PROGRAMS = tests
 LDADD = @LCRYPTO@ @GTEST_LDFLAGS@ @GTEST_LIBS@ @top_builddir@/libntp/libntp.a
 AM_CXXFLAGS = @GTEST_CXXFLAGS@
 AM_CPPFLAGS = @GTEST_CPPFLAGS@
-tests_SOURCES = ../tests_main.cpp      \
+tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp      \
                libntptest.cpp          \
                a_md5encrypt.cpp        \
                atoint.cpp              \
@@ -40,10 +40,12 @@ tests_SOURCES = ../tests_main.cpp   \
                ymd2yd.cpp
 
 
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \
-       -I$(top_srcdir)/lib/isc/nothreads/include \
-       -I$(top_srcdir)/lib/isc/unix/include \
-       -I$(top_srcdir)/tests
+INCLUDES =                                             \
+       -I$(top_srcdir)/include                         \
+       -I$(top_srcdir)/lib/isc/include                 \
+       -I$(top_srcdir)/lib/isc/nothreads/include       \
+       -I$(top_srcdir)/lib/isc/unix/include            \
+       -I$(top_srcdir)/sntp
 
 TESTS = 
 
diff --git a/tests/sntp/Makefile.am b/tests/sntp/Makefile.am
deleted file mode 100644 (file)
index d2cfb68..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-check_PROGRAMS = tests
-
-sntp_src = $(top_builddir)/sntp
-
-sntp_SOURCES_USED =    $(sntp_src)/crypto.o            \
-                       $(sntp_src)/kod_management.o    \
-                       $(sntp_src)/log.o               \
-                       $(sntp_src)/main.o              \
-                       $(sntp_src)/networking.o        \
-                       $(sntp_src)/sntp-opts.o         \
-                       $(sntp_src)/utilities.o
-
-base_SOURCES =         ../tests_main.cpp       \
-                       sntptest.cpp
-
-tests_SOURCES = $(base_SOURCES)                \
-               crypto.cpp              \
-               keyFile.cpp             \
-               kodDatabase.cpp         \
-               kodFile.cpp             \
-               logFile.cpp             \
-               networking.cpp          \
-               packetHandling.cpp      \
-               packetProcessing.cpp    \
-               utilities.cpp
-
-LDADD =        @GTEST_LDFLAGS@                 \
-               @GTEST_LIBS@                    \
-               $(LIBOPTS_LDADD)                \
-               @top_builddir@/libntp/libntp.a  \
-               @LCRYPTO@                       \
-               $(sntp_SOURCES_USED)
-
-AM_CXXFLAGS = @GTEST_CXXFLAGS@
-AM_CPPFLAGS = @GTEST_CPPFLAGS@
-
-INCLUDES = $(LIBOPTS_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \
-       -I$(top_srcdir)/lib/isc/nothreads/include \
-       -I$(top_srcdir)/lib/isc/unix/include \
-       -I$(top_srcdir)/tests \
-       -I$(top_srcdir)/sntp
-
-TESTS = 
-
-TEST_INPUT_DIR = $(abs_srcdir)/data
-TEST_OUTPUT_DIR = $(abs_builddir)/data
-
-TESTS_ENVIRONMENT = $(top_srcdir)/tests/sntp/test-driver $(TEST_INPUT_DIR) $(TEST_OUTPUT_DIR)
-
-if !NTP_CROSSCOMPILE
-TESTS += $(check_PROGRAMS)
-endif