]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Make sure we have an "author" file for git imports. HStenn.
authorHarlan Stenn <stenn@ntp.org>
Tue, 24 May 2016 09:58:00 +0000 (02:58 -0700)
committerHarlan Stenn <stenn@ntp.org>
Tue, 24 May 2016 09:58:00 +0000 (02:58 -0700)
bk: 574425a8cLExBq7lmvD1pbnMYCAfTg

ChangeLog
configure.ac
scripts/build/Makefile.am
scripts/build/genAuthors.in [new file with mode: 0644]
sntp/configure.ac
sntp/m4/ntp_problemtests.m4
sntp/m4/sntp_problemtests.m4 [new file with mode: 0644]
sntp/tests/Makefile.am

index 88057044818858909c382d82e930274d7e223fc6..7577841ce4f4d8511d9597f1d42b64760a7530d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 ---
 
 * [Sec 3042] Broadcast Interleave.  HStenn.
+* Make sure we have an "author" file for git imports.  HStenn.
+* Update the sntp problem tests for MacOS.  HStenn.
 
 ---
 (4.2.8p7) 2016/04/26 Released by Harlan Stenn <stenn@ntp.org>
index caba8f6884422a068026ad4aae26228e8e8af7ff..a34ed6d83c5bf9405e15d7a57c89be88429965e7 100644 (file)
@@ -4397,6 +4397,7 @@ AC_CONFIG_FILES([ntpsnmpd/Makefile])
 AC_CONFIG_FILES([parseutil/Makefile])
 AC_CONFIG_FILES([scripts/Makefile])
 AC_CONFIG_FILES([scripts/build/Makefile])
+AC_CONFIG_FILES([scripts/build/genAuthors],    [chmod +x scripts/build/genAuthors])
 AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver])
 AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
 AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
index 51a1bbccfb64868f194a56f22afb40e31ff32ad6..a165b1cd88f327ae584cb47180aa99cc80f3c8a3 100644 (file)
@@ -1,7 +1,7 @@
 run_ag=                cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D  \
                autogen -L ../sntp/include -L ../sntp/ag-tpl
 
-noinst_SCRIPTS = mkver
+noinst_SCRIPTS = genAuthors mkver
 
 NULL=
 EXTRA_DIST =                   \
diff --git a/scripts/build/genAuthors.in b/scripts/build/genAuthors.in
new file mode 100644 (file)
index 0000000..f0e49c5
--- /dev/null
@@ -0,0 +1,82 @@
+#! @PATH_PERL@
+
+# DESCRIPTION
+#
+# Make sure we have the list of authors for git imports.
+# Call with the path to the Authors/ subdirectory.
+#
+# AUTHOR
+#
+#  Harlan Stenn
+#
+# LICENSE
+#
+#  This file is Copyright (c) 2016 Network Time Foundation
+#
+#  Copying and distribution of this file, with or without modification, are
+#  permitted in any medium without royalty provided the copyright notice,
+#  author attribution and this notice are preserved.  This file is offered
+#  as-is, without any warranty.
+
+use strict;
+use warnings;
+
+# Read in the list of known authors.
+# run:
+#  bk changes -and:USER: | sort -u
+# to get the list of users who have made commits.
+# Make sure that each of these users is in the set of known authors.
+# Make sure the format of that file is 1 or more lines of the form:
+#  user = User Name <user@place>
+#
+# If all of the above is true, exit 0.
+# If there are any problems, squawk and exit 1. 
+
+my $bk_u = "bk changes -and:USER: | sort -u |";
+chomp(my $bk_root = `bk root`);
+my $A_path = "$bk_root/BitKeeper/etc/authors.txt";
+my %authors;
+my $problem = 0;
+
+die "bkroot: <$bk_root>, A_path: <$A_path>\n" if (! -r $A_path);
+
+# Process the authors.txt file
+open(my $FILE, '<', $A_path) or die "Could not open <$A_path>: $!\n";
+while (<$FILE>) {
+  chomp;
+  if (/^([\S]+) = ([\V]+) <([\w.-]+\@[\w.-]+)>$/) {
+    # print "Got '$1 = $2 <$3>'\n";
+    $authors{$1} = "";
+  } else {
+    print "In $A_path: unrecognized line: '$_'\n";
+    $problem = 1;
+  }
+}
+close($FILE);
+
+#print "\%authors = ", join(' ', sort keys %authors), "\n";
+
+die "Fix the problem(s) noted above!\n" if $problem;
+
+# Process "bk changes ..."
+
+open(BKU, $bk_u) || die "$0: <$bk_u> failed: $!\n";
+while (<BKU>) {
+  chomp;
+  my $Name = $_;
+  my $name = lc;
+  # print "Got Name <$Name>, name <$name>\n";
+  if (!defined($authors{$Name})) {
+    $problem = 1;
+    print "<$Name> is not a defined author!\n";
+    open(my $FILE, '>>', "$A_path/$name.txt") || die "Cannot create '$A_path/$name.txt': $!\n";
+    print $FILE "$Name = \n";
+    close($FILE);
+  }
+}
+
+die "Fix the problem(s) noted above!\n" if $problem;
+
+# Local Variables:     **
+# mode:cperl           **
+# End:                 **
index a08aa134770116a2a696f43f2080449aac47f605..391e5866a708b9595ee77891479cd4fcb7ec88ee 100644 (file)
@@ -143,6 +143,8 @@ NTP_UNITYBUILD
 AC_PROG_CXX
 NTP_GOOGLETEST
 
+SNTP_PROBLEM_TESTS
+
 # All libraries should be in various LIB_* variables now. 
 #LIBS=
 # Sadly not.  There is a gettext() check somewhere, and on Solaris this pulls
index 7cc14c9eca2c3882e213dee687ccc6d59e0884f3..ebc2cd91b935169eceb277b9e1258e50662a1652 100644 (file)
@@ -55,5 +55,6 @@ case "$ntp_ept:$cross:$host" in
 esac
 AC_MSG_RESULT([$ntp_test_ntp_signd])
 AM_CONDITIONAL([BUILD_TEST_NTP_SIGND], [test x$ntp_test_ntp_signd = xyes])
+
 ])
 dnl ======================================================================
diff --git a/sntp/m4/sntp_problemtests.m4 b/sntp/m4/sntp_problemtests.m4
new file mode 100644 (file)
index 0000000..fcf7014
--- /dev/null
@@ -0,0 +1,47 @@
+dnl ######################################################################
+dnl SNTP_PROBLEM_TESTS
+dnl
+dnl Some platforms have problems building or running certain tests.
+dnl While we're in the initial phase of the deployment of the test
+dnl framework, sometimes we may need to disable these tests.
+dnl
+dnl This is where we do that.
+dnl
+AC_DEFUN([SNTP_PROBLEM_TESTS], [
+case "$build" in
+ $host)        cross=0 ;;
+ *)    cross=1 ;;
+esac
+
+AC_MSG_CHECKING([if we want to enable tests with undiagnosed problems])
+AC_ARG_ENABLE(
+    [problem-tests],
+    [AS_HELP_STRING(
+        [--enable-problem-tests],
+        [+ enable tests with undiagnosed problems]
+    )],
+    [sntp_ept=$enableval],
+    [sntp_ept=yes]
+)
+AC_MSG_RESULT([$sntp_ept])
+
+AC_MSG_CHECKING([if we can run test-kodDatabase])
+sntp_test_kodDatabase="no"
+case "$sntp_ept:$cross:$host" in
+ no:0:*-apple-darwin12.6.0) ;;
+ *) sntp_test_kodDatabase="yes" ;;
+esac
+AC_MSG_RESULT([$sntp_test_kodDatabase])
+AM_CONDITIONAL([BUILD_TEST_KODDATABASE], [test x$sntp_test_kodDatabase = xyes])
+
+AC_MSG_CHECKING([if we can run test-kodFile])
+sntp_test_kodFile="no"
+case "$sntp_ept:$cross:$host" in
+ no:0:*-apple-darwin12.6.0) ;;
+ *) sntp_test_kodFile="yes" ;;
+esac
+AC_MSG_RESULT([$sntp_test_kodFile])
+AM_CONDITIONAL([BUILD_TEST_KODFILE], [test x$sntp_test_kodFile = xyes])
+
+])
+dnl ======================================================================
index c5338c7918168bf4c4cc1a48991d4d9d2c3f8b90..0e14a87b176ee0040954cf620a96029f26d4aead 100644 (file)
@@ -34,8 +34,6 @@ run_unity =   cd $(srcdir) && ruby ../unity/auto/generate_test_runner.rb
 check_PROGRAMS =                       \
        test-crypto                     \
        test-keyFile                    \
-       test-kodDatabase                \
-       test-kodFile                    \
        test-log                        \
        test-networking                 \
        test-packetHandling             \
@@ -43,6 +41,14 @@ check_PROGRAMS =                     \
        test-utilities                  \
        $(NULL)
 
+if BUILD_TEST_KODDATABASE
+check_PROGRAMS += test-kodDatabase
+endif
+
+if BUILD_TEST_KODFILE
+check_PROGRAMS += test-kodFile
+endif
+
 noinst_HEADERS =               \
        sntptest.h              \
        $(NULL)