]>
git.proxmox.com Git - rustc.git/blob - src/vendor/html5ever/tests/foreach_html5lib_test/mod.rs
1 // Copyright 2014-2017 The html5ever Project Developers. See the
2 // COPYRIGHT file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
15 pub fn foreach_html5lib_test
<Mk
>(
20 where Mk
: FnMut(&Path
, fs
::File
)
22 let mut test_dir_path
= src_dir
.to_path_buf();
23 test_dir_path
.push("html5lib-tests");
24 test_dir_path
.push(subdir
);
26 let maybe_test_files
= fs
::read_dir(&test_dir_path
);
27 match maybe_test_files
{
29 for entry
in test_files
{
30 let path
= entry
.unwrap().path();
31 if path
.extension() == Some(ext
) {
32 let file
= fs
::File
::open(&path
).unwrap();
38 panic
!("Before launching the tests, please run this command:\n\n\tgit submodule update --init\n\nto retrieve an html5lib-tests snapshot.");