Commit 34f4edf8 by Mark Mitchell Committed by Mark Mitchell

testsuite_hooks.cc (try_mkfifo): Remove.

	* testsuite/testsuite_hooks.cc (try_mkfifo): Remove.
	* testsuite/testsuite_hooks.h (try_mkfifo): Likewise.
	* testsuite/27_io/basic_filebuf/close/char/4879.cc: Use
	dg-require-fork and dg-require-mkfifo.  Replace try_mkfifo with
	mkfifo.
	* testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise.
	* testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc: Likewise.
	* testsuite/27_io/basic_filebuf/imbue/char/13582-2.cc: Likewise.
	* testsuite/27_io/basic_filebuf/imbue/wchar_t/13582-2.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise.
	* testsuite/27_io/basic_filebuf/showmanyc/char/9533-1.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/underflow/char/10097.cc: Likewise.
	* testsuite/27_io/objects/char/7.cc: Likewise.
	* testsuite/27_io/objects/char/9661-1.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/7.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/9661-1.cc: Likewise.

	* lib/target-supports-dg.exp (dg-require-fork): New function.
	(dg-require-mkfifo): Likewise.
	* lib/target-supports.exp (check_function_available): New
	function.
	(check_fork_available): Likewise.
	(check_mkfifo_available): Likewise.

From-SVN: r99325
parent b8c1d4a1
2005-05-06 Mark Mitchell <mark@codesourcery.com>
* lib/target-supports-dg.exp (dg-require-fork): New function.
(dg-require-mkfifo): Likewise.
* lib/target-supports.exp (check_function_available): New
function.
(check_fork_available): Likewise.
(check_mkfifo_available): Likewise.
2005-05-06 Jeff Law <law@redhat.com>
* gcc.c-torture/compile/pr21380.c: New test.
......
......@@ -118,7 +118,7 @@ proc scan-not-hidden { args } {
set output_file "[file rootname [file tail $testcase]].s"
set symbol [lindex $args 0]
set hidden_scan [hidden-scan-for symbol]
set hidden_scan [hidden-scan-for $symbol]
set args [lreplace $args 0 0 "$hidden_scan"]
......
......@@ -122,6 +122,24 @@ proc dg-require-effective-target { args } {
}
}
# If this target does not have fork, skip this test.
proc dg-require-fork { args } {
if { ![check_fork_available] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
}
}
# If this target does not have mkfifo, skip this test.
proc dg-require-mkfifo { args } {
if { ![check_mkfifo_available] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
}
}
# Check the flags with which the test will be run against options in
# a test directive that will skip or xfail that test. The DejaGnu proc
# check_conditional_xfail will look at the options in compiler_flags, so
......
......@@ -601,6 +601,53 @@ proc check_alpha_max_hw_available { } {
return $alpha_max_hw_available_saved
}
# Returns true iff the FUNCTION is available on the target system.
# (This is essentially a Tcl implementation of Autoconf's
# AC_CHECK_FUNC.)
proc check_function_available { function } {
set var "${function}_available_saved"
global $var
global tool
if {![info exists $var]} {
# Assume it exists.
set $var 1
# Check to make sure.
set src "function[pid].c"
set exe "function[pid].exe"
set f [open $src "w"]
puts $f "int main () { $function (); }"
close $f
set lines [${tool}_target_compile $src $exe executable ""]
file delete $src
file delete $exe
if {![string match "" $lines]} then {
set $var 0
verbose -log "$function is not available"
} else {
verbose -log "$function is available"
}
}
eval return \$$var
}
# Returns ture iff "fork" is available on the target system.
proc check_fork_available {} {
return [check_function_available "fork"]
}
# Returns ture iff "mkfifo" is available on the target system.
proc check_mkfifo_available {} {
return [check_function_available "mkfifo"]
}
# Return 1 if we're generating 32-bit code using default options, 0
# otherwise.
#
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
......@@ -46,7 +49,7 @@ test_04()
signal(SIGPIPE, SIG_IGN);
unlink(name);
if (0 != try_mkfifo(name, S_IRWXU))
if (0 != mkfifo(name, S_IRWXU))
{
std::cerr << "failed to create fifo" << std::endl;
exit(-1);
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
......@@ -44,7 +47,7 @@ void test_07()
signal(SIGPIPE, SIG_IGN);
unlink(name);
try_mkfifo(name, S_IRWXU);
mkfifo(name, S_IRWXU);
int child = fork();
VERIFY( child != -1 );
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
......@@ -38,7 +41,7 @@ void test01()
const char* name = "tmp_fifo_13171-2";
unlink(name);
try_mkfifo(name, S_IRWXU);
mkfifo(name, S_IRWXU);
semaphore s1, s2;
int child = fork();
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// 2004-01-11 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
......@@ -41,7 +44,7 @@ void test01()
const char* name = "tmp_fifo_13582-2";
unlink(name);
try_mkfifo(name, S_IRWXU);
mkfifo(name, S_IRWXU);
int child = fork();
if (child == 0)
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// 2004-01-11 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2004 Free Software Foundation, Inc.
......@@ -41,7 +44,7 @@ void test01()
const char* name = "tmp_fifo_13582-2";
unlink(name);
try_mkfifo(name, S_IRWXU);
mkfifo(name, S_IRWXU);
int child = fork();
if (child == 0)
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// 2004-04-16 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
......@@ -41,7 +44,7 @@ void test01()
signal(SIGPIPE, SIG_IGN);
unlink(name);
try_mkfifo(name, S_IRWXU);
mkfifo(name, S_IRWXU);
semaphore s1;
int child = fork();
......
// { dg-require-mkfifo "" }
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
......@@ -41,7 +43,7 @@ void test_06()
signal(SIGPIPE, SIG_IGN);
unlink(name);
try_mkfifo(name, S_IRWXU);
mkfifo(name, S_IRWXU);
std::filebuf fbuf;
// The use of ios_base::ate implies an attempt to seek on the file
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// Copyright (C) 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
......@@ -39,7 +42,7 @@ void test_01()
signal(SIGPIPE, SIG_IGN);
unlink(name);
if (0 != try_mkfifo(name, S_IRWXU))
if (0 != mkfifo(name, S_IRWXU))
{
VERIFY( false );
}
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
......@@ -53,7 +56,7 @@ void test16()
signal(SIGPIPE, SIG_IGN);
unlink(name);
if (0 != try_mkfifo(name, S_IRWXU))
if (0 != mkfifo(name, S_IRWXU))
{
VERIFY( false );
}
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// 2003-04-26 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
......@@ -41,7 +44,7 @@ void test07()
signal(SIGPIPE, SIG_IGN);
unlink(name);
try_mkfifo(name, S_IRWXU);
mkfifo(name, S_IRWXU);
semaphore s1;
int child = fork();
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// 2003-04-30 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
......@@ -42,7 +45,7 @@ void test01()
signal(SIGPIPE, SIG_IGN);
unlink(name);
try_mkfifo(name, S_IRWXU);
mkfifo(name, S_IRWXU);
semaphore s1, s2;
int child = fork();
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// 2003-05-01 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
......@@ -41,7 +44,7 @@ void test07()
signal(SIGPIPE, SIG_IGN);
unlink(name);
try_mkfifo(name, S_IRWXU);
mkfifo(name, S_IRWXU);
semaphore s1;
int child = fork();
......
// { dg-require-fork "" }
// { dg-require-mkfifo "" }
// 2003-04-30 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
......@@ -42,7 +45,7 @@ void test01()
signal(SIGPIPE, SIG_IGN);
unlink(name);
try_mkfifo(name, S_IRWXU);
mkfifo(name, S_IRWXU);
semaphore s1, s2;
int child = fork();
......
......@@ -233,17 +233,6 @@ namespace __gnu_test
#endif
}
int
try_mkfifo (const char* filename, mode_t mode)
{
#if defined (_NEWLIB_VERSION) || defined (__MINGW32_VERSION)
/* Newlib and MinGW32 do not have mkfifo. */
exit(0);
#else
return mkfifo(filename, mode);
#endif
}
counter::size_type counter::count = 0;
unsigned int copy_constructor::count_ = 0;
unsigned int copy_constructor::throw_on_ = 0;
......
......@@ -164,9 +164,6 @@ namespace __gnu_test
std::locale
try_named_locale(const char* name);
int
try_mkfifo (const char* filename, mode_t mode);
// Counting.
struct counter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment