source: branches/libc-0.6/src/gcc/libjava/testsuite/libjava.mauve/mauve.exp

Last change on this file was 1392, checked in by bird, 22 years ago

This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 11.0 KB
Line 
1# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation.
2# Written by Tom Tromey <[email protected]>.
3# Incorporate Mauve into libjava's DejaGNU test suite framework.
4
5# FIXME: should be able to compile from source as well as from .class.
6
7
8# Compute list of files to compile. Returns list of all files
9# representing classes that must be tested. Result parameter `uses'
10# maps source file names onto list of objects required for link.
11proc mauve_compute_uses {aName} {
12 upvar $aName uses
13 global env runtests
14
15 set fd [open classes r]
16 set line [read $fd]
17 close $fd
18
19 foreach item [split $line] {
20 if {$item == ""} then {
21 continue
22 }
23 set item [join [split $item .] /].java
24
25 # User might have specified "mauve.exp=something.java".
26 if {! [runtest_file_p $runtests $item]} {
27 continue
28 }
29
30 # Look for Uses line in source file.
31 set fd [open $env(MAUVEDIR)/$item r]
32 set ufiles [list $item]
33 set dir [file dirname $item]
34 while {[gets $fd sline] != -1} {
35 if {[regsub -- {^// Uses:} $sline {} sline]} then {
36 foreach uf [split $sline] {
37 if {$uf != ""} then {
38 lappend ufiles $dir/$uf
39 }
40 }
41 }
42 }
43 close $fd
44
45 set uses($item) {}
46 foreach file $ufiles {
47 set file [file rootname $file].o
48 lappend uses($item) $file
49 # Now add all inner classes
50 foreach inner [glob -nocomplain [file rootname $file]$*.class] {
51 # Prevent excessive escaping by replacing $ with a ^ in the .o name
52 set inner [file rootname $inner].o
53 regsub -all "\\$" $inner "\^" inner
54 lappend uses($item) $inner
55 }
56 }
57 }
58
59 return [lsort [array names uses]]
60}
61
62# Find Mauve sources. At end, env(MAUVEDIR) points to sources.
63# Returns 0 if sources not found, 1 otherwise.
64proc find_mauve_sources {} {
65 global env srcdir
66
67 if {[info exists env(MAUVEDIR)]} {
68 return 1
69 } elseif {[file isdirectory $srcdir/libjava.mauve/mauve]} {
70 set env(MAUVEDIR) $srcdir/libjava.mauve/mauve
71 return 1
72 }
73
74 return 0
75}
76
77# Run all the Mauve tests. Return 1 on success, 0 on any failure. If
78# the tests are skipped, that is treated like success.
79proc test_mauve {} {
80 global srcdir objdir subdir env