suite_bench: add bench input skip/ignore/blacklist

some benchmark input files have different output from reference
implementation, ignore them for now in order to allow testing for
regressions for the currently passing inputs.

run ignored tests with

cargo test --features=suite_bench -- --ignored
This commit is contained in:
Noah Hellman 2023-02-11 15:33:50 +01:00
parent c3ff064c78
commit 38666a86f8
2 changed files with 16 additions and 11 deletions

View file

@ -10,17 +10,19 @@ mod.rs: ${TEST_DJ} html
echo "use crate::suite_test;" > $@ echo "use crate::suite_test;" > $@
for name in ${TEST}; do \ for name in ${TEST}; do \
name_snake=$$(basename -a $$name | sed 's/-/_/g'); \ name_snake=$$(basename -a $$name | sed 's/-/_/g'); \
echo "#[test]" >> $@; \ skip_reason=$$(grep -E "^$${name_snake}:" skip | cut -d: -f2); \
echo "fn test_$$name_snake() {" >> $@; \ [ -n "$$skip_reason" ] && echo "#[ignore = \"$${skip_reason}\"]"; \
printf ' let src = r###"' >> $@; \ echo "#[test]"; \
cat $$name.dj >> $@; \ echo "fn $$name_snake() {"; \
echo '"###;' >> $@; \ printf ' let src = r###"'; \
printf ' let expected = r###"' >> $@; \ cat $$name.dj; \
cat $$name.html >> $@; \ echo '"###;'; \
echo '"###;' >> $@; \ printf ' let expected = r###"'; \
echo " suite_test!(src, expected);" >> $@; \ cat $$name.html; \
echo "}" >> $@; \ echo '"###;'; \
done echo " suite_test!(src, expected);"; \
echo "}"; \
done >> $@
html: djot-js ${TEST_DJ} html: djot-js ${TEST_DJ}
echo ${TEST} echo ${TEST}

3
tests/bench/skip Normal file
View file

@ -0,0 +1,3 @@
block_list_flat:large list marker number
inline_links_flat:escaped attributes, empty hrefs
inline_links_nested:empty link text