test-server.tcl at tip

File tsmf/test-server.tcl from the latest check-in


#! /usr/bin/env tclsh

set workdir [file normalize [file dirname [info script]]]

# For TSMF
lappend auto_path [file join $workdir lib]

# For the TUAPI package
lappend auto_path [file join $workdir ..]

package require tsmf

# Create a new log directory for this run
set logdir [file join $workdir test-log]
file delete -force $logdir
file mkdir $logdir

set svcdir [file join $workdir test-svc]

# Initialize the TSMF server
::tsmf::server::init [list \
	svcdir [file join $workdir test-svc] \
	confdirs [list [file join $workdir test-svc]] \
	logdir $logdir \
]
puts "INIT complete"

puts "Starting service..."
set result [::tsmf::server::wait svc://test1 started]
puts "OK! $result"

puts "Initialization complete"

vwait ::done