You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/userguide/annotations.md
+86-2Lines changed: 86 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,95 @@ The framework runner searches for all the suitable annotated packages, automatic
9
9
Annotations are interpreted only in the package specification and are case-insensitive. We strongly recommend using lower-case annotations as described in this documentation.
10
10
11
11
There are two distinct types of annotations, identified by their location in package:
12
-
- Procedure level annotations - placed directly before a procedure (`--%test`, `--%beforeall`, `--%beforeeach` etc.).
13
-
- Package level annotations - placed at any place in package except directly before procedure (`--%suite`, `--%suitepath` etc.).
14
12
13
+
### Procedure level annotations
14
+
15
+
Annotation placed directly before a procedure (`--%test`, `--%beforeall`, `--%beforeeach` etc.).
16
+
There **can not** be any empty lines or comments between annotation line and procedure line.
17
+
There can be many annotations for a procedure.
18
+
19
+
Valid procedure annotations example:
20
+
```sql
21
+
package test_package is
22
+
--%suite
23
+
24
+
25
+
--%test()
26
+
--%disabled
27
+
procedure my_first_procedure;
28
+
29
+
$if dbms_db_version.version>=12 $then --This is ok - annotation before procedure
30
+
--%test()
31
+
procedure my_first_procedure;
32
+
$end
33
+
34
+
--A comment goes before annotations
35
+
--%test()
36
+
procedure my_first_procedure;
37
+
end;
38
+
```
39
+
40
+
Invalid procedure annotations examples:
41
+
```sql
42
+
package test_package is
43
+
--%suite
44
+
45
+
--%test() --This is wrong as there is an empty line between procedure and annotation
46
+
47
+
procedure my_first_procedure;
48
+
49
+
--%test()
50
+
--This is wrong as there is a comment line between procedure and annotation
51
+
procedure proc1;
52
+
53
+
--%test() --This is wrong as there is a compiler directive between procedure and annotation
54
+
$if dbms_db_version.version>=12 $then
55
+
procedure proc_12;
56
+
$end
57
+
58
+
--%test()
59
+
-- procedure another_proc;
60
+
/* The above is wrong as the procedure is commented out
61
+
and annotation is not procedure annotation anymore */
62
+
63
+
end;
64
+
```
65
+
66
+
### Package level annotations
67
+
68
+
Those annotations placed at any place in package except directly before procedure (`--%suite`, `--%suitepath` etc.).
15
69
We strongly recommend putting package level annotations at the very top of package except for the `--%context` annotations (described below)
16
70
71
+
Valid package annotations example:
72
+
```sql
73
+
package test_package is
74
+
75
+
--%suite
76
+
77
+
--%suitepath(org.utplsql.example)
78
+
79
+
--%beforeall(some_package.some_procedure)
80
+
81
+
--%context
82
+
83
+
--%test()
84
+
procedure my_first_procedure;
85
+
--%endcontext
86
+
end;
87
+
```
88
+
89
+
Invalid package annotations examples:
90
+
```sql
91
+
package test_package is
92
+
--%suite --This is wrong as suite annotation is not a procedure annotation
93
+
procedure irrelevant;
94
+
95
+
--%context --This is wrong as there is no empty line between package level annotation and procedure level annotation
0 commit comments