Commit 395909dd by Janis Johnson Committed by Janis Johnson

gcc.test-framework: New directory.

2005-02-01  Janis Johnson  <janis187@us.ibm.com>

	* gcc.test-framework: New directory.
	* gcc.test-framework/README: New.
	* gcc.test-framework/test-framework.exp: New.
	* gcc.test-framework/test-framework.awk: New.
	* gcc.test-framework/gen_directive_tests: New.

From-SVN: r94548
parent 22f8a068
2005-02-01 Janis Johnson <janis187@us.ibm.com>
* gcc.test-framework: New directory.
* gcc.test-framework/README: New.
* gcc.test-framework/test-framework.exp: New.
* gcc.test-framework/test-framework.awk: New.
* gcc.test-framework/gen_directive_tests: New.
2005-02-01 James A. Morrison <phython@gcc.gnu.org> 2005-02-01 James A. Morrison <phython@gcc.gnu.org>
* lib/treelang.exp: Fix comment typos. * lib/treelang.exp: Fix comment typos.
......
Check the test directives used in GCC's testsuite by generating and
running tests that use combinations of those commands or that stress
the selector expressions that can be used in those directives.
Each test has two parts: a file ending in "-1.c" whose expected result
is encoded in the filename after "-exp-", and a file ending in "-2.c"
which is always expected to pass.
This test directory is normally skipped and is not meant to be run at
the same time as other parts of the testsuite; it's only of interest to
people who are modifying the test directives or their support in GCC's
.exp files.
To run these tests:
CHECK_TEST_FRAMEWORK=1 make -k check RUNTESTFLAGS="test-framework.exp"
To check the results:
TF=${SRC}/gcc/testsuite/gcc.test-framework
awk -f ${TF}/test-framework.awk gcc/testsuite/gcc.sum
The awk script prints unexpected results followed by the number of tests
that passed.
# Process the gcc.sum file for a run through gcc.test-framework.
# Print result lines that show potential problems. Report the number
# of passing tests.
#
#
# Copyright (c) 2004, 2005 Free Software Foundation, Inc.
#
# This file 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 of the License, 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.
#
# For a copy of the GNU General Public License, write the the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
BEGIN { skip = 1; pass = 0 }
/Running.*test-frame/ { skip = 0; next }
/gcc Summary/ { skip = 1; next }
{ if (skip) next }
/^$/ { next }
# The post tests are always expected to pass.
/^PASS.*-2.c/ { next }
# dg-xfail-if applies to the compile step; these should be XPASS for the
# compile step on dox tests, which are run tests.
/^XPASS.*dox.*xiff.*-1.c.*(test for excess errors)/ { next }
# xfail for scan-assembler-not tests doesn't apply to the compile step.
/^PASS.*sa.*-1.c.*(test for excess errors)/ { next }
# The other dox tests pass the compile step; ignore that message.
/^PASS.*dox.*(test for excess errors)/ { next }
/^PASS/ { if (match ($0, "exp-P")) { pass++; next } }
/^FAIL/ { if (match ($0, "exp-F")) { pass++; next } }
/^XPASS/ { if (match ($0, "exp-XP")) { pass++; next } }
/^XFAIL/ { if (match ($0, "exp-XF")) { pass++; next } }
/^UNSUPPORTED/ { if (match ($0, "exp-U")) { pass++; next } }
{ print }
END { printf("%d tests passed\n", pass) }
# Copyright (c) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file 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 of the License, 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.
#
# For a copy of the GNU General Public License, write the the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# Based on gcc/testsuite/gcc.dg/dg.exp.
# Don't run these tests unless an environment variable is defined.
if { ![info exists env(CHECK_TEST_FRAMEWORK)] } {
verbose "skipping test framework tests, CHECK_TEST_FRAMEWORK is not defined" 0
return
}
load_lib gcc-dg.exp
proc dg-require-true { args } {
verbose "dg-require-true" 2
}
proc dg-require-false { args } {
verbose "dg-require-false" 2
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
}
proc check_effective_target_yes { args } {
return 1
}
proc check_effective_target_no { args } {
return 0
}
global dg-do-what-default
set save-dg-do-what-default ${dg-do-what-default}
set dg-do-what-default compile
# Generate the tests.
set tstobjdir "$tmpdir/gcc.test-framework"
set generator "$srcdir/$subdir/gen_directive_tests"
file delete -force $tstobjdir
file mkdir $tstobjdir
set status [remote_exec host "$generator $tstobjdir"]
set status [lindex $status 0]
if { $status == 0 } {
# Run the tests.
dg-init
dg-runtest [lsort [find $tstobjdir *.c]] "" "-DY1 -DY2"
dg-finish
} else {
warning "Could not generate test framework tests"
}
set dg-do-what-default ${save-dg-do-what-default}
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