Fossil SCM

fossil-scm / test / th1-docs.test
Blame History Raw 77 lines
1
#
2
# Copyright (c) 2015 D. Richard Hipp
3
#
4
# This program is free software; you can redistribute it and/or
5
# modify it under the terms of the Simplified BSD License (also
6
# known as the "2-Clause License" or "FreeBSD License".)
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but without any warranty; without even the implied warranty of
10
# merchantability or fitness for a particular purpose.
11
#
12
# Author contact information:
13
# [email protected]
14
# http://www.hwaci.com/drh/
15
#
16
############################################################################
17
#
18
# TH1 Docs
19
#
20
21
fossil test-th-eval "hasfeature th1Docs"
22
23
if {[normalize_result] ne "1"} {
24
puts "Fossil was not compiled with TH1 docs support."
25
test_cleanup_then_return
26
}
27
28
fossil test-th-eval "hasfeature tcl"
29
30
if {[normalize_result] ne "1"} {
31
puts "Fossil was not compiled with Tcl support."
32
test_cleanup_then_return
33
}
34
35
###############################################################################
36
37
test_setup
38
39
###############################################################################
40
41
set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test.
42
set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
43
44
###############################################################################
45
46
set data [fossil info]
47
48
regexp -line -- {^repository: (.*)$} $data dummy repository
49
50
if {[string length $repository] == 0 || ![file exists $repository]} {
51
error "unable to locate repository"
52
}
53
54
set dataFileName [file join $::testdir th1-docs-input.txt]
55
set origFileStat [file join $::testdir fileStat.th1]
56
57
if {![file exists $origFileStat]} {
58
error "unable to locate [$origFileStat]"
59
}
60
61
file copy $origFileStat fileStat.th1
62
fossil add fileStat.th1
63
fossil commit -m "Add fileStat.th1"
64
65
###############################################################################
66
67
set RESULT [test_fossil_http \
68
$repository $dataFileName /doc/trunk/fileStat.th1]
69
70
test th1-docs-1a {[regexp {<title>Unnamed Fossil Project: fileStat.th1</title>} $RESULT]}
71
test th1-docs-1b {[regexp {>\[[0-9a-f]{40,64}\]<} $RESULT]}
72
test th1-docs-1c {[regexp { contains \d+ files\.} $RESULT]}
73
74
###############################################################################
75
76
test_cleanup
77

Keyboard Shortcuts

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