Skip to content

Commit f2c7020

Browse files
Pavel-IrzhauskiPavel Irzhauski
andauthored
Replace the absolute paths to test files with the relative paths (#632)
* replace the absolute paths to the test files with the relative paths * replace the absolute paths to the test files with the relative paths Signed-off-by: Pavel Irzhauski <[email protected]> --------- Signed-off-by: Pavel Irzhauski <[email protected]> Co-authored-by: Pavel Irzhauski <[email protected]>
1 parent 705ac74 commit f2c7020

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

html5ever/benches/html5ever.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl TokenSink for Sink {
2424
}
2525

2626
fn run_bench(c: &mut Criterion, name: &str) {
27-
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
27+
let mut path = PathBuf::from("./");
2828
path.push("data/bench/");
2929
path.push(name);
3030
let mut file = fs::File::open(&path).expect("can't open file");

rcdom/tests/html-tokenizer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ use html5ever::tokenizer::{TokenSink, TokenSinkResult, Tokenizer, TokenizerOpts}
2222
use html5ever::{ns, Attribute, LocalName, QualName};
2323
use serde_json::{Map, Value};
2424
use std::cell::RefCell;
25+
use std::char;
2526
use std::ffi::OsStr;
2627
use std::fs::File;
2728
use std::io::Read;
2829
use std::path::Path;
29-
use std::{char, env};
3030

3131
use util::runner::{run_all, Test};
3232

@@ -478,5 +478,5 @@ fn tests(src_dir: &Path) -> Vec<Test> {
478478
}
479479

480480
fn main() {
481-
run_all(tests(Path::new(env!("CARGO_MANIFEST_DIR"))));
481+
run_all(tests(Path::new("./")));
482482
}

rcdom/tests/html-tree-builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::collections::{HashMap, HashSet};
1818
use std::ffi::OsStr;
1919
use std::io::BufRead;
2020
use std::path::Path;
21-
use std::{env, fs, io, iter, mem};
21+
use std::{fs, io, iter, mem};
2222

2323
use html5ever::tendril::{StrTendril, TendrilSink};
2424
use html5ever::{parse_document, parse_fragment, ParseOpts};
@@ -284,7 +284,7 @@ fn tests(src_dir: &Path, ignores: &HashSet<String>) -> Vec<Test> {
284284
}
285285

286286
fn main() {
287-
let src_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
287+
let src_dir = Path::new("./");
288288
let mut ignores = HashSet::new();
289289
{
290290
let f = fs::File::open(src_dir.join("data/test/ignore")).unwrap();

rcdom/tests/xml-tokenizer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use serde_json::{Map, Value};
1111
use std::borrow::Cow::Borrowed;
1212
use std::cell::RefCell;
13-
use std::env;
1413
use std::ffi::OsStr;
1514
use std::io::Read;
1615
use std::path::Path;
@@ -371,5 +370,5 @@ fn tests(src_dir: &Path) -> Vec<Test> {
371370
}
372371

373372
fn main() {
374-
run_all(tests(Path::new(env!("CARGO_MANIFEST_DIR"))));
373+
run_all(tests(Path::new("./")));
375374
}

rcdom/tests/xml-tree-builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::collections::{HashMap, HashSet};
1313
use std::ffi::OsStr;
1414
use std::io::BufRead;
1515
use std::path::Path;
16-
use std::{env, fs, io, iter, mem};
16+
use std::{fs, io, iter, mem};
1717
use util::find_tests::foreach_xml5lib_test;
1818
use util::runner::{run_all, Test};
1919
use xml5ever::driver::parse_document;
@@ -224,7 +224,7 @@ fn tests(src_dir: &Path, ignores: &HashSet<String>) -> Vec<Test> {
224224
}
225225

226226
fn main() {
227-
let src_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
227+
let src_dir = Path::new("./");
228228
let mut ignores = HashSet::new();
229229
if let Ok(f) = fs::File::open(src_dir.join("data/test/ignore")) {
230230
let r = io::BufReader::new(f);

xml5ever/benches/xml5ever.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl TokenSink for Sink {
2626
}
2727

2828
fn run_bench(c: &mut Criterion, name: &str) {
29-
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
29+
let mut path = PathBuf::from("./");
3030
path.push("data/bench/");
3131
path.push(name);
3232
let mut file = fs::File::open(&path).expect("can't open file");

0 commit comments

Comments
 (0)