From 4935f56f5f05dcd9bf86551a137ddb22fcdc2186 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Sat, 12 Apr 2003 17:51:51 +0200
Subject: [PATCH] (TS_SH): New test case symbols-test. (EXTRA_PROGRAMS): Added
 testutils, as a kludge to get automake to track dependencies for testutils.o.

Rev: src/nettle/testsuite/Makefile.am:1.38
Rev: src/nettle/testsuite/symbols-test:1.1
---
 testsuite/Makefile.am  |  7 +++++--
 testsuite/symbols-test | 18 ++++++++++++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100755 testsuite/symbols-test

diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index d530f798..a239440c 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -19,17 +19,20 @@ TS_PROGS = aes-test arcfour-test blowfish-test cast128-test \
 	   dsa-test dsa-keygen-test \
 	   yarrow-test
 
-TS_SH = sexp-conv-test
+TS_SH = sexp-conv-test symbols-test
 
 TS_ALL = $(TS_PROGS) $(TS_SH)
 
 noinst_PROGRAMS = $(TS_PROGS)
 
+# Workaround to get automake to keep dependencies for testutils.o
+EXTRA_PROGRAMS = testutils
+
 # libnettle.a is added at the end to make sure all programs depend on it.
 # It seems there's no DEPENDENCIES variable that affects all programs.
 
 LDADD = testutils.o -lnettle ../libnettle.a
-EXTRA_DIST = $(TS_SH) testutils.c testutils.h \
+EXTRA_DIST = $(TS_SH) testutils.h \
 	     run-tests rfc1750.txt
 
 CLEANFILES = test.in test1.out test2.out
diff --git a/testsuite/symbols-test b/testsuite/symbols-test
new file mode 100755
index 00000000..d6bd4840
--- /dev/null
+++ b/testsuite/symbols-test
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+# Check that all exported symbols use the nettle prefix.
+
+if [ -z "$srcdir" ] ; then
+  srcdir=`pwd`
+fi
+
+nm ../libnettle.a | grep ' [DRT] ' | egrep -v ' _?nettle_|memxor' \
+    | sort -k3 > test1.out
+
+if [ -s test1.out ] ; then
+    echo Exported symbols lacking the nettle prefix:
+    cat test1.out
+    exit 1
+else
+    exit 0
+fi
-- 
GitLab