885
894
If nil, the inferior shell replaces the window. This is the traditional
888
(defvar erlang-mode-map nil
897
(defconst inferior-erlang-use-cmm (boundp 'minor-mode-overriding-map-alist)
898
"Non-nil means use `compilation-minor-mode' in Erlang shell.")
900
(defvar erlang-mode-map
901
(let ((map (make-sparse-keymap)))
902
(unless (boundp 'indent-line-function)
903
(define-key map "\t" 'erlang-indent-command))
904
(define-key map ";" 'erlang-electric-semicolon)
905
(define-key map "," 'erlang-electric-comma)
906
(define-key map "<" 'erlang-electric-lt)
907
(define-key map ">" 'erlang-electric-gt)
908
(define-key map "\C-m" 'erlang-electric-newline)
909
(if (not (boundp 'delete-key-deletes-forward))
910
(define-key map "\177" 'backward-delete-char-untabify)
911
(define-key map [(backspace)] 'backward-delete-char-untabify))
912
;;(unless (boundp 'fill-paragraph-function)
913
(define-key map "\M-q" 'erlang-fill-paragraph)
914
(unless (boundp 'beginning-of-defun-function)
915
(define-key map "\M-\C-a" 'erlang-beginning-of-function)
916
(define-key map "\M-\C-e" 'erlang-end-of-function)
917
(define-key map '(meta control h) 'erlang-mark-function)) ; Xemacs
918
(define-key map "\M-\t" 'erlang-complete-tag)
919
(define-key map "\C-c\M-\t" 'tempo-complete-tag)
920
(define-key map "\M-+" 'erlang-find-next-tag)
921
(define-key map "\C-c\M-a" 'erlang-beginning-of-clause)
922
(define-key map "\C-c\M-b" 'tempo-backward-mark)
923
(define-key map "\C-c\M-e" 'erlang-end-of-clause)
924
(define-key map "\C-c\M-f" 'tempo-forward-mark)
925
(define-key map "\C-c\M-h" 'erlang-mark-clause)
926
(define-key map "\C-c\C-c" 'comment-region)
927
(define-key map "\C-c\C-j" 'erlang-generate-new-clause)
928
(define-key map "\C-c\C-k" 'erlang-compile)
929
(define-key map "\C-c\C-l" 'erlang-compile-display)
930
(define-key map "\C-c\C-s" 'erlang-show-syntactic-information)
931
(define-key map "\C-c\C-q" 'erlang-indent-function)
932
(define-key map "\C-c\C-u" 'erlang-uncomment-region)
933
(define-key map "\C-c\C-y" 'erlang-clone-arguments)
934
(define-key map "\C-c\C-a" 'erlang-align-arrows)
935
(define-key map "\C-c\C-z" 'erlang-shell-display)
936
(unless inferior-erlang-use-cmm
937
(define-key map "\C-x`" 'erlang-next-error))
889
939
"*Keymap used in Erlang mode.")
890
940
(defvar erlang-mode-abbrev-table nil
891
941
"Abbrev table in use in Erlang-mode buffers.")
892
942
(defvar erlang-mode-syntax-table nil
893
943
"Syntax table in use in Erlang-mode buffers.")
895
(defconst inferior-erlang-use-cmm (boundp 'minor-mode-overriding-map-alist)
896
"Non-nil means use `compilation-minor-mode' in Erlang shell.")
947
(defvar erlang-skel-file "erlang-skels"
948
"The type of erlang-skeletons that should be used, default
949
uses edoc type, for the old type, standard comments,
950
set \"erlang-skels-old\" in your .emacs and restart.
952
Or define your own and set the variable to that file.")
898
954
;; Tempo skeleton templates:
900
(defvar erlang-tempo-tags nil
901
"Tempo tags for erlang mode")
904
'(("If" "if" erlang-skel-if)
905
("Case" "case" erlang-skel-case)
906
("Receive" "receive" erlang-skel-receive)
907
("Receive After" "after" erlang-skel-receive-after)
908
("Receive Loop" "loop" erlang-skel-receive-loop)
909
("Module" "module" erlang-skel-module)
910
("Author" "author" erlang-skel-author)
912
("Small Header" "small-header"
913
erlang-skel-small-header erlang-skel-header)
914
("Normal Header" "normal-header"
915
erlang-skel-normal-header erlang-skel-header)
916
("Large Header" "large-header"
917
erlang-skel-large-header erlang-skel-header)
919
("Small Server" "small-server"
920
erlang-skel-small-server erlang-skel-header)
922
("Application" "application"
923
erlang-skel-application erlang-skel-header)
924
("Supervisor" "supervisor"
925
erlang-skel-supervisor erlang-skel-header)
926
("supervisor_bridge" "supervisor-bridge"
927
erlang-skel-supervisor-bridge erlang-skel-header)
928
("gen_server" "generic-server"
929
erlang-skel-generic-server erlang-skel-header)
930
("gen_event" "gen-event"
931
erlang-skel-gen-event erlang-skel-header)
933
erlang-skel-gen-fsm erlang-skel-header)
934
("Library module" "gen-lib"
935
erlang-skel-lib erlang-skel-header)
936
("Corba callback" "gen-corba-cb"
937
erlang-skel-corba-callback erlang-skel-header)
938
("Small Common Test suite" "ct-test-suite-s"
939
erlang-skel-ct-test-suite-s erlang-skel-header)
940
("Large Common Test suite" "ct-test-suite-l"
941
erlang-skel-ct-test-suite-l erlang-skel-header)
942
("Erlang TS test suite" "ts-test-suite"
943
erlang-skel-ts-test-suite erlang-skel-header)
945
"*Description of all skeleton templates.
946
Both functions and menu entries will be created.
948
Each entry in `erlang-skel' should be a list with three or four
949
elements, or the empty list.
951
The first element is the name which shows up in the menu. The second
952
is the `tempo' identifier (The string \"erlang-\" will be added in
953
front of it). The third is the skeleton descriptor, a variable
954
containing `tempo' attributes as described in the function
955
`tempo-define-template'. The optional fourth elements denotes a
956
function which should be called when the menu is selected.
958
Functions corresponding to every template will be created. The name
959
of the function will be `tempo-template-erlang-X' where `X' is the
960
tempo identifier as specified in the second argument of the elements
963
A list with zero elements means that the a horizontal line should
964
be placed in the menu.")
966
;; In XEmacs `user-mail-address' returns "x@y.z (Foo Bar)" ARGH!
967
;; What's wrong with that? RFC 822 says it's legal. [sverkerw]
968
;; This needs to use the customized value. If that's not sane, things like
969
;; add-log will lose anyhow. Avoid it if there _is_ a paren.
970
(defvar erlang-skel-mail-address
971
(if (or (not user-mail-address) (string-match "(" user-mail-address))
972
(concat (user-login-name) "@"
973
(or (and (boundp 'mail-host-address)
977
"Mail address of the user.")
979
;; Expression templates:
980
(defvar erlang-skel-case
981
'((erlang-skel-skip-blank) o >
982
"case " p " of" n> p "_ ->" n> p "ok" n> "end" p)
983
"*The skeleton of a `case' expression.
984
Please see the function `tempo-define-template'.")
986
(defvar erlang-skel-if
987
'((erlang-skel-skip-blank) o >
988
"if" n> p " ->" n> p "ok" n> "end" p)
989
"The skeleton of an `if' expression.
990
Please see the function `tempo-define-template'.")
992
(defvar erlang-skel-receive
993
'((erlang-skel-skip-blank) o >
994
"receive" n> p "_ ->" n> p "ok" n> "end" p)
995
"*The skeleton of a `receive' expression.
996
Please see the function `tempo-define-template'.")
998
(defvar erlang-skel-receive-after
999
'((erlang-skel-skip-blank) o >
1000
"receive" n> p "_ ->" n> p "ok" n> "after " p "T ->" n>
1002
"*The skeleton of a `receive' expression with an `after' clause.
1003
Please see the function `tempo-define-template'.")
1005
(defvar erlang-skel-receive-loop
1006
'(& o "loop(" p ") ->" n> "receive" n> p "_ ->" n>
1007
"loop(" p ")" n> "end.")
1008
"*The skeleton of a simple `receive' loop.
1009
Please see the function `tempo-define-template'.")
1012
;; Attribute templates
1014
(defvar erlang-skel-module
1016
(erlang-add-quotes-if-needed (erlang-get-module-from-file-name))
1018
"*The skeleton of a `module' attribute.
1019
Please see the function `tempo-define-template'.")
1021
(defvar erlang-skel-author
1022
'(& "-author('" erlang-skel-mail-address "')." n)
1023
"*The skeleton of a `author' attribute.
1024
Please see the function `tempo-define-template'.")
1026
(defvar erlang-skel-vc nil
1027
"*The skeleton template to generate a version control attribute.
1028
The default is to insert nothing. Example of usage:
1030
(setq erlang-skel-vc '(& \"-rcs(\\\"$\Id: $ \\\").\") n)
1032
Please see the function `tempo-define-template'.")
1034
(defvar erlang-skel-export
1035
'(& "-export([" n> "])." n)
1036
"*The skeleton of an `export' attribute.
1037
Please see the function `tempo-define-template'.")
1039
(defvar erlang-skel-import
1040
'(& "%%-import(Module, [Function/Arity, ...])." n)
1041
"*The skeleton of an `import' attribute.
1042
Please see the function `tempo-define-template'.")
1044
(defvar erlang-skel-compile nil
1045
;; '(& "%%-compile(export_all)." n)
1046
"*The skeleton of a `compile' attribute.
1047
Please see the function `tempo-define-template'.")
1050
;; Comment templates.
1052
(defvar erlang-skel-date-function 'erlang-skel-dd-mmm-yyyy
1053
"*Function which returns date string.
1054
Look in the module `time-stamp' for a battery of functions.")
1056
(defvar erlang-skel-copyright-comment '()
1057
"*The template for a copyright line in the header, normally empty.
1058
This variable should be bound to a `tempo' template, for example:
1059
'(& \"%%% Copyright (C) 2000, Yoyodyne, Inc.\" n)
1061
Please see the function `tempo-define-template'.")
1063
(defvar erlang-skel-created-comment
1064
'(& "%%% Created : " (funcall erlang-skel-date-function) " by "
1065
(user-full-name) " <" erlang-skel-mail-address ">" n)
1066
"*The template for the \"Created:\" comment line.")
1068
(defvar erlang-skel-author-comment
1069
'(& "%%% Author : " (user-full-name) " <" erlang-skel-mail-address ">" n)
1070
"*The template for creating the \"Author:\" line in the header.
1071
Please see the function `tempo-define-template'.")
1073
(defvar erlang-skel-file-comment
1074
'(& "%%% File : " (file-name-nondirectory buffer-file-name) n)
1075
"*The template for creating the \"Module:\" line in the header.
1076
Please see the function `tempo-define-template'.")
1078
(defvar erlang-skel-small-header
1079
'(o (erlang-skel-include erlang-skel-module)
1080
;; erlang-skel-author)
1082
(erlang-skel-include erlang-skel-compile
1083
;; erlang-skel-export
1085
"*The template of a small header without any comments.
1086
Please see the function `tempo-define-template'.")
1088
(defvar erlang-skel-normal-header
1089
'(o (erlang-skel-include erlang-skel-copyright-comment
1090
erlang-skel-file-comment
1091
erlang-skel-author-comment)
1092
"%%% Description : " p n
1093
(erlang-skel-include erlang-skel-created-comment) n
1094
(erlang-skel-include erlang-skel-small-header) n)
1095
"*The template of a normal header.
1096
Please see the function `tempo-define-template'.")
1098
(defvar erlang-skel-large-header
1099
'(o (erlang-skel-separator)
1100
(erlang-skel-include erlang-skel-copyright-comment
1101
erlang-skel-file-comment
1102
erlang-skel-author-comment)
1103
"%%% Description : " p n
1105
(erlang-skel-include erlang-skel-created-comment)
1106
(erlang-skel-separator)
1107
(erlang-skel-include erlang-skel-small-header) )
1108
"*The template of a large header.
1109
Please see the function `tempo-define-template'.")
1112
;; Server templates.
1114
(defvar erlang-skel-small-server
1115
'((erlang-skel-include erlang-skel-large-header)
1116
"-export([start/0,init/1])." n n n
1117
"start() ->" n> "spawn(" (erlang-get-module-from-file-name)
1118
", init, [self()])." n n
1127
"*Template of a small server.
1128
Please see the function `tempo-define-template'.")
1130
;; Behaviour templates.
1132
(defvar erlang-skel-application
1133
'((erlang-skel-include erlang-skel-large-header)
1134
"-behaviour(application)." n n
1135
"%% Application callbacks" n
1136
"-export([start/2, stop/1])." n n
1137
(erlang-skel-double-separator 2)
1138
"%% Application callbacks" n
1139
(erlang-skel-double-separator 2)
1140
(erlang-skel-separator 2)
1141
"%% Function: start(Type, StartArgs) -> {ok, Pid} |" n
1142
"%% {ok, Pid, State} |" n
1143
"%% {error, Reason}" n
1144
"%% Description: This function is called whenever an application " n
1145
"%% is started using application:start/1,2, and should start the processes" n
1146
"%% of the application. If the application is structured according to the" n
1147
"%% OTP design principles as a supervision tree, this means starting the" n
1148
"%% top supervisor of the tree." n
1149
(erlang-skel-separator 2)
1150
"start(_Type, StartArgs) ->" n>
1151
"case 'TopSupervisor':start_link(StartArgs) of" n>
1158
(erlang-skel-separator 2)
1159
"%% Function: stop(State) -> void()" n
1160
"%% Description: This function is called whenever an application" n
1161
"%% has stopped. It is intended to be the opposite of Module:start/2 and" n
1162
"%% should do any necessary cleaning up. The return value is ignored. "n
1163
(erlang-skel-separator 2)
1164
"stop(_State) ->" n>
1167
(erlang-skel-double-separator 2)
1168
"%% Internal functions" n
1169
(erlang-skel-double-separator 2)
1171
"*The template of an application behaviour.
1172
Please see the function `tempo-define-template'.")
1174
(defvar erlang-skel-supervisor
1175
'((erlang-skel-include erlang-skel-large-header)
1176
"-behaviour(supervisor)." n n
1179
"-export([start_link/0])." n n
1181
"%% Supervisor callbacks" n
1182
"-export([init/1])." n n
1184
"-define(SERVER, ?MODULE)." n n
1186
(erlang-skel-double-separator 2)
1187
"%% API functions" n
1188
(erlang-skel-double-separator 2)
1189
(erlang-skel-separator 2)
1190
"%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}" n
1191
"%% Description: Starts the supervisor" n
1192
(erlang-skel-separator 2)
1193
"start_link() ->" n>
1194
"supervisor:start_link({local, ?SERVER}, ?MODULE, [])." n
1196
(erlang-skel-double-separator 2)
1197
"%% Supervisor callbacks" n
1198
(erlang-skel-double-separator 2)
1199
(erlang-skel-separator 2)
1200
"%% Func: init(Args) -> {ok, {SupFlags, [ChildSpec]}} |" n
1202
"%% {error, Reason}" n
1203
"%% Description: Whenever a supervisor is started using "n
1204
"%% supervisor:start_link/[2,3], this function is called by the new process "n
1205
"%% to find out about restart strategy, maximum restart frequency and child "n
1206
"%% specifications." n
1207
(erlang-skel-separator 2)
1209
"AChild = {'AName',{'AModule',start_link,[]}," n>
1210
"permanent,2000,worker,['AModule']}," n>
1211
"{ok,{{one_for_all,0,1}, [AChild]}}." n
1213
(erlang-skel-double-separator 2)
1214
"%% Internal functions" n
1215
(erlang-skel-double-separator 2)
1217
"*The template of an supervisor behaviour.
1218
Please see the function `tempo-define-template'.")
1220
(defvar erlang-skel-supervisor-bridge
1221
'((erlang-skel-include erlang-skel-large-header)
1222
"-behaviour(supervisor_bridge)." n n
1225
"-export([start_link/0])." n n
1227
"%% supervisor_bridge callbacks" n
1228
"-export([init/1, terminate/2])." n n
1230
"-define(SERVER, ?MODULE)." n n
1232
"-record(state, {})." n n
1234
(erlang-skel-double-separator 2)
1236
(erlang-skel-double-separator 2)
1237
(erlang-skel-separator 2)
1238
"%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}" n
1239
"%% Description: Starts the supervisor bridge" n
1240
(erlang-skel-separator 2)
1241
"start_link() ->" n>
1242
"supervisor_bridge:start_link({local, ?SERVER}, ?MODULE, [])." n
1244
(erlang-skel-double-separator 2)
1245
"%% supervisor_bridge callbacks" n
1246
(erlang-skel-double-separator 2)
1247
(erlang-skel-separator 2)
1248
"%% Funcion: init(Args) -> {ok, Pid, State} |" n
1250
"%% {error, Reason} " n
1251
"%% Description:Creates a supervisor_bridge process, linked to the calling" n
1252
"%% process, which calls Module:init/1 to start the subsystem. To ensure a" n
1253
"%% synchronized start-up procedure, this function does not return until" n
1254
"%% Module:init/1 has returned. " n
1255
(erlang-skel-separator 2)
1257
"case 'AModule':start_link() of" n>
1259
"{ok, Pid, #state{}};" n>
1264
(erlang-skel-separator 2)
1265
"%% Func: terminate(Reason, State) -> void()" n
1266
"%% Description:This function is called by the supervisor_bridge when it is"n
1267
"%% about to terminate. It should be the opposite of Module:init/1 and stop"n
1268
"%% the subsystem and do any necessary cleaning up.The return value is ignored."
1269
(erlang-skel-separator 2)
1270
"terminate(Reason, State) ->" n>
1271
"'AModule':stop()," n>
1274
(erlang-skel-double-separator 2)
1275
"%% Internal functions" n
1276
(erlang-skel-double-separator 2)
1278
"*The template of an supervisor_bridge behaviour.
1279
Please see the function `tempo-define-template'.")
1281
(defvar erlang-skel-generic-server
1282
'((erlang-skel-include erlang-skel-large-header)
1283
"-behaviour(gen_server)." n n
1286
"-export([start_link/0])." n n
1288
"%% gen_server callbacks" n
1289
"-export([init/1, handle_call/3, handle_cast/2, "
1291
"terminate/2, code_change/3])." n n
1293
"-record(state, {})." n n
1295
(erlang-skel-double-separator 2)
1297
(erlang-skel-double-separator 2)
1298
(erlang-skel-separator 2)
1299
"%% Function: start_link() -> {ok,Pid} | ignore | {error,Error}" n
1300
"%% Description: Starts the server" n
1301
(erlang-skel-separator 2)
1302
"start_link() ->" n>
1303
"gen_server:start_link({local, ?SERVER}, ?MODULE, [], [])." n
1305
(erlang-skel-double-separator 2)
1306
"%% gen_server callbacks" n
1307
(erlang-skel-double-separator 2)
1309
(erlang-skel-separator 2)
1310
"%% Function: init(Args) -> {ok, State} |" n
1311
"%% {ok, State, Timeout} |" n
1313
"%% {stop, Reason}" n
1314
"%% Description: Initiates the server" n
1315
(erlang-skel-separator 2)
1319
(erlang-skel-separator 2)
1321
"%% handle_call(Request, From, State) -> {reply, Reply, State} |" n
1322
"%% {reply, Reply, State, Timeout} |" n
1323
"%% {noreply, State} |" n
1324
"%% {noreply, State, Timeout} |" n
1325
"%% {stop, Reason, Reply, State} |" n
1326
"%% {stop, Reason, State}" n
1327
"%% Description: Handling call messages" n
1328
(erlang-skel-separator 2)
1329
"handle_call(_Request, _From, State) ->" n>
1331
"{reply, Reply, State}." n
1333
(erlang-skel-separator 2)
1334
"%% Function: handle_cast(Msg, State) -> {noreply, State} |" n
1335
"%% {noreply, State, Timeout} |" n
1336
"%% {stop, Reason, State}" n
1337
"%% Description: Handling cast messages" n
1339
(erlang-skel-separator 2)
1340
"handle_cast(_Msg, State) ->" n>
1341
"{noreply, State}." n
1343
(erlang-skel-separator 2)
1344
"%% Function: handle_info(Info, State) -> {noreply, State} |" n
1345
"%% {noreply, State, Timeout} |" n
1346
"%% {stop, Reason, State}" n
1347
"%% Description: Handling all non call/cast messages" n
1348
(erlang-skel-separator 2)
1349
"handle_info(_Info, State) ->" n>
1350
"{noreply, State}." n
1352
(erlang-skel-separator 2)
1353
"%% Function: terminate(Reason, State) -> void()" n
1354
"%% Description: This function is called by a gen_server when it is about to"n
1355
"%% terminate. It should be the opposite of Module:init/1 and do any necessary"n
1356
"%% cleaning up. When it returns, the gen_server terminates with Reason." n
1357
"%% The return value is ignored." n
1359
(erlang-skel-separator 2)
1360
"terminate(_Reason, _State) ->" n>
1363
(erlang-skel-separator 2)
1364
"%% Func: code_change(OldVsn, State, Extra) -> {ok, NewState}" n
1365
"%% Description: Convert process state when code is changed" n
1366
(erlang-skel-separator 2)
1367
"code_change(_OldVsn, State, _Extra) ->" n>
1370
(erlang-skel-separator 2)
1371
"%%% Internal functions" n
1372
(erlang-skel-separator 2)
1374
"*The template of a generic server.
1375
Please see the function `tempo-define-template'.")
1377
(defvar erlang-skel-gen-event
1378
'((erlang-skel-include erlang-skel-large-header)
1379
"-behaviour(gen_event)." n
1382
"-export([start_link/0, add_handler/0])." n n
1384
"%% gen_event callbacks" n
1385
"-export([init/1, handle_event/2, handle_call/2, " n>
1386
"handle_info/2, terminate/2, code_change/3])." n n
1388
"-record(state, {})." n n
1390
(erlang-skel-double-separator 2)
1391
"%% gen_event callbacks" n
1392
(erlang-skel-double-separator 2)
1393
(erlang-skel-separator 2)
1394
"%% Function: start_link() -> {ok,Pid} | {error,Error} " n
1395
"%% Description: Creates an event manager." n
1396
(erlang-skel-separator 2)
1397
"start_link() ->" n>
1398
"gen_event:start_link({local, ?SERVER}). " n
1400
(erlang-skel-separator 2)
1401
"%% Function: add_handler() -> ok | {'EXIT',Reason} | term()" n
1402
"%% Description: Adds an event handler" n
1403
(erlang-skel-separator 2)
1404
"add_handler() ->" n>
1405
"gen_event:add_handler(?SERVER, ?MODULE, [])." n
1407
(erlang-skel-double-separator 2)
1408
"%% gen_event callbacks" n
1409
(erlang-skel-double-separator 2)
1410
(erlang-skel-separator 2)
1411
"%% Function: init(Args) -> {ok, State}" n
1412
"%% Description: Whenever a new event handler is added to an event manager,"n
1413
"%% this function is called to initialize the event handler." n
1414
(erlang-skel-separator 2)
1418
(erlang-skel-separator 2)
1420
"%% handle_event(Event, State) -> {ok, State} |" n
1421
"%% {swap_handler, Args1, State1, Mod2, Args2} |"n
1422
"%% remove_handler" n
1423
"%% Description:Whenever an event manager receives an event sent using"n
1424
"%% gen_event:notify/2 or gen_event:sync_notify/2, this function is called for"n
1425
"%% each installed event handler to handle the event. "n
1426
(erlang-skel-separator 2)
1427
"handle_event(_Event, State) ->" n>
1430
(erlang-skel-separator 2)
1432
"%% handle_call(Request, State) -> {ok, Reply, State} |" n
1433
"%% {swap_handler, Reply, Args1, State1, "n
1434
"%% Mod2, Args2} |" n
1435
"%% {remove_handler, Reply}" n
1436
"%% Description: Whenever an event manager receives a request sent using"n
1437
"%% gen_event:call/3,4, this function is called for the specified event "n
1438
"%% handler to handle the request."n
1439
(erlang-skel-separator 2)
1440
"handle_call(_Request, State) ->" n>
1442
"{ok, Reply, State}." n
1444
(erlang-skel-separator 2)
1446
"%% handle_info(Info, State) -> {ok, State} |" n
1447
"%% {swap_handler, Args1, State1, Mod2, Args2} |" n
1448
"%% remove_handler" n
1449
"%% Description: This function is called for each installed event handler when"n
1450
"%% an event manager receives any other message than an event or a synchronous"n
1451
"%% request (or a system message)."n
1452
(erlang-skel-separator 2)
1453
"handle_info(_Info, State) ->" n>
1456
(erlang-skel-separator 2)
1457
"%% Function: terminate(Reason, State) -> void()" n
1458
"%% Description:Whenever an event handler is deleted from an event manager,"n
1459
"%% this function is called. It should be the opposite of Module:init/1 and "n
1460
"%% do any necessary cleaning up. " n
1461
(erlang-skel-separator 2)
1462
"terminate(_Reason, _State) ->" n>
1465
(erlang-skel-separator 2)
1466
"%% Function: code_change(OldVsn, State, Extra) -> {ok, NewState} " n
1467
"%% Description: Convert process state when code is changed" n
1468
(erlang-skel-separator 2)
1469
"code_change(_OldVsn, State, _Extra) ->" n>
1472
(erlang-skel-separator 2)
1473
"%%% Internal functions" n
1474
(erlang-skel-separator 2)
1476
"*The template of a gen_event.
1477
Please see the function `tempo-define-template'.")
1479
(defvar erlang-skel-gen-fsm
1480
'((erlang-skel-include erlang-skel-large-header)
1481
"-behaviour(gen_fsm)." n n
1484
"-export([start_link/0])." n n
1486
"%% gen_fsm callbacks" n
1487
"-export([init/1, state_name/2, state_name/3, handle_event/3," n>
1488
"handle_sync_event/4, handle_info/3, terminate/3, code_change/4])." n n
1490
"-record(state, {})." n n
1492
(erlang-skel-double-separator 2)
1494
(erlang-skel-double-separator 2)
1495
(erlang-skel-separator 2)
1496
"%% Function: start_link() -> ok,Pid} | ignore | {error,Error}" n
1497
"%% Description:Creates a gen_fsm process which calls Module:init/1 to"n
1498
"%% initialize. To ensure a synchronized start-up procedure, this function" n
1499
"%% does not return until Module:init/1 has returned. " n
1500
(erlang-skel-separator 2)
1501
"start_link() ->" n>
1502
"gen_fsm:start_link({local, ?SERVER}, ?MODULE, [], [])." n
1504
(erlang-skel-double-separator 2)
1505
"%% gen_fsm callbacks" n
1506
(erlang-skel-double-separator 2)
1507
(erlang-skel-separator 2)
1508
"%% Function: init(Args) -> {ok, StateName, State} |" n
1509
"%% {ok, StateName, State, Timeout} |" n
1511
"%% {stop, StopReason} " n
1512
"%% Description:Whenever a gen_fsm is started using gen_fsm:start/[3,4] or"n
1513
"%% gen_fsm:start_link/3,4, this function is called by the new process to "n
1515
(erlang-skel-separator 2)
1517
"{ok, state_name, #state{}}." n
1519
(erlang-skel-separator 2)
1521
"%% state_name(Event, State) -> {next_state, NextStateName, NextState}|" n
1522
"%% {next_state, NextStateName, " n
1523
"%% NextState, Timeout} |" n
1524
"%% {stop, Reason, NewState}" n
1525
"%% Description:There should be one instance of this function for each possible"n
1526
"%% state name. Whenever a gen_fsm receives an event sent using" n
1527
"%% gen_fsm:send_event/2, the instance of this function with the same name as"n
1528
"%% the current state name StateName is called to handle the event. It is also "n
1529
"%% called if a timeout occurs. " n
1530
(erlang-skel-separator 2)
1531
"state_name(_Event, State) ->" n>
1532
"{next_state, state_name, State}." n
1534
(erlang-skel-separator 2)
1536
"%% state_name(Event, From, State) -> {next_state, NextStateName, NextState} |"n
1537
"%% {next_state, NextStateName, " n
1538
"%% NextState, Timeout} |" n
1539
"%% {reply, Reply, NextStateName, NextState}|"n
1540
"%% {reply, Reply, NextStateName, " n
1541
"%% NextState, Timeout} |" n
1542
"%% {stop, Reason, NewState}|" n
1543
"%% {stop, Reason, Reply, NewState}" n
1544
"%% Description: There should be one instance of this function for each" n
1545
"%% possible state name. Whenever a gen_fsm receives an event sent using" n
1546
"%% gen_fsm:sync_send_event/2,3, the instance of this function with the same"n
1547
"%% name as the current state name StateName is called to handle the event." n
1548
(erlang-skel-separator 2)
1549
"state_name(_Event, _From, State) ->" n>
1551
"{reply, Reply, state_name, State}." n
1553
(erlang-skel-separator 2)
1555
"%% handle_event(Event, StateName, State) -> {next_state, NextStateName, "n
1557
"%% {next_state, NextStateName, "n
1558
"%% NextState, Timeout} |" n
1559
"%% {stop, Reason, NewState}" n
1560
"%% Description: Whenever a gen_fsm receives an event sent using"n
1561
"%% gen_fsm:send_all_state_event/2, this function is called to handle"n
1563
(erlang-skel-separator 2)
1564
"handle_event(_Event, StateName, State) ->" n>
1565
"{next_state, StateName, State}." n
1567
(erlang-skel-separator 2)
1569
"%% handle_sync_event(Event, From, StateName, "n
1570
"%% State) -> {next_state, NextStateName, NextState} |" n
1571
"%% {next_state, NextStateName, NextState, " n
1573
"%% {reply, Reply, NextStateName, NextState}|" n
1574
"%% {reply, Reply, NextStateName, NextState, " n
1576
"%% {stop, Reason, NewState} |" n
1577
"%% {stop, Reason, Reply, NewState}" n
1578
"%% Description: Whenever a gen_fsm receives an event sent using"n
1579
"%% gen_fsm:sync_send_all_state_event/2,3, this function is called to handle"n
1581
(erlang-skel-separator 2)
1582
"handle_sync_event(Event, From, StateName, State) ->" n>
1584
"{reply, Reply, StateName, State}." n
1586
(erlang-skel-separator 2)
1588
"%% handle_info(Info,StateName,State)-> {next_state, NextStateName, NextState}|" n
1589
"%% {next_state, NextStateName, NextState, "n
1591
"%% {stop, Reason, NewState}" n
1592
"%% Description: This function is called by a gen_fsm when it receives any"n
1593
"%% other message than a synchronous or asynchronous event"n
1594
"%% (or a system message)." n
1595
(erlang-skel-separator 2)
1596
"handle_info(_Info, StateName, State) ->" n>
1597
"{next_state, StateName, State}." n
1599
(erlang-skel-separator 2)
1600
"%% Function: terminate(Reason, StateName, State) -> void()" n
1601
"%% Description:This function is called by a gen_fsm when it is about"n
1602
"%% to terminate. It should be the opposite of Module:init/1 and do any"n
1603
"%% necessary cleaning up. When it returns, the gen_fsm terminates with"n
1604
"%% Reason. The return value is ignored." n
1605
(erlang-skel-separator 2)
1606
"terminate(_Reason, _StateName, _State) ->" n>
1609
(erlang-skel-separator 2)
1611
"%% code_change(OldVsn, StateName, State, Extra) -> {ok, StateName, NewState}" n
1612
"%% Description: Convert process state when code is changed" n
1613
(erlang-skel-separator 2)
1614
"code_change(_OldVsn, StateName, State, _Extra) ->" n>
1615
"{ok, StateName, State}." n
1617
(erlang-skel-separator 2)
1618
"%%% Internal functions" n
1619
(erlang-skel-separator 2)
1621
"*The template of a gen_fsm.
1622
Please see the function `tempo-define-template'.")
1624
(defvar erlang-skel-lib
1625
'((erlang-skel-include erlang-skel-large-header)
1630
(erlang-skel-double-separator 2)
1632
(erlang-skel-double-separator 2)
1633
(erlang-skel-separator 2)
1636
(erlang-skel-separator 2)
1638
(erlang-skel-double-separator 2)
1639
"%% Internal functions" n
1640
(erlang-skel-double-separator 2)
1642
"*The template of a library module.
1643
Please see the function `tempo-define-template'.")
1645
(defvar erlang-skel-corba-callback
1646
'((erlang-skel-include erlang-skel-large-header)
1647
"%% Include files" n n
1652
"%% Corba callbacks" n
1653
"-export([init/1, terminate/2, code_change/3])." n n
1655
"-record(state, {})." n n
1657
(erlang-skel-double-separator 2)
1658
"%% Corba callbacks" n
1659
(erlang-skel-double-separator 2)
1660
(erlang-skel-separator 2)
1661
"%% Function: init(Args) -> {ok, State} |" n
1662
"%% {ok, State, Timeout} |" n
1664
"%% {stop, Reason}" n
1665
"%% Description: Initiates the server" n
1666
(erlang-skel-separator 2)
1670
(erlang-skel-separator 2)
1671
"%% Function: terminate(Reason, State) -> void()" n
1672
"%% Description: Shutdown the server" n
1673
(erlang-skel-separator 2)
1674
"terminate(_Reason, _State) ->" n>
1677
(erlang-skel-separator 2)
1678
"%% Function: code_change(OldVsn, State, Extra) -> {ok, NewState} " n
1679
"%% Description: Convert process state when code is changed" n
1680
(erlang-skel-separator 2)
1681
"code_change(_OldVsn, State, _Extra) ->" n>
1684
(erlang-skel-double-separator 2)
1685
"%% Internal functions" n
1686
(erlang-skel-double-separator 2)
1688
"*The template of a library module.
1689
Please see the function `tempo-define-template'.")
1691
(defvar erlang-skel-ts-test-suite
1692
'((erlang-skel-include erlang-skel-large-header)
1693
"%% Note: This directive should only be used in test suites." n
1694
"-compile(export_all)." n n
1696
"-include(\"test_server.hrl\")." n n
1698
(erlang-skel-separator 2)
1699
"%% TEST SERVER CALLBACK FUNCTIONS" n
1700
(erlang-skel-separator 2)
1702
(erlang-skel-separator 2)
1703
"%% Function: init_per_suite(Config0) -> Config1 | {skip,Reason}" n
1705
"%% Config0 = Config1 = [tuple()]" n
1706
"%% A list of key/value pairs, holding the test case configuration." n
1707
"%% Reason = term()" n
1708
"%% The reason for skipping the suite." n
1710
"%% Description: Initialization before the suite." n
1712
"%% Note: This function is free to add any key/value pairs to the Config" n
1713
"%% variable, but should NOT alter/remove any existing entries." n
1714
(erlang-skel-separator 2)
1715
"init_per_suite(Config) ->" n >
1718
(erlang-skel-separator 2)
1719
"%% Function: end_per_suite(Config) -> void()" n
1721
"%% Config = [tuple()]" n
1722
"%% A list of key/value pairs, holding the test case configuration." n
1724
"%% Description: Cleanup after the suite." n
1725
(erlang-skel-separator 2)
1726
"end_per_suite(_Config) ->" n >
1729
(erlang-skel-separator 2)
1730
"%% Function: init_per_testcase(TestCase, Config0) -> Config1 |" n
1731
"%% {skip,Reason}" n
1732
"%% TestCase = atom()" n
1733
"%% Name of the test case that is about to run." n
1734
"%% Config0 = Config1 = [tuple()]" n
1735
"%% A list of key/value pairs, holding the test case configuration." n
1736
"%% Reason = term()" n
1737
"%% The reason for skipping the test case." n
1739
"%% Description: Initialization before each test case." n
1741
"%% Note: This function is free to add any key/value pairs to the Config" n
1742
"%% variable, but should NOT alter/remove any existing entries." n
1743
(erlang-skel-separator 2)
1744
"init_per_testcase(_TestCase, Config) ->" n >
1747
(erlang-skel-separator 2)
1748
"%% Function: end_per_testcase(TestCase, Config) -> void()" n
1750
"%% TestCase = atom()" n
1751
"%% Name of the test case that is finished." n
1752
"%% Config = [tuple()]" n
1753
"%% A list of key/value pairs, holding the test case configuration." n
1755
"%% Description: Cleanup after each test case." n
1756
(erlang-skel-separator 2)
1757
"end_per_testcase(_TestCase, _Config) ->" n >
1760
(erlang-skel-separator 2)
1761
"%% Function: all(Clause) -> Descr | Spec | {skip,Reason}" n
1763
"%% Clause = doc | suite" n
1764
"%% Indicates expected return value." n
1765
"%% Descr = [string()] | []" n
1766
"%% String that describes the test suite." n
1767
"%% Spec = [TestCase]" n
1768
"%% A test specification." n
1769
"%% TestCase = ConfCase | atom()" n
1770
"%% Configuration case, or the name of a test case function." n
1771
"%% ConfCase = {conf,Init,Spec,End} |" n
1772
"%% {conf,Properties,Init,Spec,End}" n
1773
"%% Init = End = {Mod,Func} | Func" n
1774
"%% Initialization and cleanup function." n
1775
"%% Mod = Func = atom()" n
1776
"%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]" n
1777
"%% Execution properties of the test cases (may be combined)." n
1778
"%% Shuffle = shuffle | {shuffle,Seed}" n
1779
"%% To get cases executed in random order." n
1780
"%% Seed = {integer(),integer(),integer()}" n
1781
"%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |" n
1782
"%% repeat_until_any_ok | repeat_until_any_fail" n
1783
"%% To get execution of cases repeated." n
1784
"%% N = integer() | forever" n
1785
"%% Reason = term()" n
1786
"%% The reason for skipping the test suite." n
1788
"%% Description: Returns a description of the test suite when" n
1789
"%% Clause == doc, and a test specification (list" n
1790
"%% of the conf and test cases in the suite) when" n
1791
"%% Clause == suite." n
1792
(erlang-skel-separator 2)
1794
"[\"Describe the main purpose of this suite\"];" n n
1795
"all(suite) -> " n >
1796
"[a_test_case]." n n
1798
(erlang-skel-separator 2)
1800
(erlang-skel-separator 2)
1802
(erlang-skel-separator 2)
1803
"%% Function: TestCase(Arg) -> Descr | Spec | ok | exit() | {skip,Reason}" n
1805
"%% Arg = doc | suite | Config" n
1806
"%% Indicates expected behaviour and return value." n
1807
"%% Config = [tuple()]" n
1808
"%% A list of key/value pairs, holding the test case configuration." n
1809
"%% Descr = [string()] | []" n
1810
"%% String that describes the test case." n
1811
"%% Spec = [tuple()] | []" n
1812
"%% A test specification, see all/1." n
1813
"%% Reason = term()" n
1814
"%% The reason for skipping the test case." n
1816
"%% Description: Test case function. Returns a description of the test" n
1817
"%% case (doc), then returns a test specification (suite)," n
1818
"%% or performs the actual test (Config)." n
1819
(erlang-skel-separator 2)
1820
"a_test_case(doc) -> " n >
1821
"[\"Describe the main purpose of this test case\"];" n n
1822
"a_test_case(suite) -> " n >
1824
"a_test_case(Config) when is_list(Config) -> " n >
1827
"*The template of a library module.
1828
Please see the function `tempo-define-template'.")
1830
(defvar erlang-skel-ct-test-suite-l
1831
'((erlang-skel-include erlang-skel-large-header)
1832
"%% Note: This directive should only be used in test suites." n
1833
"-compile(export_all)." n n
1835
"-include(\"ct.hrl\")." n n
1837
(erlang-skel-separator 2)
1838
"%% COMMON TEST CALLBACK FUNCTIONS" n
1839
(erlang-skel-separator 2)
1841
(erlang-skel-separator 2)
1842
"%% Function: suite() -> Info" n
1844
"%% Info = [tuple()]" n
1845
"%% List of key/value pairs." n
1847
"%% Description: Returns list of tuples to set default properties" n
1848
"%% for the suite." n
1850
"%% Note: The suite/0 function is only meant to be used to return" n
1851
"%% default data values, not perform any other operations." n
1852
(erlang-skel-separator 2)
1854
"[{timetrap,{minutes,10}}]." n n
1856
(erlang-skel-separator 2)
1857
"%% Function: init_per_suite(Config0) ->" n
1858
"%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
1860
"%% Config0 = Config1 = [tuple()]" n
1861
"%% A list of key/value pairs, holding the test case configuration." n
1862
"%% Reason = term()" n
1863
"%% The reason for skipping the suite." n
1865
"%% Description: Initialization before the suite." n
1867
"%% Note: This function is free to add any key/value pairs to the Config" n
1868
"%% variable, but should NOT alter/remove any existing entries." n
1869
(erlang-skel-separator 2)
1870
"init_per_suite(Config) ->" n >
1873
(erlang-skel-separator 2)
1874
"%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}" n
1876
"%% Config0 = Config1 = [tuple()]" n
1877
"%% A list of key/value pairs, holding the test case configuration." n
1879
"%% Description: Cleanup after the suite." n
1880
(erlang-skel-separator 2)
1881
"end_per_suite(_Config) ->" n >
1884
(erlang-skel-separator 2)
1885
"%% Function: init_per_group(GroupName, Config0) ->" n
1886
"%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
1888
"%% GroupName = atom()" n
1889
"%% Name of the test case group that is about to run." n
1890
"%% Config0 = Config1 = [tuple()]" n
1891
"%% A list of key/value pairs, holding configuration data for the group." n
1892
"%% Reason = term()" n
1893
"%% The reason for skipping all test cases and subgroups in the group." n
1895
"%% Description: Initialization before each test case group." n
1896
(erlang-skel-separator 2)
1897
"init_per_group(_GroupName, Config) ->" n >
1900
(erlang-skel-separator 2)
1901
"%% Function: end_per_group(GroupName, Config0) ->" n
1902
"%% void() | {save_config,Config1}" n
1904
"%% GroupName = atom()" n
1905
"%% Name of the test case group that is finished." n
1906
"%% Config0 = Config1 = [tuple()]" n
1907
"%% A list of key/value pairs, holding configuration data for the group." n
1909
"%% Description: Cleanup after each test case group." n
1910
(erlang-skel-separator 2)
1911
"end_per_group(_GroupName, _Config) ->" n >
1914
(erlang-skel-separator 2)
1915
"%% Function: init_per_testcase(TestCase, Config0) ->" n
1916
"%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
1918
"%% TestCase = atom()" n
1919
"%% Name of the test case that is about to run." n
1920
"%% Config0 = Config1 = [tuple()]" n
1921
"%% A list of key/value pairs, holding the test case configuration." n
1922
"%% Reason = term()" n
1923
"%% The reason for skipping the test case." n
1925
"%% Description: Initialization before each test case." n
1927
"%% Note: This function is free to add any key/value pairs to the Config" n
1928
"%% variable, but should NOT alter/remove any existing entries." n
1929
(erlang-skel-separator 2)
1930
"init_per_testcase(_TestCase, Config) ->" n >
1933
(erlang-skel-separator 2)
1934
"%% Function: end_per_testcase(TestCase, Config0) ->" n
1935
"%% void() | {save_config,Config1} | {fail,Reason}" n
1937
"%% TestCase = atom()" n
1938
"%% Name of the test case that is finished." n
1939
"%% Config0 = Config1 = [tuple()]" n
1940
"%% A list of key/value pairs, holding the test case configuration." n
1941
"%% Reason = term()" n
1942
"%% The reason for failing the test case." n
1944
"%% Description: Cleanup after each test case." n
1945
(erlang-skel-separator 2)
1946
"end_per_testcase(_TestCase, _Config) ->" n >
1949
(erlang-skel-separator 2)
1950
"%% Function: groups() -> [Group]" n
1952
"%% Group = {GroupName,Properties,GroupsAndTestCases}" n
1953
"%% GroupName = atom()" n
1954
"%% The name of the group." n
1955
"%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]" n
1956
"%% Group properties that may be combined." n
1957
"%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]" n
1958
"%% TestCase = atom()" n
1959
"%% The name of a test case." n
1960
"%% Shuffle = shuffle | {shuffle,Seed}" n
1961
"%% To get cases executed in random order." n
1962
"%% Seed = {integer(),integer(),integer()}" n
1963
"%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |" n
1964
"%% repeat_until_any_ok | repeat_until_any_fail" n
1965
"%% To get execution of cases repeated." n
1966
"%% N = integer() | forever" n
1968
"%% Description: Returns a list of test case group definitions." n
1969
(erlang-skel-separator 2)
1973
(erlang-skel-separator 2)
1974
"%% Function: all() -> GroupsAndTestCases | {skip,Reason}" n
1976
"%% GroupsAndTestCases = [{group,GroupName} | TestCase]" n
1977
"%% GroupName = atom()" n
1978
"%% Name of a test case group." n
1979
"%% TestCase = atom()" n
1980
"%% Name of a test case." n
1981
"%% Reason = term()" n
1982
"%% The reason for skipping all groups and test cases." n
1984
"%% Description: Returns the list of groups and test cases that" n
1985
"%% are to be executed." n
1986
(erlang-skel-separator 2)
1988
"[my_test_case]." n n
1991
(erlang-skel-separator 2)
1993
(erlang-skel-separator 2)
1996
(erlang-skel-separator 2)
1997
"%% Function: TestCase() -> Info" n
1999
"%% Info = [tuple()]" n
2000
"%% List of key/value pairs." n
2002
"%% Description: Test case info function - returns list of tuples to set" n
2003
"%% properties for the test case." n
2005
"%% Note: This function is only meant to be used to return a list of" n
2006
"%% values, not perform any other operations." n
2007
(erlang-skel-separator 2)
2008
"my_test_case() -> " n >
2011
(erlang-skel-separator 2)
2012
"%% Function: TestCase(Config0) ->" n
2013
"%% ok | exit() | {skip,Reason} | {comment,Comment} |" n
2014
"%% {save_config,Config1} | {skip_and_save,Reason,Config1}" n
2016
"%% Config0 = Config1 = [tuple()]" n
2017
"%% A list of key/value pairs, holding the test case configuration." n
2018
"%% Reason = term()" n
2019
"%% The reason for skipping the test case." n
2020
"%% Comment = term()" n
2021
"%% A comment about the test case that will be printed in the html log." n
2023
"%% Description: Test case function. (The name of it must be specified in" n
2024
"%% the all/0 list or in a test case group for the test case" n
2025
"%% to be executed)." n
2026
(erlang-skel-separator 2)
2027
"my_test_case(_Config) -> " n >
2030
"*The template of a library module.
2031
Please see the function `tempo-define-template'.")
2033
(defvar erlang-skel-ct-test-suite-s
2034
'((erlang-skel-include erlang-skel-large-header)
2035
"-compile(export_all)." n n
2037
"-include(\"ct.hrl\")." n n
2039
(erlang-skel-separator 2)
2040
"%% Function: suite() -> Info" n
2041
"%% Info = [tuple()]" n
2042
(erlang-skel-separator 2)
2044
"[{timetrap,{seconds,30}}]." n n
2046
(erlang-skel-separator 2)
2047
"%% Function: init_per_suite(Config0) ->" n
2048
"%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
2049
"%% Config0 = Config1 = [tuple()]" n
2050
"%% Reason = term()" n
2051
(erlang-skel-separator 2)
2052
"init_per_suite(Config) ->" n >
2055
(erlang-skel-separator 2)
2056
"%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}" n
2057
"%% Config0 = Config1 = [tuple()]" n
2058
(erlang-skel-separator 2)
2059
"end_per_suite(_Config) ->" n >
2062
(erlang-skel-separator 2)
2063
"%% Function: init_per_group(GroupName, Config0) ->" n
2064
"%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
2065
"%% GroupName = atom()" n
2066
"%% Config0 = Config1 = [tuple()]" n
2067
"%% Reason = term()" n
2068
(erlang-skel-separator 2)
2069
"init_per_group(_GroupName, Config) ->" n >
2072
(erlang-skel-separator 2)
2073
"%% Function: end_per_group(GroupName, Config0) ->" n
2074
"%% void() | {save_config,Config1}" n
2075
"%% GroupName = atom()" n
2076
"%% Config0 = Config1 = [tuple()]" n
2077
(erlang-skel-separator 2)
2078
"end_per_group(_GroupName, _Config) ->" n >
2081
(erlang-skel-separator 2)
2082
"%% Function: init_per_testcase(TestCase, Config0) ->" n
2083
"%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}" n
2084
"%% TestCase = atom()" n
2085
"%% Config0 = Config1 = [tuple()]" n
2086
"%% Reason = term()" n
2087
(erlang-skel-separator 2)
2088
"init_per_testcase(_TestCase, Config) ->" n >
2091
(erlang-skel-separator 2)
2092
"%% Function: end_per_testcase(TestCase, Config0) ->" n
2093
"%% void() | {save_config,Config1} | {fail,Reason}" n
2094
"%% TestCase = atom()" n
2095
"%% Config0 = Config1 = [tuple()]" n
2096
"%% Reason = term()" n
2097
(erlang-skel-separator 2)
2098
"end_per_testcase(_TestCase, _Config) ->" n >
2101
(erlang-skel-separator 2)
2102
"%% Function: groups() -> [Group]" n
2103
"%% Group = {GroupName,Properties,GroupsAndTestCases}" n
2104
"%% GroupName = atom()" n
2105
"%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]" n
2106
"%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]" n
2107
"%% TestCase = atom()" n
2108
"%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}" n
2109
"%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |" n
2110
"%% repeat_until_any_ok | repeat_until_any_fail" n
2111
"%% N = integer() | forever" n
2112
(erlang-skel-separator 2)
2116
(erlang-skel-separator 2)
2117
"%% Function: all() -> GroupsAndTestCases | {skip,Reason}" n
2118
"%% GroupsAndTestCases = [{group,GroupName} | TestCase]" n
2119
"%% GroupName = atom()" n
2120
"%% TestCase = atom()" n
2121
"%% Reason = term()" n
2122
(erlang-skel-separator 2)
2124
"[my_test_case]." n n
2126
(erlang-skel-separator 2)
2127
"%% Function: TestCase() -> Info" n
2128
"%% Info = [tuple()]" n
2129
(erlang-skel-separator 2)
2130
"my_test_case() -> " n >
2133
(erlang-skel-separator 2)
2134
"%% Function: TestCase(Config0) ->" n
2135
"%% ok | exit() | {skip,Reason} | {comment,Comment} |" n
2136
"%% {save_config,Config1} | {skip_and_save,Reason,Config1}" n
2137
"%% Config0 = Config1 = [tuple()]" n
2138
"%% Reason = term()" n
2139
"%% Comment = term()" n
2140
(erlang-skel-separator 2)
2141
"my_test_case(_Config) -> " n >
2144
"*The template of a library module.
2145
Please see the function `tempo-define-template'.")
955
(load erlang-skel-file)
2147
957
;; Font-lock variables