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: test/ut3_user/reporters/test_tap_reporter.pkb
+65-6Lines changed: 65 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,52 @@ create or replace package body test_tap_reporter as
2
2
3
3
gc_boilerplate_suitepath_expression constant varchar2(300) := 'TAP version 14\s*1..1\s*# Subtest: org\s{5}1..1\s{5}# Subtest: utplsql\s{9}1..1\s{9}# Subtest: tests\s{13}1..1\s{13}# Subtest: helpers\s{17}1..1\s{17}# Subtest: A suite for testing different outcomes from reporters';
4
4
5
+
6
+
procedure compile_tests as
7
+
pragma autonomous_transaction;
8
+
begin
9
+
10
+
execute immediate q'[
11
+
create or replace package test_tap_escaping as
12
+
--%suite(Some \ and # to be escaped)
13
+
14
+
--%test(Even more \\ and multiple ###)
15
+
procedure more_escaping;
16
+
17
+
--%test(Disabled test)
18
+
--%disabled(With \ and # in skip reason)
19
+
procedure not_skipping_escapes;
20
+
end test_tap_escaping;
21
+
]';
22
+
23
+
execute immediate q'[
24
+
create or replace package body test_tap_escaping as
25
+
26
+
procedure more_escaping as
27
+
begin
28
+
ut.expect(1).to_equal(1);
29
+
end more_escaping;
30
+
31
+
32
+
procedure not_skipping_escapes as
33
+
begin
34
+
ut.expect(10).to_equal(1);
35
+
end not_skipping_escapes;
36
+
37
+
end test_tap_escaping;
38
+
]';
39
+
40
+
end compile_tests;
41
+
42
+
5
43
procedure simple_succeeding_test as
6
44
l_output_data ut3_develop.ut_varchar2_list;
7
45
l_expected varchar2(32767);
8
46
begin
9
47
l_expected := gc_boilerplate_suitepath_expression || '\s{21}1..1\s{21}# <!beforeall!>\s{21}# Subtest: A description of some context\s{25}1..1\s{25}ok - passing_test\s{25}# <!beforeeach!>\s{25}# <!beforetest!>\s{25}# <!passing test!>\s{25}# <!aftertest!>\s{25}# <!aftereach!>\s{21}# <!afterall!>\sok - org\s*';
10
48
11
49
select *
12
-
bulk collect into l_output_data
50
+
bulk collect into l_output_data
13
51
from table(ut3_develop.ut.run('test_reporters.passing_test',ut3_develop.ut_tap_reporter()));
@@ -22,7 +60,7 @@ create or replace package body test_tap_reporter as
22
60
l_expected := gc_boilerplate_suitepath_expression || q'[\s{21}1..1\s{21}# <!beforeall!>\s{21}not ok - a test with failing assertion\s{23}---\s{23}message: '"Fails as values are different"'\s{23}severity: fail\s{23}...\s{21}# <!beforeeach!>\s{21}# <!failing test!>\s{21}# <!aftereach!>\s{21}# <!afterall!>\snot ok - org\s*]';
23
61
24
62
select *
25
-
bulk collect into l_output_data
63
+
bulk collect into l_output_data
26
64
from table(ut3_develop.ut.run('test_reporters.failing_test',ut3_develop.ut_tap_reporter()));
@@ -36,7 +74,7 @@ create or replace package body test_tap_reporter as
36
74
l_expected := gc_boilerplate_suitepath_expression || q'[\s{21}1..1\s{21}# <!beforeall!>\s{21}not ok - a test raising unhandled exception\s{23}---\s{23}message: |\s{25ORA-06502: .*\s{25}ORA-06512: at line [[:digit:]]+\s{23}severity: error\s{23}...\s{21}# <!beforeeach!>\s{21}# <!erroring test!>\s{21}# <!aftereach!>\s{21}# <!afterall!>\snot ok - org\s*]';
37
75
38
76
select *
39
-
bulk collect into l_output_data
77
+
bulk collect into l_output_data
40
78
from table(ut3_develop.ut.run('test_reporters.erroring_test',ut3_develop.ut_tap_reporter()));
@@ -64,7 +102,7 @@ create or replace package body test_tap_reporter as
64
102
l_expected := gc_boilerplate_suitepath_expression || q'[\s{21}1..1\s{21}# <!beforeall!>\s{21}ok - a disabled test with no reason # SKIP\s{21}# <!afterall!>\sok - org\s*]';
65
103
66
104
select *
67
-
bulk collect into l_output_data
105
+
bulk collect into l_output_data
68
106
from table(ut3_develop.ut.run('test_reporters.disabled_test_no_reason',ut3_develop.ut_tap_reporter()));
@@ -78,10 +116,31 @@ create or replace package body test_tap_reporter as
78
116
l_expected := q'[TAP version 14\s*1..1\s*# Subtest: org.*# Subtest: A suite.*\s{21}1..5\s{21}# <!beforeall!>\s{21}# Subtest: A desc.*\s{25}1..1\s{25}ok - passing_test\s{25}# <!beforeeach!>\s{25}# <!beforet.*\s{25}# <!aftereach!>\s{21}not ok - a test w.*\s{23}---\s{23}message:.*\s{21}# <!beforeeach!>.*\s{21}# <!aftereach!>not ok - a test rai.*\s{23}---\s{23}message: |.*ok - a disabled test # SKIP: Disabled for testing purpose.*ok - a dis.* # SKIP\s{21}# <!afterall!>\snot ok - org\s*]';
79
117
80
118
select *
81
-
bulk collect into l_output_data
119
+
bulk collect into l_output_data
82
120
from table(ut3_develop.ut.run('test_reporters',ut3_develop.ut_tap_reporter()));
0 commit comments