[go: up one dir, main page]

Menu

[f833ca]: / tests / cit-texi.el  Maximize  Restore  History

Download this file

98 lines (72 with data), 2.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
;;; cit-texi.el --- testing Texinfo support.
;; Copyright (C) 2008, 2013 Eric M. Ludlam
;; Author: Eric M. Ludlam <eric@siege-engine.com>
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.
;; 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. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;
;; Texinfo srecode/semantic testing.
;;; Code:
(defconst cit-doc-tags
(list
(semantic-tag-new-variable "cit-spiffy-var" nil
"'(1 2 3 4)")
(semantic-tag-new-function
"RegularFunction" nil
(list (semantic-tag-new-variable "arg1" "nil"))
:documentation "Some boring old function.")
)
"List of tags to insert into a texinfo document.")
(defconst cit-section-tags
(list
(semantic-tag
"@value{TITLE}" 'section
:members
(list
(semantic-tag "cit-spiffy-var" 'def)
(semantic-tag "RegularFunction" 'def)
(semantic-tag
"About Foo" 'section
:members
(list
(semantic-tag "Sub About Foo" 'section)))
(semantic-tag "Index" 'section)
))
)
"Eventual tags we expect.")
(defun cit-srecode-fill-texi ()
"Fill up a base set of files with some base tags."
(interactive)
;; 2 b) Test various templates.
;; We can't test the inserted resutls because the empty insert creates a
;; section that isn't part of cit-doc-tags, but is discovered by the validator.
(cit-srecode-fill-with-stuff-notest "src/foodoc.texi" cit-doc-tags
"NAME" "All about the FOO.")
(re-search-forward "@menu\n")
(sit-for 0)
(srecode-texi-add-menu "About Foo")
(sit-for 0)
(srecode-semantic-insert-tag (semantic-tag "" 'menu))
(sit-for 0)
(srecode-texi-add-menu "Sub About Foo")
(sit-for 0)
(save-buffer)
(cit-srecode-verify-tags (semantic-fetch-tags)
cit-section-tags)
;; 1 e) Tell EDE where the srcs are
(ede-new-target "Doc" "info" "n")
(ede-add-file "Doc")
(cit-compile-and-wait)
)
(provide 'cit-texi)
;;; cit-texi.el ends here