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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [expect/] [tests/] [pid.test] - Blame information for rev 1774

Go to most recent revision | 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
if {[string compare test [info procs test]] == 1} then {source defs}
8
 
9
catch {unset x}
10
 
11
#exp_internal -f /dev/ttyp5 0
12
 
13
test pid-1.2 {basic pid operation} {
14
    set cat [exp_spawn -noecho cat]
15
    set x [expr 0!=$cat]
16
    set y [expr 0==[string compare $cat [exp_pid -i $spawn_id]]]
17
    exp_close;exp_wait
18
    list $x $y
19
} {1 1}
20
 
21
test pid-1.3 {basic pid operation} {
22
    exp_spawn -noecho cat; set cat $spawn_id
23
    exp_spawn -noecho cat; set cat2 $spawn_id
24
    set x [expr {0!=[string compare [exp_pid -i $cat2] [exp_pid -i $cat]]}]
25
    exp_close -i $cat;exp_wait -i $cat;exp_close -i $cat2;exp_wait -i $cat2
26
    set x
27
} {1}
28
 
29
test pid-1.4 {basic pid operation} {
30
    list [catch {exp_pid -i 100} msg] $msg
31
} {1 {exp_pid: invalid spawn id (100)}}
32
 
33
test pid-1.5 {basic pid operation} {
34
        list [catch {exp_pid -j} msg] $msg
35
} {1 {usage: -i spawn_id}}
36
 

powered by: WebSVN 2.1.0

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