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