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/running-unit-tests.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,9 @@ The **functions** can only be used in SELECT statements. They execute the specif
45
45
## ut.run procedures
46
46
47
47
The examples below illustrate different ways and options to invoke `ut.run` procedures.
48
+
You can use a wildcard character `*` to call tests by part of their name or to call tests that are located on paths matched by part of path string.
49
+
Wildcard character can be placed anywhere on the path and can occur mutliple times.
50
+
Schema name cannot contain a wildcard character whether is in a suitepath call or call by object name.
48
51
49
52
```sql
50
53
alter session set current_schema=hr;
@@ -75,6 +78,23 @@ end;
75
78
Executes all tests from all packages that are on the _com.my_org.my_project_ suitepath.
76
79
Check the [annotations documentation](annotations.md) to find out about suitepaths and how they can be used to organize test packages for your project.
77
80
81
+
```sql
82
+
set serveroutput on
83
+
begin
84
+
ut.run('hr:com*');
85
+
end;
86
+
```
87
+
88
+
Executes all tests in schema `hr` from all packages that are on suitepath starting with `com`.
89
+
90
+
```sql
91
+
set serveroutput on
92
+
begin
93
+
ut.run('hr:co*.my_*.my_*');
94
+
end;
95
+
```
96
+
97
+
Executes all tests in schema `hr` from all packages that starting with `my_` and all tests starting with `my_*` that are on suitepath starting with `co` .
78
98
79
99
```sql
80
100
set serveroutput on
@@ -124,6 +144,22 @@ Using a list of items to execute allows you to execute a fine-grained set of tes
124
144
125
145
List can be passed as a comma separated list or a list of *ut_varchar2_list objects* or as a list within ut_varchar2_list.
126
146
147
+
```sql
148
+
set serveroutput on
149
+
begin
150
+
ut.run('hr.test*');
151
+
end;
152
+
```
153
+
Executes all tests in schema `hr` located in packages starting with name `test`.
154
+
155
+
```sql
156
+
set serveroutput on
157
+
begin
158
+
ut.run('hr.test_apply_bonus.bonus_*');
159
+
end;
160
+
```
161
+
Executes test procedures with names starting with `bonus` in package `hr.test_apply_bonus` .
Licensed under the Apache License, Version 2.0 (the "License"):
7
+
you may not use this file except in compliance with the License.
8
+
You may obtain a copy of the License at
9
+
10
+
http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+
Unless required by applicable law or agreed to in writing, software
13
+
distributed under the License is distributed on an "AS IS" BASIS,
14
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+
See the License for the specific language governing permissions and
16
+
limitations under the License.
17
+
*/
18
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2) return self as result is
19
+
begin
20
+
self.schema_name := schema_name;
21
+
self.object_name := object_name;
22
+
self.procedure_name := procedure_name;
23
+
return;
24
+
end;
25
+
26
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2,suite_path varchar2) return self as result is
27
+
begin
28
+
self.schema_name := schema_name;
29
+
self.suite_path := suite_path;
30
+
return;
31
+
end;
32
+
33
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2,suite_path varchar2) return self as result is
Licensed under the Apache License, Version 2.0 (the "License"):
7
+
you may not use this file except in compliance with the License.
8
+
You may obtain a copy of the License at
9
+
10
+
http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+
Unless required by applicable law or agreed to in writing, software
13
+
distributed under the License is distributed on an "AS IS" BASIS,
14
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+
See the License for the specific language governing permissions and
16
+
limitations under the License.
17
+
*/
18
+
schema_name varchar2(4000),
19
+
object_name varchar2(250),
20
+
procedure_name varchar2(250),
21
+
suite_path varchar2(4000),
22
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2) return self as result,
23
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, suite_path varchar2) return self as result,
24
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2,suite_path varchar2) return self as result
0 commit comments