srctree

Robin Linden parent 0c500def e021c959
html2/test: Pass the html5lib test file as an argument

We want to be able to run this with some of the other test files fromhtml5lib.

inlinesplit
html2/BUILD added: 11, removed: 5, total 6
@@ -47,10 +47,12 @@ extra_deps = {
],
)]
 
# TODO(robinlinden): Run all tests.
cc_test(
name = "html5lib_test",
size = "small",
srcs = ["html5lib_test.cpp"],
args = ["$(location @html5lib-tests//:tokenizer/test1.test)"],
copts = HASTUR_COPTS + select({
# simdjson leaks a bunch of warnings into our code.
"@platforms//os:windows": [
 
html2/html5lib_test.cpp added: 11, removed: 5, total 6
@@ -118,9 +118,13 @@ std::vector<html2::Token> to_html2_tokens(simdjson::ondemand::array tokens) {
}
} // namespace
 
int main() {
// TODO(robinlinden): Run all tests.
auto json = simdjson::padded_string::load("../html5lib-tests/tokenizer/test1.test");
int main(int argc, char **argv) {
if (argc != 2) {
std::cerr << "No test file provided\n";
return 1;
}
 
auto json = simdjson::padded_string::load(argv[1]);
if (json.error() != simdjson::SUCCESS) {
std::cerr << "Error loading test file: " << json.error() << '\n';
return 1;