Fossil SCM

Defer requiring json loading until after it is determined that fossil json works.

andybradford 2016-02-07 04:15 trunk
Commit 5d700c7d852ff11f688b92ab7eb434069a8cbdf7
1 file changed +10 -10
+10 -10
--- test/json.test
+++ test/json.test
@@ -15,10 +15,20 @@
1515
#
1616
############################################################################
1717
#
1818
# Test JSON Support
1919
#
20
+
21
+# Make sure we have a build with the json command at all and that it
22
+# is not stubbed out. This assumes the current (as of 2016-01-27)
23
+# practice of eliminating all trace of the fossil json command when
24
+# not configured. If that changes, these conditions might not prevent
25
+# the rest of this file from running.
26
+fossil help -a
27
+if {[string first json $RESULT] < 0} {
28
+ puts "Fossil was not compiled with JSON support (fossil help -a)."; return
29
+}
2030
2131
# We need a JSON parser to effectively test the JSON produced by
2232
# fossil. It looks like the one from tcllib is exactly what we need.
2333
# On ActiveTcl, add it with teacup. On other platforms, YMMV.
2434
# teacup install json
@@ -32,20 +42,10 @@
3242
return {}
3343
}
3444
return $result
3545
}
3646
37
-# Make sure we have a build with the json command at all and that it
38
-# is not stubbed out. This assumes the current (as of 2016-01-27)
39
-# practice of eliminating all trace of the fossil json command when
40
-# not configured. If that changes, these conditions might not prevent
41
-# the rest of this file from running.
42
-fossil help -a
43
-if {[string first json $RESULT] < 0} {
44
- puts "Fossil was not compiled with JSON support (fossil help -a)."; return
45
-}
46
-
4747
# and that the json itself smells ok and has the expected API error code in it
4848
fossil json -expectError
4949
set JR [json2dict $RESULT]
5050
if {$JR eq ""} {
5151
puts "Fossil was not compiled with JSON support (bad JSON)."; return
5252
--- test/json.test
+++ test/json.test
@@ -15,10 +15,20 @@
15 #
16 ############################################################################
17 #
18 # Test JSON Support
19 #
 
 
 
 
 
 
 
 
 
 
20
21 # We need a JSON parser to effectively test the JSON produced by
22 # fossil. It looks like the one from tcllib is exactly what we need.
23 # On ActiveTcl, add it with teacup. On other platforms, YMMV.
24 # teacup install json
@@ -32,20 +42,10 @@
32 return {}
33 }
34 return $result
35 }
36
37 # Make sure we have a build with the json command at all and that it
38 # is not stubbed out. This assumes the current (as of 2016-01-27)
39 # practice of eliminating all trace of the fossil json command when
40 # not configured. If that changes, these conditions might not prevent
41 # the rest of this file from running.
42 fossil help -a
43 if {[string first json $RESULT] < 0} {
44 puts "Fossil was not compiled with JSON support (fossil help -a)."; return
45 }
46
47 # and that the json itself smells ok and has the expected API error code in it
48 fossil json -expectError
49 set JR [json2dict $RESULT]
50 if {$JR eq ""} {
51 puts "Fossil was not compiled with JSON support (bad JSON)."; return
52
--- test/json.test
+++ test/json.test
@@ -15,10 +15,20 @@
15 #
16 ############################################################################
17 #
18 # Test JSON Support
19 #
20
21 # Make sure we have a build with the json command at all and that it
22 # is not stubbed out. This assumes the current (as of 2016-01-27)
23 # practice of eliminating all trace of the fossil json command when
24 # not configured. If that changes, these conditions might not prevent
25 # the rest of this file from running.
26 fossil help -a
27 if {[string first json $RESULT] < 0} {
28 puts "Fossil was not compiled with JSON support (fossil help -a)."; return
29 }
30
31 # We need a JSON parser to effectively test the JSON produced by
32 # fossil. It looks like the one from tcllib is exactly what we need.
33 # On ActiveTcl, add it with teacup. On other platforms, YMMV.
34 # teacup install json
@@ -32,20 +42,10 @@
42 return {}
43 }
44 return $result
45 }
46
 
 
 
 
 
 
 
 
 
 
47 # and that the json itself smells ok and has the expected API error code in it
48 fossil json -expectError
49 set JR [json2dict $RESULT]
50 if {$JR eq ""} {
51 puts "Fossil was not compiled with JSON support (bad JSON)."; return
52

Keyboard Shortcuts

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