summaryrefslogtreecommitdiff
path: root/gas/testsuite/lib
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-06-05 17:00:33 +0000
committerNick Clifton <nickc@redhat.com>2007-06-05 17:00:33 +0000
commitdfeb06664ae08b270f4b46c76620a8e4fdcdeaa2 (patch)
treee05d6d823ada33c2d0d0fdb8f393731ad3ae7f7b /gas/testsuite/lib
parent93e7bd98af3e52d6d51a9cacd0848a3c6a3e5bdb (diff)
Patch for PR4587 + move proc run_list_test into gas-defs.exp
Diffstat (limited to 'gas/testsuite/lib')
-rw-r--r--gas/testsuite/lib/gas-defs.exp24
1 files changed, 23 insertions, 1 deletions
diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp
index 3b21719615..eabd018add 100644
--- a/gas/testsuite/lib/gas-defs.exp
+++ b/gas/testsuite/lib/gas-defs.exp
@@ -1,5 +1,5 @@
# Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2005 Free Software Foundation, Inc.
+# 2004, 2005, 2007 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -888,3 +888,25 @@ if ![string length [info proc prune_warnings]] {
return $text
}
}
+
+# run_list_test NAME OPTS (optional): TESTNAME
+#
+# Assemble the file "NAME.d" with command line options OPTS and
+# compare the assembler standard error output against thee regular
+# expressions given in the file "NAME.l". If TESTNAME is provided,
+# it will be used as the name of the test.
+
+proc run_list_test { name opts {testname {}} } {
+ global srcdir subdir
+ if { [string length $testname] == 0 } then {
+ set testname "[file tail $subdir] $name"
+ }
+ set file $srcdir/$subdir/$name
+ gas_run ${name}.s $opts ">&dump.out"
+ if { [regexp_diff "dump.out" "${file}.l"] } then {
+ fail $testname
+ verbose "output is [file_contents "dump.out"]" 2
+ return
+ }
+ pass $testname
+}