Check-in [2139fe19a8]
Overview
Comment:Updated to allow user to specify mountpoint at compile-time
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2139fe19a8d82b023277ab2769181a7ab19e8ae519954cd5aa536867409278ad
User & Date: rkeene on 2019-09-18 05:30:25
Other Links: manifest | tags
Context
2019-09-20
14:53
Updated minirivet to support outputting to a variable or a different channel check-in: b07616bee9 user: rkeene tags: trunk
2019-09-18
05:30
Updated to allow user to specify mountpoint at compile-time check-in: 2139fe19a8 user: rkeene tags: trunk
05:26
Updated to support overriding the mountpoint being used by the test program check-in: 57c553f477 user: rkeene tags: trunk
Changes

Modified Makefile from [54a76794b5] to [a677a5fe5b].

1

2

3
4
5
6
7
8
9
1
2

3
4
5
6
7
8
9
10

+
-
+







TCL_CONFIG_SH := /usr/lib64/tclConfig.sh
XVFS_ROOT_MOUNTPOINT := //xvfs:/
CPPFLAGS      := -I. -DUSE_TCL_STUBS=1 -DXVFS_DEBUG $(shell . "${TCL_CONFIG_SH}" && echo "$${TCL_INCLUDE_SPEC}") $(XVFS_ADD_CPPFLAGS)
CPPFLAGS      := -DXVFS_ROOT_MOUNTPOINT='"$(XVFS_ROOT_MOUNTPOINT)"' -I. -DUSE_TCL_STUBS=1 -DXVFS_DEBUG $(shell . "${TCL_CONFIG_SH}" && echo "$${TCL_INCLUDE_SPEC}") $(XVFS_ADD_CPPFLAGS)
CFLAGS        := -fPIC -g3 -ggdb3 -Wall $(XVFS_ADD_CFLAGS)
LDFLAGS       := $(XVFS_ADD_LDFLAGS)
LIBS          := $(shell . "${TCL_CONFIG_SH}" && echo "$${TCL_STUB_LIB_SPEC}")
TCLSH         := tclsh
LIB_SUFFIX    := $(shell . "${TCL_CONFIG_SH}"; echo "$${TCL_SHLIB_SUFFIX:-.so}")

all: example-standalone$(LIB_SUFFIX) example-client$(LIB_SUFFIX) example-flexible$(LIB_SUFFIX) xvfs$(LIB_SUFFIX)
46
47
48
49
50
51
52
53
54


55
56
57
58
59
60
61
47
48
49
50
51
52
53


54
55
56
57
58
59
60
61
62







-
-
+
+








benchmark:
	$(MAKE) clean all XVFS_ADD_CPPFLAGS="-UXVFS_DEBUG" XVFS_ADD_CFLAGS="-g0 -ggdb0 -s -O3"
	./benchmark.tcl

test: example-standalone$(LIB_SUFFIX) xvfs$(LIB_SUFFIX) example-client$(LIB_SUFFIX) example-flexible$(LIB_SUFFIX) Makefile
	rm -f __test__.tcl
	echo 'if {[catch { eval $$::env(XVFS_TEST_LOAD_COMMANDS); source //xvfs:/example/main.tcl }]} { puts stderr $$::errorInfo; exit 1 }; exit 0' > __test__.tcl
	@export XVFS_TEST_LOAD_COMMANDS; for XVFS_TEST_LOAD_COMMANDS in \
	echo 'if {[catch { eval $$::env(XVFS_TEST_LOAD_COMMANDS); source $(XVFS_ROOT_MOUNTPOINT)example/main.tcl }]} { puts stderr $$::errorInfo; exit 1 }; exit 0' > __test__.tcl
	@export XVFS_ROOT_MOUNTPOINT; export XVFS_TEST_LOAD_COMMANDS; for XVFS_TEST_LOAD_COMMANDS in \
		'load ./example-standalone$(LIB_SUFFIX) Xvfs_example' \
		'load -global ./xvfs$(LIB_SUFFIX); load ./example-client$(LIB_SUFFIX) Xvfs_example' \
		'load ./xvfs$(LIB_SUFFIX); load ./example-flexible$(LIB_SUFFIX) Xvfs_example' \
		'load ./example-flexible$(LIB_SUFFIX) Xvfs_example'; do \
			echo "[$${XVFS_TEST_LOAD_COMMANDS}] $(GDB) $(TCLSH) __test__.tcl $(TCL_TEST_ARGS)"; \
			$(GDB) $(TCLSH) __test__.tcl $(TCL_TEST_ARGS) || exit 1; \
	done

Modified example/main.tcl from [7c5b926b51] to [473c237929].

1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16

17
18
19
20
21
22
23
1
2
3
4
5
6
7
8
9
10

11
12
13
14
15

16
17
18
19
20
21
22
23










-
+




-
+







#! /usr/bin/env tclsh

package require tcltest

tcltest::testConstraint tcl87 [string match "8.7.*" [info patchlevel]]

tcltest::configure -verbose pbse
tcltest::configure {*}$argv

if {![info exists ::env(XVFS_ROOT_MOUNTPOINT)]} {
	set xvfsRootMountpoint "//xvfs:"
	set xvfsRootMountpoint "//xvfs:/"
} else {
	set xvfsRootMountpoint $::env(XVFS_ROOT_MOUNTPOINT)
}

set rootDir "${xvfsRootMountpoint}/example"
set rootDir "${xvfsRootMountpoint}example"
set rootDirNative  [file join [pwd] example]
#set rootDir $rootDirNative
set testFile "${rootDir}/foo"

proc glob_verify {args} {
	set rv [glob -nocomplain -directory $::rootDir {*}$args]
	set verify [glob -nocomplain -directory $::rootDirNative {*}$args]