Blame test-skeleton.c

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