Commit 7d1395dd authored by ross's avatar ross

[project @ 2004-11-09 13:49:08 by ross]

More compiler_type support: added the option functions

	omit_compiler_types(compilers)
			      skip this test for certain compilers
	only_compiler_types(compilers)
			      do this test for certain compilers only
	expect_fail_if_compiler_type(compiler)
			      expect failure from a certain compiler

and also use output files ending in -<compiler_type> if present.
parent 2fe4a954
...@@ -167,13 +167,19 @@ these steps: ...@@ -167,13 +167,19 @@ these steps:
used in this field: used in this field:
normal don't change any options from the defaults normal don't change any options from the defaults
expect_fail this test is an expected failure
skip skip this test skip skip this test
expect_fail_for(ways) expect failure for certain ways
omit_ways(ways) skip this test for certain ways omit_ways(ways) skip this test for certain ways
only_ways(ways) do this test certain ways only only_ways(ways) do this test certain ways only
omit_compiler_types(compilers)
skip this test for certain compilers
only_compiler_types(compilers)
do this test for certain compilers only
expect_fail this test is an expected failure
expect_fail_for(ways) expect failure for certain ways
expect_fail_if_platform(plat) expect_fail_if_platform(plat)
expect failure on a certain platform expect failure on a certain platform
expect_fail_if_compiler_type(compiler)
expect failure from a certain compiler
set_stdin(file) use a different file for stdin set_stdin(file) use a different file for stdin
exit_code(n) expect an exit code of 'n' from the prog exit_code(n) expect an exit code of 'n' from the prog
extra_run_opts(opts) pass some extra opts to the prog extra_run_opts(opts) pass some extra opts to the prog
......
...@@ -113,7 +113,7 @@ class TestOptions: ...@@ -113,7 +113,7 @@ class TestOptions:
# skip all ways except these ([] == do all ways) # skip all ways except these ([] == do all ways)
self.only_ways = [] self.only_ways = []
# the result we normally expect for this test # the result we normally expect for this test
self.expect = 'pass'; self.expect = 'pass';
...@@ -217,6 +217,24 @@ def _only_ways( opts, ways ): ...@@ -217,6 +217,24 @@ def _only_ways( opts, ways ):
# ----- # -----
def omit_compiler_types( compiler_types ):
return lambda opts, c=compiler_types: _omit_compiler_types(opts, c)
def _omit_compiler_types( opts, compiler_types ):
if config.compiler_type in compiler_types:
opts.skip = 1
# -----
def only_compiler_types( compiler_types ):
return lambda opts, c=compiler_types: _only_compiler_types(opts, c)
def _only_compiler_types( opts, compiler_types ):
if config.compiler_type not in compiler_types:
opts.skip = 1
# -----
def expect_fail_if_platform( plat ): def expect_fail_if_platform( plat ):
return lambda opts, p=plat: _expect_fail_if_platform(opts, p) return lambda opts, p=plat: _expect_fail_if_platform(opts, p)
...@@ -226,6 +244,15 @@ def _expect_fail_if_platform( opts, plat ): ...@@ -226,6 +244,15 @@ def _expect_fail_if_platform( opts, plat ):
# ----- # -----
def expect_fail_if_compiler_type( compiler_type ):
return lambda opts, c=compiler_type: _expect_fail_if_compiler_type(opts, c)
def _expect_fail_if_compiler_type( opts, compiler_type ):
if config.compiler_type == compiler_type:
opts.expect = 'fail'
# -----
def set_stdin( file ): def set_stdin( file ):
return lambda opts, f=file: _set_stdin(opts, f); return lambda opts, f=file: _set_stdin(opts, f);
...@@ -911,13 +938,17 @@ def qualify( name, suff ): ...@@ -911,13 +938,17 @@ def qualify( name, suff ):
return in_testdir(add_suffix(name, suff)) return in_testdir(add_suffix(name, suff))
# "foo" -> qualify("foo-platform") if it exists, otherwise # "foo" -> qualify("foo-platform") if it exists, otherwise
# try qualify("foo-ws-wordsize") or finally qualify("foo") # try qualify("foo-compiler_type"), qualify("foo-ws-wordsize")
# or finally qualify("foo")
def platform_wordsize_qualify( name, suff ): def platform_wordsize_qualify( name, suff ):
path = qualify(name, suff) path = qualify(name, suff)
platform_path = path + '-' + config.platform platform_path = path + '-' + config.platform
compiler_type_path = path + '-' + config.compiler_type
wordsize_path = path + '-ws-' + config.wordsize wordsize_path = path + '-ws-' + config.wordsize
if os.path.exists(platform_path): if os.path.exists(platform_path):
return platform_path return platform_path
elif os.path.exists(compiler_type_path):
return compiler_type_path
elif os.path.exists(wordsize_path): elif os.path.exists(wordsize_path):
return wordsize_path return wordsize_path
else: else:
......
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