1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

Tests for module 'fprintf-posix'.

This commit is contained in:
Bruno Haible
2007-03-09 03:00:45 +00:00
parent 685bc46ea3
commit f26a01b9ca
4 changed files with 76 additions and 0 deletions

View File

@@ -1,5 +1,9 @@
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.

View File

@@ -0,0 +1,16 @@
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

View File

@@ -0,0 +1,41 @@
/* 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;
}

15
tests/test-fprintf-posix.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/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