42 use ieee.std_logic_1164.
all;
43 use ieee.numeric_std.
all;
85 constant timestamp :
in time
89 constant testcase_name :
in string;
90 constant timestamp :
in time
94 constant testcase_name :
in string;
95 constant timestamp :
in time;
96 constant num_tests :
in integer;
97 constant num_skip_tests :
in integer;
98 constant num_checks :
in integer;
99 constant num_errors :
in integer;
100 constant show_success_fail :
in boolean
104 constant test_num :
in integer;
105 constant test_name :
in string;
106 constant timestamp :
in time
110 constant test_num :
in integer;
111 constant test_name :
in string;
112 constant timestamp :
in time
116 constant test_num :
in integer;
117 constant test_name :
in string;
118 constant timestamp :
in time;
119 constant test_active :
in boolean;
120 constant num_checks_in_test :
in integer;
121 constant num_errors_in_test :
in integer
125 constant rpt :
in string;
126 constant timestamp :
in time;
127 constant expr :
in boolean;
128 constant actual :
in string;
129 constant expected :
in string;
130 constant mask :
in string;
131 constant test_num :
in integer;
132 constant test_name :
in string;
133 constant check_num :
in integer;
134 constant err_cnt_in_test :
in integer
138 constant rpt :
in string;
139 constant timestamp :
in time;
140 constant test_num :
in integer;
141 constant test_name :
in string;
142 constant err_cnt_in_test :
in integer
159 constant timestamp :
in time
175 report "--- FORCE END OF SIMULATION ---" &
176 " (ignore this false failure message, it's not a real failure)"
179 end procedure custom_stopsim;
188 procedure custom_startsim_msg
(
189 constant testcase_name :
in string;
190 constant timestamp :
in time
193 print
("##teamcity[testSuiteStarted name='" & tcfilter
(testcase_name
) &
"']");
194 end procedure custom_startsim_msg;
197 procedure custom_endsim_msg
(
198 constant testcase_name :
in string;
199 constant timestamp :
in time;
200 constant num_tests :
in integer;
201 constant num_skip_tests :
in integer;
202 constant num_checks :
in integer;
203 constant num_errors :
in integer;
204 constant show_success_fail :
in boolean
208 print
("##teamcity[testSuiteFinished name='" & tcfilter
(testcase_name
) &
"']");
209 end procedure custom_endsim_msg;
212 procedure custom_starttest_msg
(
213 constant test_num :
in integer;
214 constant test_name :
in string;
215 constant timestamp :
in time
219 print
("##teamcity[testStarted name='" & tcfilter
(test_name
) &
"']");
220 end procedure custom_starttest_msg;
223 procedure custom_skiptest_msg
(
224 constant test_num :
in integer;
225 constant test_name :
in string;
226 constant timestamp :
in time
230 print
("##teamcity[testIgnored name='" & tcfilter
(test_name
) &
"']");
231 end procedure custom_skiptest_msg;
234 procedure custom_endtest_msg
(
235 constant test_num :
in integer;
236 constant test_name :
in string;
237 constant timestamp :
in time;
238 constant test_active :
in boolean;
239 constant num_checks_in_test :
in integer;
240 constant num_errors_in_test :
in integer
244 if (test_active
) then
246 print
("##teamcity[testFinished name='" & tcfilter
(test_name
) &
"']");
249 end procedure custom_endtest_msg;
252 procedure custom_check_msg
(
253 constant rpt :
in string;
254 constant timestamp :
in time;
255 constant expr :
in boolean;
256 constant actual :
in string;
257 constant expected :
in string;
258 constant mask :
in string;
259 constant test_num :
in integer;
260 constant test_name :
in string;
261 constant check_num :
in integer;
262 constant err_cnt_in_test :
in integer
265 constant C_NO_TAGS_STR :
string :=
"!NO_TAGS!";
266 variable no_tags :
boolean := false;
268 if not expr
then -- Output message only if the check fails
269 if err_cnt_in_test <=
1 then -- TeamCity allows max one error message per test
270 if mask'
length = C_NO_TAGS_STR'
length then
271 if mask = C_NO_TAGS_STR
then
276 write
(l,
"##teamcity[testFailed name='" & tcfilter
(test_name
) &
"'");
277 write
(l,
" message='" & tcfilter
(rpt
) &
"'");
278 if actual /=
"" or expected /=
"" then
279 write
(l,
" details='" & tcfilter
(actual
));
280 if actual /=
"" and expected /=
"" then
281 write
(l,
string'
(" "));
283 write
(l, tcfilter
(expected
) &
"'");
285 write
(l,
string'
("]"));
287 write
(l,
"##teamcity[testFailed type='comparisonFailure' name='" & tcfilter
(test_name
) &
"'");
288 if expected /=
"" then
289 write
(l,
" expected='" & tcfilter
(expected
) &
"'");
292 write
(l,
" actual='" & tcfilter
(actual
) &
"'");
295 write
(l,
" details='mask=" & tcfilter
(mask
) &
"'");
297 write
(l,
string'
("]"));
301 print
("(TeamCity error message filtered out, because max one message is allowed for each test)");
305 end procedure custom_check_msg;
308 procedure custom_error_msg
(
309 constant rpt :
in string;
310 constant timestamp :
in time;
311 constant test_num :
in integer;
312 constant test_name :
in string;
313 constant err_cnt_in_test :
in integer
317 if (err_cnt_in_test <=
1) then -- TeamCity allows max one error message per test
318 print
("##teamcity[testFailed" &
319 "name='" & tcfilter
(test_name
) &
"' " &
320 "message='" & tcfilter
(rpt
) &
"']");
322 print
("(TeamCity error message filtered out, because max one message is allowed for each test)");
325 end procedure custom_error_msg;
342 variable r :
string(s'
range) :=
(others =>
(' '
));
344 for i
in s'
range loop
348 elsif (s
(i
) = lf
or s
(i
) = cr
) then
350 elsif (s
(i
) = '|'
) then
352 elsif (s
(i
) = '['
) then
354 elsif (s
(i
) = ']'
) then
362 end function tcfilter;
PlTbUtils User Configuration Package: User's function and procedure declarations.
boolean := false C_PLTBUTILS_USE_CUSTOM_STARTTEST_MSG
boolean := false C_PLTBUTILS_USE_CUSTOM_STOPSIM
custom_startsim_msgtestcase_name,timestamp,
custom_check_msgrpt,timestamp,expr,actual,expected,mask,test_num,test_name,check_num,err_cnt_in_test,
boolean := false C_PLTBUTILS_USE_CUSTOM_CHECK_MSG
boolean := false C_PLTBUTILS_USE_CUSTOM_ENDSIM_MSG
boolean := true C_PLTBUTILS_USE_STD_STARTTEST_MSG
custom_starttest_msgtest_num,test_name,timestamp,
boolean := false C_PLTBUTILS_USE_CUSTOM_ERROR_MSG
boolean := false C_PLTBUTILS_USE_CUSTOM_ENDTEST_MSG
boolean := false C_PLTBUTILS_USE_CUSTOM_STARTSIM_MSG
boolean := true C_PLTBUTILS_USE_STD_ERROR_MSG
custom_error_msgrpt,timestamp,test_num,test_name,err_cnt_in_test,
custom_endtest_msgtest_num,test_name,timestamp,test_active,num_checks_in_test,num_errors_in_test,
boolean := true C_PLTBUTILS_USE_STD_ENDSIM_MSG
boolean := true C_PLTBUTILS_USE_STD_STOPSIM
boolean := true C_PLTBUTILS_USE_STD_SKIPTEST_MSG
boolean := true C_PLTBUTILS_USE_STD_CHECK_MSG
boolean := true C_PLTBUTILS_USE_STD_STARTSIM_MSG
custom_skiptest_msgtest_num,test_name,timestamp,
boolean := true C_PLTBUTILS_USE_STD_ENDTEST_MSG
custom_endsim_msgtestcase_name,timestamp,num_tests,num_skip_tests,num_checks,num_errors,show_success_fail,
boolean := false C_PLTBUTILS_USE_CUSTOM_SKIPTEST_MSG
Defines useful functions an procedures for text handling text in VHDL.