summaryrefslogtreecommitdiff
path: root/test/th1-docs.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/th1-docs.test')
-rw-r--r--test/th1-docs.test76
1 files changed, 76 insertions, 0 deletions
diff --git a/test/th1-docs.test b/test/th1-docs.test
new file mode 100644
index 0000000..17980d2
--- /dev/null
+++ b/test/th1-docs.test
@@ -0,0 +1,76 @@
+#
+# Copyright (c) 2015 D. Richard Hipp
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the Simplified BSD License (also
+# known as the "2-Clause License" or "FreeBSD License".)
+#
+# This program is distributed in the hope that it will be useful,
+# but without any warranty; without even the implied warranty of
+# merchantability or fitness for a particular purpose.
+#
+# Author contact information:
+# drh@hwaci.com
+# http://www.hwaci.com/drh/
+#
+############################################################################
+#
+# TH1 Docs
+#
+
+fossil test-th-eval "hasfeature th1Docs"
+
+if {[normalize_result] ne "1"} {
+ puts "Fossil was not compiled with TH1 docs support."
+ test_cleanup_then_return
+}
+
+fossil test-th-eval "hasfeature tcl"
+
+if {[normalize_result] ne "1"} {
+ puts "Fossil was not compiled with Tcl support."
+ test_cleanup_then_return
+}
+
+###############################################################################
+
+test_setup
+
+###############################################################################
+
+set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test.
+set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
+
+###############################################################################
+
+set data [fossil info]
+
+regexp -line -- {^repository: (.*)$} $data dummy repository
+
+if {[string length $repository] == 0 || ![file exists $repository]} {
+ error "unable to locate repository"
+}
+
+set dataFileName [file join $::testdir th1-docs-input.txt]
+set origFileStat [file join $::testdir fileStat.th1]
+
+if {![file exists $origFileStat]} {
+ error "unable to locate [$origFileStat]"
+}
+
+file copy $origFileStat fileStat.th1
+fossil add fileStat.th1
+fossil commit -m "Add fileStat.th1"
+
+###############################################################################
+
+set RESULT [test_fossil_http \
+ $repository $dataFileName /doc/trunk/fileStat.th1]
+
+test th1-docs-1a {[regexp {<title>Unnamed Fossil Project: fileStat.th1</title>} $RESULT]}
+test th1-docs-1b {[regexp {>\[[0-9a-f]{40,64}\]<} $RESULT]}
+test th1-docs-1c {[regexp { contains \d+ files\.} $RESULT]}
+
+###############################################################################
+
+test_cleanup