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/] [passfail.exp] - Diff between revs 214 and 345

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

Rev 214 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.
#
#
load_lib newlibprocs.exp
load_lib newlibprocs.exp
# newlib_pass_fail_all compiles and runs all the source files in the
# newlib_pass_fail_all compiles and runs all the source files in the
# test directory. If flag is -x, then the sources whose basenames are
# test directory. If flag is -x, then the sources whose basenames are
# listed in exclude_list are not compiled and run.
# listed in exclude_list are not compiled and run.
proc newlib_pass_fail_all { flag exclude_list } {
proc newlib_pass_fail_all { flag exclude_list } {
    global srcdir objdir subdir runtests
    global srcdir objdir subdir runtests
    foreach fullsrcfile [glob -nocomplain $srcdir/$subdir/*.c] {
    foreach fullsrcfile [glob -nocomplain $srcdir/$subdir/*.c] {
        set srcfile "[file tail $fullsrcfile]"
        set srcfile "[file tail $fullsrcfile]"
        # If we're only testing specific files and this isn't one of them, skip it.
        # If we're only testing specific files and this isn't one of them, skip it.
        if ![runtest_file_p $runtests $srcfile] then {
        if ![runtest_file_p $runtests $srcfile] then {
            continue
            continue
        }
        }
        # Exclude tests listed in exclude_list.
        # Exclude tests listed in exclude_list.
        if { $flag == "-x" } then {
        if { $flag == "-x" } then {
            if {[lsearch $exclude_list "$srcfile"] != -1} then {
            if {[lsearch $exclude_list "$srcfile"] != -1} then {
                continue
                continue
            }
            }
        }
        }
        newlib_pass_fail "$srcfile"
        newlib_pass_fail "$srcfile"
    }
    }
}
}
# newlib_pass_fail takes the basename of a test source file, which it
# newlib_pass_fail takes the basename of a test source file, which it
# compiles and runs.
# compiles and runs.
proc newlib_pass_fail { srcfile } {
proc newlib_pass_fail { srcfile } {
    global srcdir tmpdir subdir
    global srcdir tmpdir subdir
    set fullsrcfile "$srcdir/$subdir/$srcfile"
    set fullsrcfile "$srcdir/$subdir/$srcfile"
    set test_driver "$tmpdir/[file rootname $srcfile].x"
    set test_driver "$tmpdir/[file rootname $srcfile].x"
    set comp_output [newlib_target_compile "$fullsrcfile" "$test_driver" "executable" ""]
    set comp_output [newlib_target_compile "$fullsrcfile" "$test_driver" "executable" ""]
    if { $comp_output != "" } {
    if { $comp_output != "" } {
        fail "$subdir/$srcfile compilation"
        fail "$subdir/$srcfile compilation"
        unresolved "$subdir/$srcfile execution"
        unresolved "$subdir/$srcfile execution"
    } else {
    } else {
        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]
        $status "$subdir/$srcfile execution"
        $status "$subdir/$srcfile execution"
    }
    }
}
}
 
 

powered by: WebSVN 2.1.0

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