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

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [insight/] [tcl/] [tests/] [pid.test] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Commands covered:  pid
2
#
3
# This file contains a collection of tests for one or more of the Tcl
4
# built-in commands.  Sourcing this file into Tcl runs the tests and
5
# generates output for errors.  No output means no errors were found.
6
#
7
# Copyright (c) 1991-1993 The Regents of the University of California.
8
# Copyright (c) 1994-1995 Sun Microsystems, Inc.
9
#
10
# See the file "license.terms" for information on usage and redistribution
11
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12
#
13
# RCS: @(#) $Id: pid.test,v 1.1.1.1 2002-01-16 10:25:36 markom Exp $
14
 
15
# If pid is not defined just return with no error
16
# Some platforms may not have the pid command implemented
17
if {[info commands pid] == ""} {
18
    puts "pid is not implemented for this machine"
19
    return
20
}
21
 
22
if {[string compare test [info procs test]] == 1} then {source defs}
23
 
24
catch {removeFile test1}
25
 
26
test pid-1.1 {pid command} {
27
    regexp {(^[0-9]+$)|(^0x[0-9a-fA-F]+$)} [pid]
28
} 1
29
test pid-1.2 {pid command} {unixOrPc unixExecs} {
30
    set f [open {| echo foo | cat >test1} w]
31
    set pids [pid $f]
32
    close $f
33
    catch {removeFile test1}
34
    list [llength $pids] [regexp {^[0-9]+$} [lindex $pids 0]] \
35
       [regexp {^[0-9]+$} [lindex $pids 1]] \
36
       [expr {[lindex $pids 0] == [lindex $pids 1]}]
37
} {2 1 1 0}
38
test pid-1.3 {pid command} {
39
    set f [open test1 w]
40
    set pids [pid $f]
41
    close $f
42
    set pids
43
} {}
44
test pid-1.4 {pid command} {
45
    list [catch {pid a b} msg] $msg
46
} {1 {wrong # args: should be "pid ?channelId?"}}
47
test pid-1.5 {pid command} {
48
    list [catch {pid gorp} msg] $msg
49
} {1 {can not find channel named "gorp"}}
50
 
51
catch {removeFile test1}
52
concat {}

powered by: WebSVN 2.1.0

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