File: posix.test

package info (click to toggle)
jimtcl 0.83-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 17,432 kB
  • sloc: ansic: 207,301; tcl: 5,862; sh: 4,834; cpp: 1,671; makefile: 288
file content (40 lines) | stat: -rw-r--r-- 1,138 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
source [file dirname [info script]]/testing.tcl

needs constraint jim
constraint cmd os.getids
constraint cmd os.gethostname
constraint cmd os.uptime
constraint cmd os.fork

test posix-1.1 {os.getids usage} -constraints os.getids -body {
	os.getids blah
} -returnCodes error -result {wrong # args: should be "os.getids"}

test posix-1.2 {os.getids} -constraints os.getids -body {
	set uid [exec id -u]
	set d [os.getids]
	if {$d(uid) != $uid} {
		error "os.getids uid=$d(uid) not match system $uid"
	}
} -result {}


test posix-1.4 {os.uptime} -constraints os.uptime -body {
	string is integer -strict [os.uptime]
} -result {1}

test posix-1.5 {os.gethostname usage} -constraints os.gethostname -body {
	os.gethostname blah
} -returnCodes error -result {wrong # args: should be "os.gethostname"}

test posix-1.6 {os.gethostname} -constraints os.gethostname -body {
	if {[exec hostname] ne [os.gethostname]} {
		error "os.gethostname did not match system hostname"
	}
} -result {}

test posix-1.7 {os.fork usage} -constraints os.fork -body {
	os.fork extra args
} -returnCodes error -result {wrong # args: should be "os.fork"}

testreport