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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [tests/] [unixFile.test] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# This file contains tests for the routines in the file tclUnixFile.c
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) 1998 by Scriptics Corporation.
8
#
9
# See the file "license.terms" for information on usage and redistribution
10
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
#
12
# RCS: @(#) $Id: unixFile.test,v 1.1.1.1 2002-01-16 10:25:36 markom Exp $
13
 
14
 
15
if {[string compare test [info procs test]] == 1} then {source defs}
16
 
17
if {[info commands testobj] == {}} {
18
    puts "This application hasn't been compiled with the \"testfindexecutable\""
19
    puts "command, so I can't test the Tcl_FindExecutable function"
20
    return
21
}
22
 
23
if {$tcl_platform(platform) != "unix"} {
24
    return
25
}
26
 
27
 
28
set oldPath $env(PATH)
29
close [open junk w]
30
file attributes junk -perm 0777
31
 
32
set absPath [file join [pwd] junk]
33
test unixFile-1.1 {Tcl_FindExecutable} {
34
    set env(PATH) ""
35
    testfindexecutable junk
36
} $absPath
37
test unixFile-1.2 {Tcl_FindExecutable} {
38
    set env(PATH) "/dummy"
39
    testfindexecutable junk
40
} {}
41
test unixFile-1.3 {Tcl_FindExecutable} {
42
    set env(PATH) "/dummy:[pwd]"
43
    testfindexecutable junk
44
} $absPath
45
test unixFile-1.4 {Tcl_FindExecutable} {
46
    set env(PATH) "/dummy:"
47
    testfindexecutable junk
48
} $absPath
49
test unixFile-1.5 {Tcl_FindExecutable} {
50
    set env(PATH) "/dummy:/dummy"
51
    testfindexecutable junk
52
} {}
53
test unixFile-1.6 {Tcl_FindExecutable} {
54
    set env(PATH) "/dummy::/dummy"
55
    testfindexecutable junk
56
} $absPath
57
test unixFile-1.7 {Tcl_FindExecutable} {
58
    set env(PATH) ":/dummy"
59
    testfindexecutable junk
60
} $absPath
61
 
62
 
63
 
64
 
65
set env(PATH) $oldPath
66
file delete junk

powered by: WebSVN 2.1.0

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