2007-03-08 Bruno Haible <bruno@clisp.org>
+ * modules/fprintf-posix-tests: New file.
+ * tests/test-fprintf-posix.sh: New file.
+ * tests/test-fprintf-posix.c: New file.
+
* modules/fprintf-posix: New file.
* lib/fprintf.c: New file.
* m4/fprintf-posix.m4: New file.
--- /dev/null
+Files:
+tests/test-fprintf-posix.sh
+tests/test-fprintf-posix.c
+tests/test-fprintf-posix.h
+tests/test-fprintf-posix.out
+
+Depends-on:
+stdint
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-fprintf-posix.sh
+TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='$(srcdir)'
+check_PROGRAMS += test-fprintf-posix
+EXTRA_DIST += test-fprintf-posix.sh test-fprintf-posix.h test-fprintf-posix.out
--- /dev/null
+/* Test of POSIX compatible fprintf() function.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+
+ This program 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.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A 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 this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define ASSERT(expr) if (!(expr)) abort ();
+
+#include "test-fprintf-posix.h"
+
+int
+main (int argc, char *argv[])
+{
+ test_function (fprintf);
+ return 0;
+}
--- /dev/null
+#!/bin/sh
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles t-fprintf-posix.tmp"
+./test-fprintf-posix${EXEEXT} > t-fprintf-posix.tmp || exit 1
+
+: ${DIFF=diff}
+${DIFF} "${srcdir}/test-fprintf-posix.out" t-fprintf-posix.tmp
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result