forked from utPLSQL/utPLSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sql
More file actions
280 lines (249 loc) · 13.4 KB
/
install.sql
File metadata and controls
280 lines (249 loc) · 13.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/*
utPLSQL - Version 3
Copyright 2016 - 2017 utPLSQL Project
Licensed under the Apache License, Version 2.0 (the "License"):
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
@@define_ut3_owner_param.sql
spool install.log
prompt &&line_separator
prompt Installing utPLSQL v3 framework into &&ut3_owner schema
prompt &&line_separator
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback
prompt Switching current schema to &&ut3_owner
prompt &&line_separator
alter session set current_schema = &&ut3_owner;
alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6003,6009,6010,7206)';
--set define off
--dbms_output buffer cache table
@@install_component.sql 'core/ut_dbms_output_cache.sql'
--common utilities
@@install_component.sql 'core/types/ut_varchar2_list.tps'
@@install_component.sql 'core/types/ut_varchar2_rows.tps'
@@install_component.sql 'core/types/ut_object_name.tps'
@@install_component.sql 'core/types/ut_object_name.tpb'
@@install_component.sql 'core/types/ut_object_names.tps'
@@install_component.sql 'core/types/ut_key_value_pair.tps'
@@install_component.sql 'core/types/ut_key_value_pairs.tps'
@@install_component.sql 'core/ut_utils.pks'
@@install_component.sql 'core/ut_metadata.pks'
@@install_component.sql 'core/ut_utils.pkb'
@@install_component.sql 'core/ut_metadata.pkb'
@@install_component.sql 'reporters/ut_ansiconsole_helper.pks'
@@install_component.sql 'reporters/ut_ansiconsole_helper.pkb'
--core types
@@install_component.sql 'core/types/ut_expectation_result.tps'
@@install_component.sql 'core/types/ut_expectation_results.tps'
@@install_component.sql 'core/types/ut_results_counter.tps'
@@install_component.sql 'core/types/ut_suite_item_base.tps'
@@install_component.sql 'core/types/ut_event_listener_base.tps'
@@install_component.sql 'core/types/ut_suite_item.tps'
@@install_component.sql 'core/types/ut_suite_items.tps'
@@install_component.sql 'core/types/ut_executable.tps'
@@install_component.sql 'core/types/ut_test.tps'
@@install_component.sql 'core/types/ut_logical_suite.tps'
@@install_component.sql 'core/types/ut_suite.tps'
@@install_component.sql 'core/types/ut_file_mapping.tps'
@@install_component.sql 'core/types/ut_file_mappings.tps'
@@install_component.sql 'core/types/ut_coverage_options.tps'
@@install_component.sql 'core/types/ut_run.tps'
@@install_component.sql 'core/types/ut_reporter_base.tps'
@@install_component.sql 'core/types/ut_reporters.tps'
@@install_component.sql 'core/types/ut_event_listener.tps'
--output buffer table
@@install_component.sql 'core/ut_output_buffer_tmp.sql'
@@install_component.sql 'core/ut_message_id_seq.sql'
--output buffer api
@@install_component.sql 'core/ut_output_buffer.pks'
@@install_component.sql 'core/ut_output_buffer.pkb'
--annoations
@@install_component.sql 'core/annotations/ut_annotation.tps'
@@install_component.sql 'core/annotations/ut_annotations.tps'
@@install_component.sql 'core/annotations/ut_annotated_object.tps'
@@install_component.sql 'core/annotations/ut_annotated_objects.tps'
@@install_component.sql 'core/annotations/ut_annotation_obj_cache_info.tps'
@@install_component.sql 'core/annotations/ut_annotation_objs_cache_info.tps'
@@install_component.sql 'core/annotations/ut_annotation_cache_seq.sql'
@@install_component.sql 'core/annotations/ut_annotation_cache_info.sql'
@@install_component.sql 'core/annotations/ut_annotation_cache.sql'
@@install_component.sql 'core/annotations/ut_annotation_cache_manager.pks'
@@install_component.sql 'core/annotations/ut_annotation_cache_manager.pkb'
@@install_component.sql 'core/annotations/ut_annotation_parser.pks'
@@install_component.sql 'core/annotations/ut_annotation_parser.pkb'
@@install_component.sql 'core/annotations/ut_annotation_manager.pks'
@@install_component.sql 'core/annotations/ut_annotation_manager.pkb'
--suite builder
@@install_component.sql 'core/ut_suite_builder.pks'
@@install_component.sql 'core/ut_suite_builder.pkb'
--suite manager
@@install_component.sql 'core/ut_suite_manager.pks'
@@install_component.sql 'core/ut_suite_manager.pkb'
--expectations execution state interface
@@install_component.sql 'core/ut_expectation_processor.pks'
@@install_component.sql 'core/ut_expectation_processor.pkb'
prompt Installing PLSQL profiler objects into &&ut3_owner schema
@@core/coverage/proftab.sql
@@install_component.sql 'core/ut_file_mapper.pks'
@@install_component.sql 'core/ut_file_mapper.pkb'
--gathering coverage
@@install_component.sql 'core/coverage/ut_coverage_sources_tmp.sql'
@@install_component.sql 'core/coverage/ut_coverage_helper.pks'
@@install_component.sql 'core/coverage/ut_coverage_helper.pkb'
@@install_component.sql 'core/coverage/ut_coverage.pks'
@@install_component.sql 'core/coverage/ut_coverage.pkb'
@@install_component.sql 'core/coverage/ut_coverage_reporter_base.tps'
@@install_component.sql 'core/coverage/ut_coverage_reporter_base.tpb'
--core type bodies
@@install_component.sql 'core/types/ut_results_counter.tpb'
@@install_component.sql 'core/types/ut_suite_item.tpb'
@@install_component.sql 'core/types/ut_test.tpb'
@@install_component.sql 'core/types/ut_logical_suite.tpb'
@@install_component.sql 'core/types/ut_suite.tpb'
@@install_component.sql 'core/types/ut_run.tpb'
@@install_component.sql 'core/types/ut_event_listener.tpb'
@@install_component.sql 'core/types/ut_expectation_result.tpb'
@@install_component.sql 'core/types/ut_reporter_base.tpb'
@@install_component.sql 'core/types/ut_file_mapping.tpb'
@@install_component.sql 'core/types/ut_executable.tpb'
@@install_component.sql 'core/types/ut_console_reporter_base.tps'
@@install_component.sql 'core/types/ut_console_reporter_base.tpb'
--expectations and matchers
@@install_component.sql 'expectations/data_values/ut_cursor_data.sql'
@@install_component.sql 'expectations/data_values/ut_cursor_data_diff.sql'
@@install_component.sql 'expectations/data_values/ut_data_value.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_anydata.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_collection.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_object.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_blob.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_boolean.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_clob.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_date.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_dsinterval.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_number.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_refcursor.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_timestamp.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_timestamp_tz.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_timestamp_ltz.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_varchar2.tps'
@@install_component.sql 'expectations/data_values/ut_data_value_yminterval.tps'
@@install_component.sql 'expectations/matchers/ut_matcher.tps'
@@install_component.sql 'expectations/matchers/ut_comparison_matcher.tps'
@@install_component.sql 'expectations/matchers/ut_be_false.tps'
@@install_component.sql 'expectations/matchers/ut_be_greater_or_equal.tps'
@@install_component.sql 'expectations/matchers/ut_be_greater_than.tps'
@@install_component.sql 'expectations/matchers/ut_be_less_or_equal.tps'
@@install_component.sql 'expectations/matchers/ut_be_less_than.tps'
@@install_component.sql 'expectations/matchers/ut_be_like.tps'
@@install_component.sql 'expectations/matchers/ut_be_not_null.tps'
@@install_component.sql 'expectations/matchers/ut_be_null.tps'
@@install_component.sql 'expectations/matchers/ut_be_true.tps'
@@install_component.sql 'expectations/matchers/ut_equal.tps'
@@install_component.sql 'expectations/matchers/ut_be_between.tps'
@@install_component.sql 'expectations/matchers/ut_be_empty.tps'
@@install_component.sql 'expectations/matchers/ut_match.tps'
@@install_component.sql 'expectations/ut_expectation.tps'
@@install_component.sql 'expectations/data_values/ut_data_value.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_anydata.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_object.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_collection.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_blob.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_boolean.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_clob.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_date.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_dsinterval.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_number.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_refcursor.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_timestamp.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_timestamp_tz.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_timestamp_ltz.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_varchar2.tpb'
@@install_component.sql 'expectations/data_values/ut_data_value_yminterval.tpb'
@@install_component.sql 'expectations/matchers/ut_matcher.tpb'
@@install_component.sql 'expectations/matchers/ut_comparison_matcher.tpb'
@@install_component.sql 'expectations/matchers/ut_be_false.tpb'
@@install_component.sql 'expectations/matchers/ut_be_greater_or_equal.tpb'
@@install_component.sql 'expectations/matchers/ut_be_greater_than.tpb'
@@install_component.sql 'expectations/matchers/ut_be_less_or_equal.tpb'
@@install_component.sql 'expectations/matchers/ut_be_less_than.tpb'
@@install_component.sql 'expectations/matchers/ut_be_like.tpb'
@@install_component.sql 'expectations/matchers/ut_be_not_null.tpb'
@@install_component.sql 'expectations/matchers/ut_be_null.tpb'
@@install_component.sql 'expectations/matchers/ut_be_true.tpb'
@@install_component.sql 'expectations/matchers/ut_equal.tpb'
@@install_component.sql 'expectations/matchers/ut_be_between.tpb'
@@install_component.sql 'expectations/matchers/ut_be_empty.tpb'
@@install_component.sql 'expectations/matchers/ut_match.tpb'
@@install_component.sql 'expectations/ut_expectation.tpb'
--core reporter
@@install_component.sql 'reporters/ut_documentation_reporter.tps'
@@install_component.sql 'reporters/ut_documentation_reporter.tpb'
--plugin interface API for running utPLSQL
@@install_component.sql 'api/ut_runner.pks'
@@install_component.sql 'api/ut_runner.pkb'
--developer interface for expectations and running utPLSQL
@@install_component.sql 'api/ut.pks'
@@install_component.sql 'api/ut.pkb'
--additional reporters
@@install_component.sql 'reporters/ut_teamcity_reporter.tps'
@@install_component.sql 'reporters/ut_teamcity_reporter_helper.pks'
@@install_component.sql 'reporters/ut_teamcity_reporter_helper.pkb'
@@install_component.sql 'reporters/ut_teamcity_reporter.tpb'
@@install_component.sql 'reporters/ut_xunit_reporter.tps'
@@install_component.sql 'reporters/ut_xunit_reporter.tpb'
@@install_component.sql 'reporters/ut_sonar_test_reporter.tps'
@@install_component.sql 'reporters/ut_sonar_test_reporter.tpb'
@@install_component.sql 'reporters/ut_coverage_html_reporter.tps'
@@install_component.sql 'reporters/ut_coverage_report_html_helper.pks'
@@install_component.sql 'reporters/ut_coverage_report_html_helper.pkb'
@@install_component.sql 'reporters/ut_coverage_html_reporter.tpb'
@@install_component.sql 'reporters/ut_coverage_sonar_reporter.tps'
@@install_component.sql 'reporters/ut_coverage_sonar_reporter.tpb'
@@install_component.sql 'reporters/ut_coveralls_reporter.tps'
@@install_component.sql 'reporters/ut_coveralls_reporter.tpb'
@@install_component.sql 'api/be_between.syn'
@@install_component.sql 'api/be_empty.syn'
@@install_component.sql 'api/be_false.syn'
@@install_component.sql 'api/be_greater_or_equal.syn'
@@install_component.sql 'api/be_greater_than.syn'
@@install_component.sql 'api/be_less_or_equal.syn'
@@install_component.sql 'api/be_less_than.syn'
@@install_component.sql 'api/be_like.syn'
@@install_component.sql 'api/be_not_null.syn'
@@install_component.sql 'api/be_null.syn'
@@install_component.sql 'api/be_true.syn'
@@install_component.sql 'api/equal.syn'
@@install_component.sql 'api/match.syn'
set linesize 200
set define on
column text format a100
column error_count noprint new_value error_count
prompt Validating installation
prompt &&line_separator
set heading on
select type, name, sequence, line, position, text, count(1) over() error_count
from all_errors
where owner = upper('&&ut3_owner')
and name not like 'BIN$%' --not recycled
and (name = 'UT' or name like 'UT\_%' escape '\')
-- errors only. ignore warnings
and attribute = 'ERROR'
order by name, type, sequence
/
begin
if to_number('&&error_count') > 0 then
raise_application_error(-20000, 'Not all sources were successfully installed.');
else
dbms_output.put_line('Installation completed successfully');
dbms_output.put_line('&&line_separator');
end if;
end;
/
spool off