Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 959c1c9

Browse files
committed
Added example of a reporter that reports out all expectation outputs, not only the failed ones.
The success & failure of expectation is also reported inline with tests (not at the end in the summary section of report). Reorganized some of examples as well.
1 parent 507c176 commit 959c1c9

17 files changed

Lines changed: 265 additions & 88 deletions

examples/RunAllExamplesAsTests.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ whenever oserror exit failure rollback
33

44
@@RunAllExamples.sql
55

6+
prompt *******************************************************************************
7+
prompt All examples completed successfully
8+
prompt *******************************************************************************
9+
prompt
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
prompt *******************************************************************************
2+
prompt Running custom reporters examples
3+
prompt *******************************************************************************
4+
Clear Screen
5+
set echo off
6+
set feedback on
7+
set linesize 1000
8+
9+
@@custom_reporters/run_ut_custom_reporter.sql
10+
@@custom_reporters/run_ut_expectations_reporter.sql

examples/RunDeveloperExamples.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ set linesize 1000
66

77
exec ut_ansiconsole_helper.color_enabled(true);
88
--developer examples
9-
prompt RunExampleTestSuiteWithCustomReporter
10-
@@developer_examples/RunExampleTestSuiteWithCustomReporter.sql
119
prompt RunExampleTestAnnotationsParsingTimeHugePackage
1210
@@developer_examples/RunExampleTestAnnotationsParsingTimeHugePackage.sql
1311
prompt RunExampleTestSuite

examples/between_string/run_betwnstr_test.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@@betwnstr.sql
2-
@@test_betwnstr.pkg
2+
@@test_betwnstr.pks
3+
@@test_betwnstr.pkb
34

45
set serveroutput on size unlimited format truncated
56

examples/between_string/run_betwnstr_test_coverage.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set pagesize 0
44
set long 200000000
55
set longchunksize 1000000
66
@@betwnstr.sql
7-
@@test_betwnstr.pkg
7+
@@test_betwnstr.pks
8+
@@test_betwnstr.pkb
89

910
set serveroutput on size unlimited format truncated
1011

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
create or replace package test_betwnstr as
2-
3-
-- %suite(Between string function)
4-
5-
-- %test(Returns substring from start position to end position)
6-
procedure normal_case;
7-
8-
-- %test(Returns substring when start position is zero)
9-
procedure zero_start_position;
10-
11-
-- %test(Returns string until end if end position is greater than string length)
12-
procedure big_end_position;
13-
14-
-- %test(Returns null for null input string value)
15-
procedure null_string;
16-
17-
-- %test(Demo of a disabled test)
18-
-- %disabled
19-
procedure disabled_test;
20-
21-
end;
22-
/
231
create or replace package body test_betwnstr as
242

253
procedure normal_case is
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
create or replace package test_betwnstr as
2+
3+
-- %suite(Between string function)
4+
5+
-- %test(Returns substring from start position to end position)
6+
procedure normal_case;
7+
8+
-- %test(Returns substring when start position is zero)
9+
procedure zero_start_position;
10+
11+
-- %test(Returns string until end if end position is greater than string length)
12+
procedure big_end_position;
13+
14+
-- %test(Returns null for null input string value)
15+
procedure null_string;
16+
17+
-- %test(Demo of a disabled test)
18+
-- %disabled
19+
procedure disabled_test;
20+
21+
end;
22+
/
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
prompt *******************************************************************************
2+
prompt Runnign tests with UT_CUSTOM_REPORTER on top of UT_DOCUMENTATION_REPROTER
3+
prompt *******************************************************************************
4+
5+
set echo off
6+
--install the example unit test packages
7+
@demo_of_expectations/demo_equal_matcher.sql
8+
@@ut_custom_reporter.tps
9+
@@ut_custom_reporter.tpb
10+
11+
set serveroutput on size unlimited format truncated
12+
13+
exec ut.run('demo_equal_matcher', ut_custom_reporter());
14+
15+
@demo_of_expectations/drop_demo_equal_matcher.sql
16+
drop type ut_custom_reporter;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
prompt *******************************************************************************
2+
prompt Runnign tests with UT_CUSTOM_REPORTER on top of UT_DOCUMENTATION_REPROTER
3+
prompt *******************************************************************************
4+
5+
set echo off
6+
--install the example unit test packages
7+
@demo_of_expectations/demo_equal_matcher.sql
8+
@@ut_expectations_reporter.tps
9+
@@ut_expectations_reporter.tpb
10+
11+
set serveroutput on size unlimited format truncated
12+
13+
exec ut.run('demo_equal_matcher', ut_expectations_reporter());
14+
15+
@demo_of_expectations/drop_demo_equal_matcher.sql
16+
drop type ut_expectations_reporter;
File renamed without changes.

0 commit comments

Comments
 (0)