[Feature] Make `check_equal` a generic procedure
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- testing
Direzione di ricerca
The issue proposes a generic check_equal procedure but names no source files or tests. Start by locating the existing check_equal declarations, implementations, and tests, then check which VHDL generic procedure features the project supports. Done means custom types can use the generic check while the existing equality checks remain covered by tests.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hey there, I thought to make the testing even more powerful. I'd suggest to make check_equal a generic procedure in order to make it easier to define a new one for any other type.
Suggested code:
package example_pkg is
procedure check_equal_generic
generic (
type type_t;
function to_string(data: type_t) return string
)
parameter (
got: in type_t;
expected: in type_t;
msg: in string := check_result_tag;
level: in log_level_t := null_log_level;
path_offset: in natural := 1;
line_num: in natural := 0;
file_name: in string := ""
);
type test_t is (st_1, st_2);
procedure check_equal is new check_equal_generic generic map (type_t => test_t, to_string => to_string); -- to_string is implicitly defined
end package;
package body example_pkg is
-- Overloaded generic check_equal procedures for custom checks
procedure check_equal_generic
generic (
type type_t;
function to_string(data: type_t) return string
)
parameter (
got: in type_t;
expected: in type_t;
msg: in string := check_result_tag;
level: in log_level_t := null_log_level;
path_offset: in natural := 1;
line_num: in natural := 0;
file_name: in string := ""
)
is
constant checker: checker_t := default_checker;
begin
-- pragma translate_off
if got = expected then
if is_pass_visible(checker) then
passing_check(
checker,
p_std_msg(
"Equality check passed", msg,
"Got " & to_string(got) & "."
),
path_offset + 1, line_num, file_name
);
else
passing_check(checker);
end if;
else
failing_check(
checker,
p_std_msg(
"Equality check failed", msg,
"Got " & to_string(got) & ". " &
"Expected " & to_string(expected) & "."
),
level, path_offset + 1, line_num, file_name
);
end if;
end;
end package body;
- Lingua principale
- VHDL
- Stelle
- 850
- Fork
- 305
- Merge medio
- 2g 10h
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di VUnit/vunit
-
KeyError in test scheduler when using TestBench.scan_tests_from_file()Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
GHDL: generics leak between configurations when `ghdl.sim_flags` is setForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
VUnit/vunit#1223 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
AXI slave VCs have identical stalling behaviorForse già presa @Lay007 l’ha presa 24 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
VUnit/vunit#1219 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
bug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Stack section headers at accessibility sizes instead of hyphenating the title and cutting the linkApertaaccessibility bug medium-priority mobile
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
lognorman20/monaco#6244 ·
-
Area/AI Type/Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
wso2/product-integrator#2845 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
jeanibarz/knowledge-base-mcp-server#999 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
githedgehog/fabric#1693 ·
I maintainer di solito rispondono entro 1 giorno