From: Harlan Stenn Date: Tue, 19 May 2015 09:33:10 +0000 (+0000) Subject: Unity test framework fixes X-Git-Tag: NTP_4_3_40~6^2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74de7c29d89c8334cf7147eb4737726a10f00553;p=thirdparty%2Fntp.git Unity test framework fixes bk: 555b03567V-dTk2ppUtBqhRSNv8lXw --- diff --git a/ChangeLog b/ChangeLog index 362d99834..1fc331827 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ --- +* Unity test framework fixes. * Initial support for PACKAGE_VERSION tests. --- (4.2.8p3-RC1) 2015/05/12 Released by Harlan Stenn diff --git a/configure.ac b/configure.ac index 30b1cad48..9b687b960 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,7 @@ ntp_jupiter_ok=${ntp_jupiter_ok=no} NTP_PROG_CC AC_PROG_CPP +# Do we need CXX for anything besides google test? AC_PROG_CXX AC_PROG_YACC AC_PROG_CC_C_O @@ -4342,6 +4343,8 @@ esac AM_CONDITIONAL([SAVECONFIG_ENABLED], [test x$ntp_saveconfig_enabled = x1]) AC_MSG_RESULT([$ntp_ok]) +NTP_UNITYTEST + dnl gtest is needed for our tests subdirs. It would be nice if we could dnl require a C++ compiler only if we will use gtest, but AC_PROG_CXX dnl can't be conditionalized. diff --git a/sntp/configure.ac b/sntp/configure.ac index 1b0e1e877..0462fb1cc 100644 --- a/sntp/configure.ac +++ b/sntp/configure.ac @@ -137,6 +137,7 @@ AC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff]) # Checks for library functions. AC_CHECK_FUNCS([socket]) +NTP_UNITYTEST # HMS: if we don't find c++ we should not look for gtest. AC_PROG_CXX NTP_GOOGLETEST diff --git a/sntp/m4/ntp_unitytest.m4 b/sntp/m4/ntp_unitytest.m4 new file mode 100644 index 000000000..1f1853583 --- /dev/null +++ b/sntp/m4/ntp_unitytest.m4 @@ -0,0 +1,19 @@ +dnl ###################################################################### +dnl NTP_UNITYBUILD - Unity build support +dnl shared by top-level and sntp/configure.ac +AC_DEFUN([NTP_UNITYBUILD], [ +# We may not need have_unity +have_unity=false +AC_PATH_PROG([ruby]) +case "$PATH_RUBY" in + /*) + have_unity=true + ;; + *) PATH_RUBY="false" + ;; +esac +# We may not need UNITYBUILD_AVAILABLE +AM_CONDITIONAL([UNITYBUILD_AVAILABLE], [$have_unity]) + +]) +dnl ======================================================================