Commit | Line | Data |
---|---|---|
a4100ebe CY |
1 | ;;; test.el --- Unit test file for Semantic Emacs Lisp support. |
2 | ||
73b0cd50 | 3 | ;; Copyright (C) 2005-2011 Free Software Foundation, Inc. |
a4100ebe CY |
4 | |
5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> | |
6 | ||
7 | ;; This file is part of GNU Emacs. | |
8 | ||
9 | ;; GNU Emacs is free software: you can redistribute it and/or modify | |
10 | ;; it under the terms of the GNU General Public License as published by | |
11 | ;; the Free Software Foundation, either version 3 of the License, or | |
12 | ;; (at your option) any later version. | |
13 | ||
14 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;; GNU General Public License for more details. | |
18 | ||
19 | ;; You should have received a copy of the GNU General Public License | |
20 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |
74ea13c1 CY |
21 | |
22 | ;;; Require | |
23 | ;; | |
24 | (require 'semantic) | |
25 | (require 'eieio "../eieio") | |
26 | ||
27 | ;; tags encapsulated in eval-when-compile and eval-and-compile | |
28 | ;; should be expanded out into the outer environment. | |
29 | (eval-when-compile | |
30 | (require 'semantic-imenu) | |
31 | ) | |
32 | ||
33 | (eval-and-compile | |
34 | (defconst const-1 nil) | |
35 | (defun function-1 (arg) | |
36 | nil) | |
37 | ) | |
38 | ||
39 | ;;; Functions | |
40 | ;; | |
41 | (defun a-defun (arg1 arg2 &optional arg3) | |
42 | "doc a" | |
43 | nil) | |
44 | ||
45 | (defun a-defun-interactive (arg1 arg2 &optional arg3) | |
46 | "doc a that is a command" | |
47 | (interactive "R") | |
48 | nil) | |
49 | ||
50 | (defun* a-defun* (arg1 arg2 &optional arg3) | |
51 | "doc a*" | |
52 | nil) | |
53 | ||
54 | (defsubst a-defsubst (arg1 arg2 &optional arg3) | |
55 | "doc a-subst" | |
56 | nil) | |
57 | ||
58 | (defmacro a-defmacro (arg1 arg2 &optional arg3) | |
59 | "doc a-macro" | |
60 | nil) | |
61 | ||
62 | (define-overload a-overload (arg) | |
63 | "doc a-overload" | |
64 | nil) | |
65 | ||
66 | ;;; Methods | |
67 | ;; | |
68 | (defmethod a-method ((obj some-class) &optional arg2) | |
69 | "Doc String for a method." | |
70 | (call-next-method)) | |
71 | ||
72 | (defgeneric a-generic (arg1 arg2) | |
73 | "General description of a-generic.") | |
74 | ||
75 | ;;; Advice | |
76 | ;; | |
77 | (defadvice existing-function-to-advise (around test activate) | |
78 | "Do something special to this fcn." | |
79 | (ad-do-it)) | |
80 | ||
81 | ;;; Variables | |
82 | ;; | |
83 | (defvar a-defvar (cons 1 2) | |
84 | "Variable a") | |
85 | ||
86 | (defvar a-defvar-star (cons 1 2) | |
87 | "*User visible var a") | |
88 | ||
89 | (defconst a-defconst 'a "var doc const") | |
90 | ||
91 | (defcustom a-defcustom nil | |
92 | "*doc custom" | |
93 | :group 'a-defgroup | |
94 | :type 'boolean) | |
95 | ||
96 | (defface a-defface 'bold | |
97 | "A face that is bold.") | |
98 | ||
99 | (defimage ezimage-page-minus | |
100 | ((:type xpm :file "page-minus.xpm" :ascent center)) | |
101 | "Image used for open files with stuff in them.") | |
102 | ||
103 | ;;; Autoloads | |
104 | ;; | |
105 | (autoload (quote a-autoload) "somefile" | |
106 | "Non-interactive autoload." nil nil) | |
107 | ||
a4100ebe | 108 | (autoload (quote a-autoload-interactive) "somefile" |
74ea13c1 CY |
109 | "Interactive autoload." t nil) |
110 | ||
111 | ||
112 | (defgroup a-defgroup nil | |
113 | "Group for `emacs-lisp' regression-test") | |
114 | ||
115 | ;;; Classes | |
116 | ;; | |
117 | (defclass a-class (a-parent) | |
118 | ((slot-1) | |
119 | (slot-2 :initarg :slot-2) | |
120 | (slot-3 :documentation "Doc about slot3") | |
121 | (slot-4 :type 'boolean) | |
122 | ) | |
123 | "Doc String for class.") | |
124 | ||
125 | (defclass a-class-abstract () | |
126 | nil | |
127 | "Doc string for abstract class." | |
128 | :abstract t) | |
129 | ||
130 | ;;; Structures | |
131 | ;; | |
132 | (defstruct (test-struct-1 :test 'equal) | |
133 | (slot-1 :equal 'eq) | |
134 | slot-2) | |
135 | ||
a4100ebe | 136 | (defstruct test-struct-2 |
74ea13c1 CY |
137 | slot-1 |
138 | slot-2) | |
139 | ||
140 | ;;; Semantic specific macros | |
141 | ;; | |
142 | (define-lex a-lexer | |
143 | "Doc String" | |
144 | this | |
145 | that) | |
146 | ||
147 | (define-mode-local-override a-overriden-function | |
148 | emacs-lisp-mode (tag) | |
149 | "A function that is overloaded." | |
150 | nil) | |
151 | ||
152 | (defvar-mode-local emacs-lisp-mode a-mode-local-def | |
153 | "some value") | |
154 | ||
155 | ||
156 | ;;; Provide | |
157 | ;; | |
158 | (provide 'test) |