[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-inetutils] Add self-test directory tests/
From: |
Simon Josefsson |
Subject: |
[bug-inetutils] Add self-test directory tests/ |
Date: |
Thu, 12 Apr 2007 13:07:23 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux) |
Hi! This is a rather modest self-test, but I believe that if there
actually is a tests/ sub-directory, people might find it easier to add
more self-tests.
If we get bug reports about things that can easily be tested, writing
a self-test for it is a good idea.
Ok to install?
/Simon
? ._bootmp
? ._bootmp2
? config.h
? confpaths.h
? m4
? stamp-h1
? lib/.deps
? lib/Makefile
? lib/Makefile.in
? lib/alloca.h
? lib/charset.alias
? lib/configmake.h
? lib/glob.h
? lib/gnulib.mk
? lib/ref-add.sed
? lib/ref-del.sed
? lib/stdint.h
? lib/stdio.h
? lib/stdlib.h
? lib/string.h
? lib/sys
? lib/unistd.h
? tests/.deps
? tests/Makefile
? tests/Makefile.in
? tests/localhost
Index: ChangeLog
===================================================================
RCS file: /sources/inetutils/inetutils/ChangeLog,v
retrieving revision 1.262
diff -u -p -r1.262 ChangeLog
--- ChangeLog 12 Apr 2007 10:33:14 -0000 1.262
+++ ChangeLog 12 Apr 2007 11:06:19 -0000
@@ -1,3 +1,13 @@
+2007-04-12 Simon Josefsson <address@hidden>
+
+ * tests/Makefile.am: New file.
+
+ * tests/localhost.c: New self test.
+
+ * configure.ac: Build tests/Makefile.
+
+ * Makefile.am (SUBDIRS): Add tests/.
+
2007-04-12 Alfred M. Szmidt <address@hidden>
* bootstrap.conf (gnulib_modules): Removed `restrict' and
Index: Makefile.am
===================================================================
RCS file: /sources/inetutils/inetutils/Makefile.am,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile.am
--- Makefile.am 31 Mar 2007 14:47:36 -0000 1.31
+++ Makefile.am 12 Apr 2007 11:06:19 -0000
@@ -27,7 +27,7 @@ EXTRA_DIST = README-alpha paths ChangeLo
SUBDIRS = lib headers libinetutils libtelnet \
inetd telnetd libls ftpd rshd rlogind uucpd rexecd syslogd tftpd \
talkd telnet ftp rsh rcp rlogin tftp logger gwhois talk \
- libicmp ping doc ifconfig traceroute
+ libicmp ping doc ifconfig traceroute tests
DISTCLEANFILES = pathdefs.make paths.defs include/*.h include/*/*.h \
include/stamp-h
Index: configure.ac
===================================================================
RCS file: /sources/inetutils/inetutils/configure.ac,v
retrieving revision 1.38
diff -u -p -r1.38 configure.ac
--- configure.ac 12 Apr 2007 10:31:28 -0000 1.38
+++ configure.ac 12 Apr 2007 11:06:19 -0000
@@ -792,5 +792,6 @@ confpaths.h:confpaths.h.in
headers/Makefile
doc/Makefile
doc/rfc/Makefile
+tests/Makefile
])
AC_OUTPUT
Index: tests/Makefile.am
===================================================================
RCS file: tests/Makefile.am
diff -N tests/Makefile.am
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/Makefile.am 12 Apr 2007 11:06:19 -0000
@@ -0,0 +1,23 @@
+# Copyright (C) 2007 Free Software Foundation, Inc.
+# This file is part of GNU Inetutils.
+#
+# GNU Inetutils is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Inetutils is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Inetutils; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin Street,
+# Fifth Floor, Boston, MA 02110-1301 USA.
+
+AM_CPPFLAGS = -I$(top_srcdir)/libinetutils
+LDADD = -L../libinetutils -linetutils
+
+TESTS = localhost
+check_PROGRAMS = localhost
Index: tests/localhost.c
===================================================================
RCS file: tests/localhost.c
diff -N tests/localhost.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/localhost.c 12 Apr 2007 11:06:19 -0000
@@ -0,0 +1,33 @@
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+
+ This file is part of GNU Inetutils.
+
+ GNU Inetutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Inetutils is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Inetutils; see the file COPYING. If not, write
+ to the Free Software Foundation, Inc., 51 Franklin Street,
+ Fifth Floor, Boston, MA 02110-1301 USA. */
+
+#include "libinetutils.h"
+
+int main (void)
+{
+ const char *p = localhost ();
+
+ if (!p)
+ return 1;
+
+ printf ("localhost: %s\n", p);
+
+ return 0;
+}
+
- [bug-inetutils] Add self-test directory tests/,
Simon Josefsson <=