Line 25... |
Line 25... |
---- Author(s): ----
|
---- Author(s): ----
|
---- - Per Larsson, pela.opencores@gmail.com ----
|
---- - Per Larsson, pela.opencores@gmail.com ----
|
---- ----
|
---- ----
|
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
---- ----
|
---- ----
|
---- Copyright (C) 2014 Authors and OPENCORES.ORG ----
|
---- Copyright (C) 2014-2020 Authors and OPENCORES.ORG ----
|
---- ----
|
---- ----
|
---- This source file may be used and distributed without ----
|
---- This source file may be used and distributed without ----
|
---- restriction provided that this copyright statement is not ----
|
---- restriction provided that this copyright statement is not ----
|
---- removed from the file and that any derivative work contains ----
|
---- removed from the file and that any derivative work contains ----
|
---- the original copyright notice and the associated disclaimer. ----
|
---- the original copyright notice and the associated disclaimer. ----
|
Line 52... |
Line 52... |
---- ----
|
---- ----
|
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.numeric_std.all;
|
use ieee.numeric_std.all;
|
--use std.textio.all;
|
use std.textio.all;
|
--use std.env.all; -- Uncomment if using stop or finish in custom_stopsim() below.
|
--use std.env.all; -- Uncomment if using stop or finish in custom_stopsim() below.
|
use work.txt_util.all;
|
use work.txt_util.all;
|
|
|
package pltbutils_user_cfg_pkg is
|
package pltbutils_user_cfg_pkg is
|
|
|
Line 254... |
Line 254... |
constant test_num : in integer;
|
constant test_num : in integer;
|
constant test_name : in string;
|
constant test_name : in string;
|
constant check_num : in integer;
|
constant check_num : in integer;
|
constant err_cnt_in_test : in integer
|
constant err_cnt_in_test : in integer
|
) is
|
) is
|
variable comparison_str : string(1 to 32) := (others => ' ');
|
variable l : line;
|
variable comparison_str_len : integer := 1;
|
constant C_NO_TAGS_STR : string := "!NO_TAGS!";
|
variable actual_str : string(1 to 32) := (others => ' ');
|
variable no_tags : boolean := false;
|
variable actual_str_len : integer := 1;
|
|
variable expected_str : string(1 to 32) := (others => ' ');
|
|
variable expected_str_len : integer := 1;
|
|
variable mask_str : string(1 to 32) := (others => ' ');
|
|
variable mask_str_len : integer := 1;
|
|
begin
|
begin
|
if not expr then -- Output message only if the check fails
|
if not expr then -- Output message only if the check fails
|
if err_cnt_in_test <= 1 then -- TeamCity allows max one error message per test
|
if err_cnt_in_test <= 1 then -- TeamCity allows max one error message per test
|
if actual /= "" then
|
if mask'length = C_NO_TAGS_STR'length then
|
actual_str_len := 10 + actual'length;
|
if mask = C_NO_TAGS_STR then
|
actual_str(1 to actual_str_len) := " actual='" & tcfilter(actual) & "'";
|
no_tags := true;
|
|
end if;
|
|
end if;
|
|
if no_tags then
|
|
write(l, "##teamcity[testFailed name='" & tcfilter(test_name) & "'");
|
|
write(l, " message='" & tcfilter(rpt) & "'");
|
|
if actual /= "" or expected /= "" then
|
|
write(l, " details='" & tcfilter(actual));
|
|
if actual /= "" and expected /= "" then
|
|
write(l, string'(" "));
|
end if;
|
end if;
|
|
write(l, tcfilter(expected) & "'");
|
|
end if;
|
|
write(l, string'("]"));
|
|
else
|
|
write(l, "##teamcity[testFailed type='comparisonFailure' name='" & tcfilter(test_name) & "'");
|
if expected /= "" then
|
if expected /= "" then
|
comparison_str_len := 26;
|
write(l, " expected='" & tcfilter(expected) & "'");
|
comparison_str(1 to comparison_str_len) := " type='comparisonFailure' ";
|
end if;
|
expected_str_len := 12 + expected'length;
|
if actual /= "" then
|
expected_str(1 to expected_str_len) := " expected='" & tcfilter(expected) & "'";
|
write(l, " actual='" & tcfilter(actual) & "'");
|
end if;
|
end if;
|
if mask /= "" then
|
if mask /= "" then
|
mask_str_len := 17 + mask'length;
|
write(l, " details='mask=" & tcfilter(mask) & "'");
|
mask_str(1 to mask_str_len) := " details='mask=" & tcfilter(mask) & "' ";
|
|
end if;
|
end if;
|
print("##teamcity[testFailed" &
|
write(l, string'("]"));
|
comparison_str(1 to comparison_str_len) &
|
end if;
|
"name='" & tcfilter(test_name) & "' " &
|
print(l.all);
|
"message='" & tcfilter(rpt) & "' " &
|
|
expected_str(1 to expected_str_len) &
|
|
actual_str(1 to actual_str_len) &
|
|
mask_str(1 to mask_str_len) &
|
|
"]");
|
|
else
|
else
|
print("(TeamCity error message filtered out, because max one message is allowed for each test)");
|
print("(TeamCity error message filtered out, because max one message is allowed for each test)");
|
end if;
|
end if;
|
end if;
|
end if;
|
end procedure custom_check_msg;
|
end procedure custom_check_msg;
|
Line 344... |
Line 347... |
end loop;
|
end loop;
|
return r;
|
return r;
|
end function tcfilter;
|
end function tcfilter;
|
|
|
end package body pltbutils_user_cfg_pkg;
|
end package body pltbutils_user_cfg_pkg;
|
No newline at end of file
|
No newline at end of file
|
|
|
No newline at end of file
|
No newline at end of file
|