Fossil SCM

Merged tclsh-macos down to trunk.

wyoung 2018-09-02 21:47 trunk merge
Commit ee2ffe359965a22f34dc64ecfb3f8e0ec4c8586891e29da05a8af7af015cfb59
+1 -1
--- Makefile.in
+++ Makefile.in
@@ -34,11 +34,11 @@
3434
TCC = @CC@
3535
3636
#### Tcl shell for use in running the fossil testsuite. If you do not
3737
# care about testing the end result, this can be blank.
3838
#
39
-TCLSH = tclsh
39
+TCLSH = @TCLSH@
4040
4141
CFLAGS = @CFLAGS@
4242
LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
4343
BCCFLAGS = @CPPFLAGS@ $(CFLAGS)
4444
TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ $(CFLAGS) -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H
4545
--- Makefile.in
+++ Makefile.in
@@ -34,11 +34,11 @@
34 TCC = @CC@
35
36 #### Tcl shell for use in running the fossil testsuite. If you do not
37 # care about testing the end result, this can be blank.
38 #
39 TCLSH = tclsh
40
41 CFLAGS = @CFLAGS@
42 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
43 BCCFLAGS = @CPPFLAGS@ $(CFLAGS)
44 TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ $(CFLAGS) -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H
45
--- Makefile.in
+++ Makefile.in
@@ -34,11 +34,11 @@
34 TCC = @CC@
35
36 #### Tcl shell for use in running the fossil testsuite. If you do not
37 # care about testing the end result, this can be blank.
38 #
39 TCLSH = @TCLSH@
40
41 CFLAGS = @CFLAGS@
42 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
43 BCCFLAGS = @CPPFLAGS@ $(CFLAGS)
44 TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ $(CFLAGS) -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H
45
+36 -1
--- auto.def
+++ auto.def
@@ -33,12 +33,47 @@
3333
}
3434
3535
# Use pread/pwrite system calls in place of seek + read/write if possible
3636
define USE_PREAD [cc-check-functions pread]
3737
38
-# Find tclsh for the test suite. Can't yet use jimsh for this.
38
+# Find tclsh for the test suite.
39
+#
40
+# We can't use jimsh for this: the test suite uses features of Tcl that
41
+# Jim doesn't support, either statically or due to the way it's built by
42
+# autosetup. For example, Jim supports `file normalize`, but only if
43
+# you build it with HAVE_REALPATH, which won't ever be defined in this
44
+# context because autosetup doesn't try to discover platform-specific
45
+# details like that before it decides to build jimsh0. Besides which,
46
+# autosetup won't build jimsh0 at all if it can find tclsh itself.
47
+# Ironically, this means we may right now be running under either jimsh0
48
+# or a version of tclsh that we find unsuitable below!
3949
cc-check-progs tclsh
50
+set hbtd /usr/local/Cellar/tcl-tk
51
+if {[string equal false [get-define TCLSH]]} {
52
+ msg-result "WARNING: 'make test' will not run here."
53
+} else {
54
+ set v [exec /bin/sh -c "echo 'puts \$tcl_version' | tclsh"]
55
+ if {[expr $v >= 8.6]} {
56
+ msg-result "Found Tclsh version $v in the PATH."
57
+ define TCLSH tclsh
58
+ } elseif {[file isdirectory $hbtd]} {
59
+ # This is a macOS system with the Homebrew version of Tcl/Tk
60
+ # installed. Select the newest version. It won't normally be
61
+ # in the PATH to avoid shadowing /usr/bin/tclsh, and even if it
62
+ # were in the PATH, it's bad practice to put /usr/local/bin (the
63
+ # Homebrew default) ahead of /usr/bin, especially given that
64
+ # it's user-writeable by default with Homebrew. Thus, we can be
65
+ # pretty sure the only way to call it is with an absolute path.
66
+ set v [exec ls -tr $hbtd | tail -1]
67
+ set path "$hbtd/$v/bin/tclsh"
68
+ define TCLSH $path
69
+ msg-result "Using Homebrew Tcl/Tk version $path."
70
+ } else {
71
+ msg-result "WARNING: tclsh $v found; need >= 8.6 for 'make test'."
72
+ define TCLSH false ;# force "make test" failure via /usr/bin/false
73
+ }
74
+}
4075
4176
define EXTRA_CFLAGS "-Wall"
4277
define EXTRA_LDFLAGS ""
4378
define USE_SYSTEM_SQLITE 0
4479
define USE_LINENOISE 0
4580
--- auto.def
+++ auto.def
@@ -33,12 +33,47 @@
33 }
34
35 # Use pread/pwrite system calls in place of seek + read/write if possible
36 define USE_PREAD [cc-check-functions pread]
37
38 # Find tclsh for the test suite. Can't yet use jimsh for this.
 
 
 
 
 
 
 
 
 
 
39 cc-check-progs tclsh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
41 define EXTRA_CFLAGS "-Wall"
42 define EXTRA_LDFLAGS ""
43 define USE_SYSTEM_SQLITE 0
44 define USE_LINENOISE 0
45
--- auto.def
+++ auto.def
@@ -33,12 +33,47 @@
33 }
34
35 # Use pread/pwrite system calls in place of seek + read/write if possible
36 define USE_PREAD [cc-check-functions pread]
37
38 # Find tclsh for the test suite.
39 #
40 # We can't use jimsh for this: the test suite uses features of Tcl that
41 # Jim doesn't support, either statically or due to the way it's built by
42 # autosetup. For example, Jim supports `file normalize`, but only if
43 # you build it with HAVE_REALPATH, which won't ever be defined in this
44 # context because autosetup doesn't try to discover platform-specific
45 # details like that before it decides to build jimsh0. Besides which,
46 # autosetup won't build jimsh0 at all if it can find tclsh itself.
47 # Ironically, this means we may right now be running under either jimsh0
48 # or a version of tclsh that we find unsuitable below!
49 cc-check-progs tclsh
50 set hbtd /usr/local/Cellar/tcl-tk
51 if {[string equal false [get-define TCLSH]]} {
52 msg-result "WARNING: 'make test' will not run here."
53 } else {
54 set v [exec /bin/sh -c "echo 'puts \$tcl_version' | tclsh"]
55 if {[expr $v >= 8.6]} {
56 msg-result "Found Tclsh version $v in the PATH."
57 define TCLSH tclsh
58 } elseif {[file isdirectory $hbtd]} {
59 # This is a macOS system with the Homebrew version of Tcl/Tk
60 # installed. Select the newest version. It won't normally be
61 # in the PATH to avoid shadowing /usr/bin/tclsh, and even if it
62 # were in the PATH, it's bad practice to put /usr/local/bin (the
63 # Homebrew default) ahead of /usr/bin, especially given that
64 # it's user-writeable by default with Homebrew. Thus, we can be
65 # pretty sure the only way to call it is with an absolute path.
66 set v [exec ls -tr $hbtd | tail -1]
67 set path "$hbtd/$v/bin/tclsh"
68 define TCLSH $path
69 msg-result "Using Homebrew Tcl/Tk version $path."
70 } else {
71 msg-result "WARNING: tclsh $v found; need >= 8.6 for 'make test'."
72 define TCLSH false ;# force "make test" failure via /usr/bin/false
73 }
74 }
75
76 define EXTRA_CFLAGS "-Wall"
77 define EXTRA_LDFLAGS ""
78 define USE_SYSTEM_SQLITE 0
79 define USE_LINENOISE 0
80
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -39,10 +39,11 @@
3939
Lorem ipsum
4040
dolor sic amet
4141
}
4242
4343
# try long lines
44
+puts "LL: [pwd]"
4445
set a3 "abcdefgh"
4546
set a4 $a3$a3
4647
set a5 $a4$a4
4748
set a6 $a5$a5
4849
write_file line-0064 "$a6\n"
4950
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -39,10 +39,11 @@
39 Lorem ipsum
40 dolor sic amet
41 }
42
43 # try long lines
 
44 set a3 "abcdefgh"
45 set a4 $a3$a3
46 set a5 $a4$a4
47 set a6 $a5$a5
48 write_file line-0064 "$a6\n"
49
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -39,10 +39,11 @@
39 Lorem ipsum
40 dolor sic amet
41 }
42
43 # try long lines
44 puts "LL: [pwd]"
45 set a3 "abcdefgh"
46 set a4 $a3$a3
47 set a5 $a4$a4
48 set a6 $a5$a5
49 write_file line-0064 "$a6\n"
50
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -39,10 +39,11 @@
3939
Lorem ipsum
4040
dolor sic amet
4141
}
4242
4343
# try long lines
44
+puts "LL: [pwd]"
4445
set a3 "abcdefgh"
4546
set a4 $a3$a3
4647
set a5 $a4$a4
4748
set a6 $a5$a5
4849
write_file line-0064 "$a6\n"
4950
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -39,10 +39,11 @@
39 Lorem ipsum
40 dolor sic amet
41 }
42
43 # try long lines
 
44 set a3 "abcdefgh"
45 set a4 $a3$a3
46 set a5 $a4$a4
47 set a6 $a5$a5
48 write_file line-0064 "$a6\n"
49
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -39,10 +39,11 @@
39 Lorem ipsum
40 dolor sic amet
41 }
42
43 # try long lines
44 puts "LL: [pwd]"
45 set a3 "abcdefgh"
46 set a4 $a3$a3
47 set a5 $a4$a4
48 set a6 $a5$a5
49 write_file line-0064 "$a6\n"
50
--- test/tester.tcl
+++ test/tester.tcl
@@ -20,10 +20,14 @@
2020
# tclsh ../test/tester.tcl ../bld/fossil
2121
#
2222
# Where ../test/tester.tcl is the name of this file and ../bld/fossil
2323
# is the name of the executable to be tested.
2424
#
25
+
26
+# We use some things introduced in 8.6 such as lmap. auto.def should
27
+# have found us a suitable Tcl installation.
28
+package require Tcl 8.6
2529
2630
set testfiledir [file normalize [file dirname [info script]]]
2731
set testrundir [pwd]
2832
set testdir [file normalize [file dirname $argv0]]
2933
set fossilexe [file normalize [lindex $argv 0]]
3034
--- test/tester.tcl
+++ test/tester.tcl
@@ -20,10 +20,14 @@
20 # tclsh ../test/tester.tcl ../bld/fossil
21 #
22 # Where ../test/tester.tcl is the name of this file and ../bld/fossil
23 # is the name of the executable to be tested.
24 #
 
 
 
 
25
26 set testfiledir [file normalize [file dirname [info script]]]
27 set testrundir [pwd]
28 set testdir [file normalize [file dirname $argv0]]
29 set fossilexe [file normalize [lindex $argv 0]]
30
--- test/tester.tcl
+++ test/tester.tcl
@@ -20,10 +20,14 @@
20 # tclsh ../test/tester.tcl ../bld/fossil
21 #
22 # Where ../test/tester.tcl is the name of this file and ../bld/fossil
23 # is the name of the executable to be tested.
24 #
25
26 # We use some things introduced in 8.6 such as lmap. auto.def should
27 # have found us a suitable Tcl installation.
28 package require Tcl 8.6
29
30 set testfiledir [file normalize [file dirname [info script]]]
31 set testrundir [pwd]
32 set testdir [file normalize [file dirname $argv0]]
33 set fossilexe [file normalize [lindex $argv 0]]
34

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button