os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/unixFile.test
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/unixFile.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,79 @@
     1.4 +# This file contains tests for the routines in the file tclUnixFile.c
     1.5 +#
     1.6 +# This file contains a collection of tests for one or more of the Tcl
     1.7 +# built-in commands.  Sourcing this file into Tcl runs the tests and
     1.8 +# generates output for errors.  No output means no errors were found.
     1.9 +#
    1.10 +# Copyright (c) 1998-1999 by Scriptics Corporation.
    1.11 +# Portions Copyright (c) 2007 Nokia Corporation and/or its subsidiaries. All rights reserved.  
    1.12 +#
    1.13 +# See the file "license.terms" for information on usage and redistribution
    1.14 +# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    1.15 +#
    1.16 +# RCS: @(#) $Id: unixFile.test,v 1.7 2002/07/05 10:38:43 dkf Exp $
    1.17 +
    1.18 +if {[lsearch [namespace children] ::tcltest] == -1} {
    1.19 +    package require tcltest
    1.20 +    namespace import -force ::tcltest::*
    1.21 +}
    1.22 +
    1.23 +if {[info commands testobj] == {}} {
    1.24 +    puts "This application hasn't been compiled with the \"testfindexecutable\""
    1.25 +    puts "command, so I can't test the Tcl_FindExecutable function"
    1.26 +    ::tcltest::cleanupTests
    1.27 +    return
    1.28 +}
    1.29 +
    1.30 +set oldpwd [pwd]
    1.31 +cd [temporaryDirectory]
    1.32 +
    1.33 +catch {
    1.34 +    set oldPath $env(PATH)
    1.35 +    file attributes [makeFile "" junk] -perm 0777
    1.36 +}
    1.37 +set absPath [file join [temporaryDirectory] junk]
    1.38 +
    1.39 +test unixFile-1.1 {Tcl_FindExecutable} {unixOnly tempNotSymbian} {
    1.40 +    set env(PATH) ""
    1.41 +    testfindexecutable junk
    1.42 +} $absPath
    1.43 +test unixFile-1.1.1 {Tcl_FindExecutable} {symbianOnly} {
    1.44 +    set env(PATH) ""
    1.45 +    testfindexecutable tcltest.exe
    1.46 +} "Z:/sys/bin/tcltest.exe"
    1.47 +test unixFile-1.1.2 {Tcl_FindExecutable} {symbianOnly} {
    1.48 +    set env(PATH) "Z:\\sys\\bin\\"
    1.49 +    testfindexecutable tcltest.exe
    1.50 +} "Z:/sys/bin/tcltest.exe"
    1.51 +
    1.52 +test unixFile-1.2 {Tcl_FindExecutable} {unixOnly tempNotSymbian} {
    1.53 +    set env(PATH) "/dummy"
    1.54 +    testfindexecutable junk
    1.55 +} {}
    1.56 +test unixFile-1.3 {Tcl_FindExecutable} {unixOnly tempNotSymbian} {
    1.57 +    set env(PATH) "/dummy:[pwd]"
    1.58 +    testfindexecutable junk
    1.59 +} $absPath
    1.60 +test unixFile-1.4 {Tcl_FindExecutable} {unixOnly tempNotSymbian} {
    1.61 +    set env(PATH) "/dummy:"
    1.62 +    testfindexecutable junk
    1.63 +} $absPath
    1.64 +test unixFile-1.5 {Tcl_FindExecutable} {unixOnly tempNotSymbian} {
    1.65 +    set env(PATH) "/dummy:/dummy"
    1.66 +    testfindexecutable junk
    1.67 +} {}
    1.68 +test unixFile-1.6 {Tcl_FindExecutable} {unixOnly tempNotSymbian} {
    1.69 +    set env(PATH) "/dummy::/dummy"
    1.70 +    testfindexecutable junk
    1.71 +} $absPath
    1.72 +test unixFile-1.7 {Tcl_FindExecutable} {unixOnly tempNotSymbian} {
    1.73 +    set env(PATH) ":/dummy"
    1.74 +    testfindexecutable junk
    1.75 +} $absPath
    1.76 +
    1.77 +# cleanup
    1.78 +catch {set env(PATH) $oldPath}
    1.79 +removeFile junk
    1.80 +cd $oldpwd
    1.81 +::tcltest::cleanupTests
    1.82 +return