aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2021-04-09 08:08:02 +1000
committerSteve Bennett <steveb@workware.net.au>2021-04-09 08:29:24 +1000
commitbcd4434161897da5203cdfaef8b2227e15d82c45 (patch)
treefdadc54b907c5ca5e71aa2168fb0d0894824a114
parent4a5392ef726b2ab4f750df5cae471699bc809b05 (diff)
downloadjimtcl-bcd4434161897da5203cdfaef8b2227e15d82c45.zip
jimtcl-bcd4434161897da5203cdfaef8b2227e15d82c45.tar.gz
jimtcl-bcd4434161897da5203cdfaef8b2227e15d82c45.tar.bz2
build: Allow some paths to contain spaces
Quote the build dir or and the path to jimsh/tclsh in the Makefile in case they contain spaces. Also fix a few problems in tests/ that arise when the build and/or source dir contain spaces. Fixes #199 Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--Makefile.in2
-rw-r--r--auto.def2
-rw-r--r--tests/Makefile.in6
-rw-r--r--tests/interactive.test2
-rw-r--r--tests/runall.tcl2
5 files changed, 6 insertions, 8 deletions
diff --git a/Makefile.in b/Makefile.in
index b18768e..e5dbe86 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -132,7 +132,7 @@ uninstall:
@endif
test check: $(JIMSH)
- $(DEF_LD_PATH) $(MAKE) -C tests jimsh=@builddir@/jimsh
+ $(DEF_LD_PATH) $(MAKE) -C tests jimsh="@builddir@/jimsh"
$(OBJS) jimsh.o initjimsh.o: Makefile $(wildcard *.h)
diff --git a/auto.def b/auto.def
index 3f2f5a0..347951f 100644
--- a/auto.def
+++ b/auto.def
@@ -296,7 +296,7 @@ switch -glob -- $host_os {
# Find some tools
cc-check-tools ar ranlib strip
-define tclsh [info nameofexecutable]
+define tclsh [quote-if-needed [info nameofexecutable]]
# We only support silent-rules for GNU Make
define NO_SILENT_RULES
diff --git a/tests/Makefile.in b/tests/Makefile.in
index e89f2fb..0d7c63c 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,13 +1,11 @@
jimsh ?= ../jimsh
tclsh ?= tclsh
-DEF_LD_PATH := @LD_LIBRARY_PATH@="@builddir@:$(@LD_LIBRARY_PATH@)"
-
test:
- @$(DEF_LD_PATH) $(jimsh) @abs_top_srcdir@/tests/runall.tcl
+ @LD_LIBRARY_PATH="@builddir@:$(@LD_LIBRARY_PATH@)" "$(jimsh)" "@abs_top_srcdir@/tests/runall.tcl"
tcl:
- @rc=0; for i in @abs_top_srcdir@/tests/*.test; do $(tclsh) -encoding utf-8 $$i || rc=$?; done; exit $$rc
+ @rc=0; for i in "@abs_top_srcdir@"/tests/*.test; do "$(tclsh)" -encoding utf-8 $$i || rc=$?; done; exit $$rc
clean:
rm -f gorp.file2 gorp.file sleepx test1 exec.tmp1
diff --git a/tests/interactive.test b/tests/interactive.test
index d1c29c1..2e783f9 100644
--- a/tests/interactive.test
+++ b/tests/interactive.test
@@ -12,7 +12,7 @@ set env(HOME) [pwd]
file delete .jim_history
# spawn the process to be used for testing
-set p [expect::spawn [info nameofexecutable]]
+set p [expect::spawn [list [info nameofexecutable]]]
set env $saveenv
diff --git a/tests/runall.tcl b/tests/runall.tcl
index a97ecfd..9ef76b8 100644
--- a/tests/runall.tcl
+++ b/tests/runall.tcl
@@ -42,7 +42,7 @@ if {[info commands interp] eq ""} {
}
# Run the test
- catch -exit {$i eval source $script} msg opts
+ catch -exit [list $i eval [list source $script]] msg opts
if {[info returncode $opts(-code)] eq "error"} {
puts [format "%16s: --- error ($msg)" $script]
incr total(fail)