aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binutils/testsuite/ChangeLog14
-rw-r--r--binutils/testsuite/binutils-all/windres/README26
-rw-r--r--binutils/testsuite/binutils-all/windres/bmp1.bmpbin0 -> 122 bytes
-rw-r--r--binutils/testsuite/binutils-all/windres/bmpalign.rc9
-rw-r--r--binutils/testsuite/binutils-all/windres/bmpalign.rsd38
-rw-r--r--binutils/testsuite/binutils-all/windres/lang.rc15
-rw-r--r--binutils/testsuite/binutils-all/windres/lang.rsd10
-rwxr-xr-xbinutils/testsuite/binutils-all/windres/msupdate40
-rw-r--r--binutils/testsuite/binutils-all/windres/strtab1.rc8
-rw-r--r--binutils/testsuite/binutils-all/windres/strtab1.rsd8
-rw-r--r--binutils/testsuite/binutils-all/windres/windres.exp132
-rw-r--r--binutils/testsuite/config/default.exp4
12 files changed, 304 insertions, 0 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index d7630eb..0f0fef4 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,17 @@
+2001-07-18 DJ Delorie <dj@redhat.com>
+
+ * config/default.exp (WINDRES): Add.
+ * binutils-all/windres/windres.exp: New.
+ * binutils-all/windres/README: New.
+ * binutils-all/windres/bmp1.bmp: New.
+ * binutils-all/windres/bmpalign.rc: New.
+ * binutils-all/windres/bmpalign.rsd: New.
+ * binutils-all/windres/lang.rc: New.
+ * binutils-all/windres/lang.rsd: New.
+ * binutils-all/windres/msupdate: New.
+ * binutils-all/windres/strtab1.rc: New.
+ * binutils-all/windres/strtab1.rsd: New.
+
2001-07-05 Ben Elliston <bje@redhat.com>
* lib/utils-lib.exp (target_assemble): Remove duplicate copy.
diff --git a/binutils/testsuite/binutils-all/windres/README b/binutils/testsuite/binutils-all/windres/README
new file mode 100644
index 0000000..f990349
--- /dev/null
+++ b/binutils/testsuite/binutils-all/windres/README
@@ -0,0 +1,26 @@
+Instructions for adding tests:
+
+The files *.rc are hand-edited or copied from elsewhere.
+
+The script msupdate is used to generate the *.rsd files, which are
+dumps of the RES formatted output of MSVC's RC utility.
+
+Within the *.rc file, the first N lines beginning with a special
+comment can control the test. Comments are // /* or # (// is
+recommended, as both rc and windres support those). Each line
+contains one command:
+
+ // parse-only
+ // xfail *-*-*
+
+parse-only must preceed any xfail commands, and indicates that a
+comparison with the *.rsd file will not happen. xfail indicates when
+a failure is expected. This should only be used for when you are
+adding a new test that is known to fail because of a bug in windres,
+and it should be removed when the bug is fixed.
+
+You can use pfail or cfail instead of xfail to indicate that only the
+parsing or comparing should be xfailed.
+
+The windres tests only run for ix86 targets, because the
+MSVC-generated *.rsd files are generated for that.
diff --git a/binutils/testsuite/binutils-all/windres/bmp1.bmp b/binutils/testsuite/binutils-all/windres/bmp1.bmp
new file mode 100644
index 0000000..208a8aa
--- /dev/null
+++ b/binutils/testsuite/binutils-all/windres/bmp1.bmp
Binary files differ
diff --git a/binutils/testsuite/binutils-all/windres/bmpalign.rc b/binutils/testsuite/binutils-all/windres/bmpalign.rc
new file mode 100644
index 0000000..7cb5583
--- /dev/null
+++ b/binutils/testsuite/binutils-all/windres/bmpalign.rc
@@ -0,0 +1,9 @@
+LANGUAGE 0, 0
+
+A BITMAP MOVEABLE PURE DISCARDABLE "bmp1.bmp"
+
+AB BITMAP MOVEABLE PURE DISCARDABLE "bmp1.bmp"
+
+ABC BITMAP MOVEABLE PURE DISCARDABLE "bmp1.bmp"
+
+ABCD BITMAP MOVEABLE PURE DISCARDABLE "bmp1.bmp"
diff --git a/binutils/testsuite/binutils-all/windres/bmpalign.rsd b/binutils/testsuite/binutils-all/windres/bmpalign.rsd
new file mode 100644
index 0000000..3ee5396
--- /dev/null
+++ b/binutils/testsuite/binutils-all/windres/bmpalign.rsd
@@ -0,0 +1,38 @@
+ 0000 00000000 20000000 ffff0000 ffff0000 .... ...........
+ 0010 00000000 00000000 00000000 00000000 ................
+ 0020 6c000000 20000000 ffff0200 41000000 l... .......A...
+ 0030 00000000 30100000 00000000 00000000 ....0...........
+ 0040 28000000 01000000 01000000 01000400 (...............
+ 0050 00000000 04000000 00000000 00000000 ................
+ 0060 00000000 00000000 00000000 00008000 ................
+ 0070 00800000 00808000 80000000 80008000 ................
+ 0080 80800000 c0c0c000 80808000 0000ff00 ................
+ 0090 00ff0000 00ffff00 ff000000 ff00ff00 ................
+ 00a0 ffff0000 ffffff00 90000000 6c000000 ............l...
+ 00b0 24000000 ffff0200 41004200 00000000 $.......A.B.....
+ 00c0 00000000 30100000 00000000 00000000 ....0...........
+ 00d0 28000000 01000000 01000000 01000400 (...............
+ 00e0 00000000 04000000 00000000 00000000 ................
+ 00f0 00000000 00000000 00000000 00008000 ................
+ 0100 00800000 00808000 80000000 80008000 ................
+ 0110 80800000 c0c0c000 80808000 0000ff00 ................
+ 0120 00ff0000 00ffff00 ff000000 ff00ff00 ................
+ 0130 ffff0000 ffffff00 90000000 6c000000 ............l...
+ 0140 24000000 ffff0200 41004200 43000000 $.......A.B.C...
+ 0150 00000000 30100000 00000000 00000000 ....0...........
+ 0160 28000000 01000000 01000000 01000400 (...............
+ 0170 00000000 04000000 00000000 00000000 ................
+ 0180 00000000 00000000 00000000 00008000 ................
+ 0190 00800000 00808000 80000000 80008000 ................
+ 01a0 80800000 c0c0c000 80808000 0000ff00 ................
+ 01b0 00ff0000 00ffff00 ff000000 ff00ff00 ................
+ 01c0 ffff0000 ffffff00 90000000 6c000000 ............l...
+ 01d0 28000000 ffff0200 41004200 43004400 (.......A.B.C.D.
+ 01e0 00000000 00000000 30100000 00000000 ........0.......
+ 01f0 00000000 28000000 01000000 01000000 ....(...........
+ 0200 01000400 00000000 04000000 00000000 ................
+ 0210 00000000 00000000 00000000 00000000 ................
+ 0220 00008000 00800000 00808000 80000000 ................
+ 0230 80008000 80800000 c0c0c000 80808000 ................
+ 0240 0000ff00 00ff0000 00ffff00 ff000000 ................
+ 0250 ff00ff00 ffff0000 ffffff00 90000000 ................
diff --git a/binutils/testsuite/binutils-all/windres/lang.rc b/binutils/testsuite/binutils-all/windres/lang.rc
new file mode 100644
index 0000000..d894315
--- /dev/null
+++ b/binutils/testsuite/binutils-all/windres/lang.rc
@@ -0,0 +1,15 @@
+#include "windows.h"
+
+LANGUAGE 0, 0
+
+1 MENU MOVEABLE PURE DISCARDABLE
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
+BEGIN
+ POPUP "&Datei" { MENUITEM "foo", 1 }
+END
+
+1 MENU MOVEABLE PURE DISCARDABLE
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+BEGIN
+ POPUP "&File" { MENUITEM "foo", 1 }
+END
diff --git a/binutils/testsuite/binutils-all/windres/lang.rsd b/binutils/testsuite/binutils-all/windres/lang.rsd
new file mode 100644
index 0000000..9e0045f
--- /dev/null
+++ b/binutils/testsuite/binutils-all/windres/lang.rsd
@@ -0,0 +1,10 @@
+ 0000 00000000 20000000 ffff0000 ffff0000 .... ...........
+ 0010 00000000 00000000 00000000 00000000 ................
+ 0020 20000000 20000000 ffff0400 ffff0100 ... ...........
+ 0030 00000000 30100704 00000000 00000000 ....0...........
+ 0040 00000000 90002600 44006100 74006500 ......&.D.a.t.e.
+ 0050 69000000 80000100 66006f00 6f000000 i.......f.o.o...
+ 0060 1e000000 20000000 ffff0400 ffff0100 .... ...........
+ 0070 00000000 30100904 00000000 00000000 ....0...........
+ 0080 00000000 90002600 46006900 6c006500 ......&.F.i.l.e.
+ 0090 00008000 01006600 6f006f00 00000000 ......f.o.o.....
diff --git a/binutils/testsuite/binutils-all/windres/msupdate b/binutils/testsuite/binutils-all/windres/msupdate
new file mode 100755
index 0000000..649335c
--- /dev/null
+++ b/binutils/testsuite/binutils-all/windres/msupdate
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Copyright 2001 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
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-dejagnu@prep.ai.mit.edu
+
+# Written by DJ Delorie <dj@redhat.com>
+
+# Run this on a machine with Cygwin and Microsoft Visual C to create
+# the RES files we match against.
+
+RC="rc"
+if test x"$1" != x""
+then
+ RC="$1"
+fi
+
+for i in *.rc
+do
+ o=`echo $i | sed s/.rc/.res/`
+ d=`echo $i | sed s/.rc/.rsd/`
+ echo "$i -> $o -> $d"
+ $RC /fo$o $i
+ objdump -b binary -s $o | sed -n '/^ [0-9a-f][0-9a-f]* /p' > $d
+ rm $o
+done
diff --git a/binutils/testsuite/binutils-all/windres/strtab1.rc b/binutils/testsuite/binutils-all/windres/strtab1.rc
new file mode 100644
index 0000000..a1a246d
--- /dev/null
+++ b/binutils/testsuite/binutils-all/windres/strtab1.rc
@@ -0,0 +1,8 @@
+#include "windows.h"
+
+LANGUAGE 0, 0
+
+STRINGTABLE MOVEABLE PURE DISCARDABLE
+BEGIN
+ 1 "hello, world"
+END
diff --git a/binutils/testsuite/binutils-all/windres/strtab1.rsd b/binutils/testsuite/binutils-all/windres/strtab1.rsd
new file mode 100644
index 0000000..4d61073
--- /dev/null
+++ b/binutils/testsuite/binutils-all/windres/strtab1.rsd
@@ -0,0 +1,8 @@
+ 0000 00000000 20000000 ffff0000 ffff0000 .... ...........
+ 0010 00000000 00000000 00000000 00000000 ................
+ 0020 38000000 20000000 ffff0600 ffff0100 8... ...........
+ 0030 00000000 30100000 00000000 00000000 ....0...........
+ 0040 00000c00 68006500 6c006c00 6f002c00 ....h.e.l.l.o.,.
+ 0050 20007700 6f007200 6c006400 00000000 .w.o.r.l.d.....
+ 0060 00000000 00000000 00000000 00000000 ................
+ 0070 00000000 00000000 ........
diff --git a/binutils/testsuite/binutils-all/windres/windres.exp b/binutils/testsuite/binutils-all/windres/windres.exp
new file mode 100644
index 0000000..3578835
--- /dev/null
+++ b/binutils/testsuite/binutils-all/windres/windres.exp
@@ -0,0 +1,132 @@
+# Copyright 2001 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
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-dejagnu@prep.ai.mit.edu
+
+# Written by DJ Delorie <dj@redhat.com>
+
+if {![istarget "i*86-*-*"]} {
+ return
+}
+
+if {![info exists WINDRES]} then {
+ return
+}
+
+if {[which $WINDRES] == 0} then {
+ return
+}
+
+set wr "$WINDRES --include-dir $srcdir/$subdir"
+
+if [file exists "$srcdir/../../winsup/w32api/include"] {
+ set wr "$wr --include-dir $srcdir/../../winsup/w32api/include"
+} else {
+ send_log "\nWarning: Assuming windres can find the win32 headers\n\n"
+}
+
+set res_list [lsort [glob -nocomplain $srcdir/$subdir/*.rc]]
+
+proc oneline { file } {
+ while { 1 } {
+ if { [gets $file line] == -1 } {
+ return ""
+ }
+ if [regexp "^ \[0-9a-z\]\[0-9a-z\]* " $line] {
+ return $line
+ }
+ }
+}
+
+foreach res $res_list {
+ set sroot [file rootname $res]
+ set broot [file tail $sroot]
+ set done 0
+
+ set rc [open $res]
+ while { [gets $rc line] != -1 } {
+ if ![regexp "^(//|/\*|#)" $line] {
+ break
+ }
+ if [regexp "\[xp\]fail *(\[^ \]*)" $line junk sys] {
+ setup_xfail $sys
+ continue;
+ }
+ }
+
+ verbose "$wr -I rc -O res $res tmpdir/$broot.res" 1
+ catch "exec $wr -I rc -O res $res tmpdir/$broot.res" err
+
+ if ![string match "" $err] then {
+ send_log "$err\n"
+ verbose "$err" 1
+ fail "windres/$broot (parse)"
+ continue;
+ }
+ pass "windres/$broot (parse)"
+
+ set rc [open $res]
+ while { [gets $rc line] != -1 } {
+ if ![regexp "^(//|/\*|#)" $line] {
+ break
+ }
+ if [regexp "parse-only" $line] {
+ file delete "tmpdir/$broot.res"
+ set done 1
+ break;
+ }
+ if [regexp "\[xc\]fail *(\[^ \]*)" $line junk sys] {
+ setup_xfail $sys
+ continue;
+ }
+ }
+ if { $done != 0 } {
+ continue;
+ }
+
+ verbose "$OBJDUMP -b binary -s tmpdir/$broot.res > tmpdir/$broot.dump" 1
+ catch "exec $OBJDUMP -b binary -s tmpdir/$broot.res > tmpdir/$broot.dump" err
+
+ if ![string match "" $err] then {
+ send_log "$err\n"
+ verbose "$err" 1
+ fail "windres/$broot (compare)"
+ continue;
+ }
+
+ set pat [open "$sroot.rsd"]
+ set out [open "tmpdir/$broot.dump"]
+ set patline "foo"
+
+ while { ![string match $patline ""] } {
+ set patline [oneline $pat]
+ set outline [oneline $out]
+
+ if ![string match $patline $outline] {
+ send_log "< $patline\n";
+ send_log "> $outline\n";
+ fail "windres/$broot (compare)";
+ set done 1
+ break;
+ }
+ }
+ if { $done == 0 } {
+ pass "windres/$broot (compare)"
+ file delete "tmpdir/$broot.res"
+ file delete "tmpdir/$broot.dump"
+ }
+}
diff --git a/binutils/testsuite/config/default.exp b/binutils/testsuite/config/default.exp
index 56acd95..227fd78 100644
--- a/binutils/testsuite/config/default.exp
+++ b/binutils/testsuite/config/default.exp
@@ -69,6 +69,10 @@ if ![info exists READELFFLAGS] then {
set READELFFLAGS ""
}
+if ![info exists WINDRES] then {
+ set WINDRES [findfile $base_dir/windres]
+}
+
if ![file isdirectory tmpdir] {catch "exec mkdir tmpdir" status}
# Make a symlink from tmpdir/gas/as and tmpdir/gas/ld to the assembler