Blame test-skeleton.c

Packit Service 82fcde
/* Legacy test skeleton.
Packit Service 82fcde
   Copyright (C) 1998-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
/* This test skeleton is to support running existing tests.  New tests
Packit Service 82fcde
   should use <support/test-driver.c> instead; see the documentation
Packit Service 82fcde
   in that file for instructions, and <support/README-testing.c> for a
Packit Service 82fcde
   minimal example.  */
Packit Service 82fcde
Packit Service 82fcde
/* This list of headers is needed so that tests which include
Packit Service 82fcde
   "../test-skeleton.c" at the beginning still compile.  */
Packit Service 82fcde
#include <assert.h>
Packit Service 82fcde
#include <errno.h>
Packit Service 82fcde
#include <fcntl.h>
Packit Service 82fcde
#include <getopt.h>
Packit Service 82fcde
#include <malloc.h>
Packit Service 82fcde
#include <paths.h>
Packit Service 82fcde
#include <search.h>
Packit Service 82fcde
#include <signal.h>
Packit Service 82fcde
#include <stdio.h>
Packit Service 82fcde
#include <stdlib.h>
Packit Service 82fcde
#include <string.h>
Packit Service 82fcde
#include <unistd.h>
Packit Service 82fcde
#include <sys/resource.h>
Packit Service 82fcde
#include <sys/wait.h>
Packit Service 82fcde
#include <sys/param.h>
Packit Service 82fcde
#include <time.h>
Packit Service 82fcde
#include <stdint.h>
Packit Service 82fcde
Packit Service 82fcde
#include <support/support.h>
Packit Service 82fcde
#include <support/check.h>
Packit Service 82fcde
#include <support/xsignal.h>
Packit Service 82fcde
#include <support/temp_file.h>
Packit Service 82fcde
Packit Service 82fcde
/* TEST_FUNCTION is no longer used. */
Packit Service 82fcde
static int
Packit Service 82fcde
legacy_test_function (int argc __attribute__ ((unused)),
Packit Service 82fcde
		      char **argv __attribute__ ((unused)))
Packit Service 82fcde
{
Packit Service 82fcde
#ifdef TEST_FUNCTION
Packit Service 82fcde
  return TEST_FUNCTION;
Packit Service 82fcde
# undef TEST_FUNCTION
Packit Service 82fcde
#else
Packit Service 82fcde
  return do_test (argc, argv);
Packit Service 82fcde
#endif
Packit Service 82fcde
}
Packit Service 82fcde
#define TEST_FUNCTION_ARGV legacy_test_function
Packit Service 82fcde
Packit Service 82fcde
/* PREPARE is a function name in the new skeleton.  */
Packit Service 82fcde
#ifdef PREPARE
Packit Service 82fcde
static void
Packit Service 82fcde
legacy_prepare_function  (int argc __attribute__ ((unused)),
Packit Service 82fcde
			  char **argv __attribute__ ((unused)))
Packit Service 82fcde
{
Packit Service 82fcde
  PREPARE (argc, argv);
Packit Service 82fcde
}
Packit Service 82fcde
# undef PREPARE
Packit Service 82fcde
# define PREPARE legacy_prepare_function
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* CLEANUP_HANDLER is a function name in the new skeleton.  */
Packit Service 82fcde
#ifdef CLEANUP_HANDLER
Packit Service 82fcde
static void
Packit Service 82fcde
legacy_cleanup_handler_function  (void)
Packit Service 82fcde
{
Packit Service 82fcde
  CLEANUP_HANDLER;
Packit Service 82fcde
}
Packit Service 82fcde
# undef CLEANUP_HANDLER
Packit Service 82fcde
# define CLEANUP_HANDLER legacy_cleanup_handler_function
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* CMDLINE_PROCESS is a function name in the new skeleton.  */
Packit Service 82fcde
#ifdef CMDLINE_PROCESS
Packit Service 82fcde
static void
Packit Service 82fcde
legacy_cmdline_process_function (int c)
Packit Service 82fcde
{
Packit Service 82fcde
  switch (c)
Packit Service 82fcde
    {
Packit Service 82fcde
      CMDLINE_PROCESS
Packit Service 82fcde
    }
Packit Service 82fcde
}
Packit Service 82fcde
# undef CMDLINE_PROCESS
Packit Service 82fcde
# define CMDLINE_PROCESS legacy_cmdline_process_function
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* Include the new test-skeleton.  */
Packit Service 82fcde
#include <support/test-driver.c>
Packit Service 82fcde
Packit Service 82fcde
/* The following functionality is only available if <pthread.h> was
Packit Service 82fcde
   included before this file.  */
Packit Service 82fcde
#ifdef _PTHREAD_H
Packit Service 82fcde
# include <support/xthread.h>
Packit Service 82fcde
#endif	/* _PTHREAD_H */