OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [testsuite/] [lib/] [checkoutput.exp] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
# Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
# Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
#
#
# Permission to use, copy, modify, and distribute this software
# Permission to use, copy, modify, and distribute this software
# is freely granted, provided that this notice is preserved.
# is freely granted, provided that this notice is preserved.
#
#
# newlib_check_output takes the basename of the test source file, and
# newlib_check_output takes the basename of the test source file, and
# a list of TCL regular expressions representing the expected output.
# a list of TCL regular expressions representing the expected output.
# It assumes one line of output per test.
# It assumes one line of output per test.
proc newlib_check_output { srcfile expectlist } {
proc newlib_check_output { srcfile expectlist } {
    global subdir srcdir tmpdir
    global subdir srcdir tmpdir
    set srcfullname "$srcdir/$subdir/$srcfile"
    set srcfullname "$srcdir/$subdir/$srcfile"
    set test_driver "$tmpdir/[file tail [file rootname $srcfullname].x]"
    set test_driver "$tmpdir/[file tail [file rootname $srcfullname].x]"
    set comp_output [newlib_target_compile "$srcfullname" "$test_driver" "executable" ""]
    set comp_output [newlib_target_compile "$srcfullname" "$test_driver" "executable" ""]
    if { $comp_output != "" } {
    if { $comp_output != "" } {
        fail "$subdir/$srcfile compilation"
        fail "$subdir/$srcfile compilation"
        unresolved "$subdir/$srcfile output"
        unresolved "$subdir/$srcfile output"
        return
        return
    }
    }
    pass "$subdir/$srcfile compilation"
    pass "$subdir/$srcfile compilation"
    set result [newlib_load $test_driver ""]
    set result [newlib_load $test_driver ""]
    set status [lindex $result 0]
    set status [lindex $result 0]
    set output [lindex $result 1]
    set output [lindex $result 1]
    set output_lines [split $output "\n"]
    set output_lines [split $output "\n"]
    foreach { expectedval } $expectlist {
    foreach { expectedval } $expectlist {
        set gotval [string trim [lindex $output_lines 0] "\r"]
        set gotval [string trim [lindex $output_lines 0] "\r"]
        if { ! [string match $expectedval $gotval] } {
        if { ! [string match $expectedval $gotval] } {
            verbose -log "$subdir/$srcfile: Expected: $expectedval Got: $gotval "
            verbose -log "$subdir/$srcfile: Expected: $expectedval Got: $gotval "
            fail "$subdir/$srcfile output"
            fail "$subdir/$srcfile output"
            return
            return
        }
        }
        set output_lines [lrange $output_lines 1 end]
        set output_lines [lrange $output_lines 1 end]
    }
    }
    pass "$subdir/$srcfile output"
    pass "$subdir/$srcfile output"
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.