Initial check-in of openocd-0.7.0 as it can be downloaded from http://sourceforge.net/projects/openocd/files/openocd/0.7.0/ Any modifications will follow. Change-Id: I6949beaefd589e046395ea0cb80f4e1ab1654d55
69 lines
1.3 KiB
Plaintext
69 lines
1.3 KiB
Plaintext
source [file dirname [info script]]/testing.tcl
|
|
|
|
needs cmd file
|
|
needs cmd exec
|
|
|
|
catch {
|
|
exec rm -rf tmp
|
|
exec mkdir tmp
|
|
exec touch tmp/file
|
|
exec mkdir tmp/dir
|
|
}
|
|
|
|
test mkdir-1.1 "Simple dir" {
|
|
file mkdir tmp/abc
|
|
file isdir tmp/abc
|
|
} {1}
|
|
|
|
test mkdir-1.2 "Create missing parents" {
|
|
file mkdir tmp/def/ghi/jkl
|
|
file isdir tmp/def/ghi/jkl
|
|
} {1}
|
|
|
|
test mkdir-1.3 "Existing dir" {
|
|
file mkdir tmp/dir
|
|
file isdir tmp/dir
|
|
} {1}
|
|
|
|
test mkdir-1.4 "Child of existing dir" {
|
|
file mkdir tmp/dir/child
|
|
file isdir tmp/dir/child
|
|
} {1}
|
|
|
|
test mkdir-1.5 "Create dir over existing file" {
|
|
list [catch {file mkdir tmp/file} msg] [file isdir tmp/file]
|
|
} {1 0}
|
|
|
|
test mkdir-1.6 "Create dir below existing file" {
|
|
list [catch {file mkdir tmp/file/dir} msg] [file isdir tmp/file/dir]
|
|
} {1 0}
|
|
|
|
test mkdir-1.8 "Multiple dirs" {
|
|
file mkdir tmp/1 tmp/2 tmp/3
|
|
list [file isdir tmp/1] [file isdir tmp/2] [file isdir tmp/3]
|
|
} {1 1 1}
|
|
|
|
test mkdir-1.7 "Stop on failure" {
|
|
catch {file mkdir tmp/4 tmp/file tmp/5}
|
|
list [file isdir tmp/4] [file isdir tmp/5]
|
|
} {1 0}
|
|
|
|
test rmdir-2.0 "Remove existing dir" {
|
|
file delete tmp/1
|
|
file isdir tmp/1
|
|
} {0}
|
|
|
|
test rmdir-2.1 "Remove missing dir" {
|
|
file delete tmp/1
|
|
} {}
|
|
|
|
test rmdir-2.2 "Remove non-empty dir" {
|
|
catch {file delete tmp/def}
|
|
} {1}
|
|
|
|
catch {
|
|
exec rm -rf tmp
|
|
}
|
|
|
|
testreport
|