Skip to content

Commit

Permalink
build: Allow some paths to contain spaces
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
msteveb committed Apr 8, 2021
1 parent 4a5392e commit bcd4434
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion auto.def
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions tests/Makefile.in
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests/interactive.test
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/runall.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bcd4434

Please sign in to comment.