servo: Merge #4053 - Allow reftests to be run directly w/ relative path (from mttr:reftests_with_relative_dir); r=SimonSapin

Fixes #3521

Source-Repo: https://github.com/servo/servo
Source-Revision: dfa9e1aa4ac2c10b338d17fbad78f93323f66242
This commit is contained in:
Matthew Rasmus 2014-11-21 05:06:31 -07:00
Родитель bca98837ef
Коммит 62e6e16cbb
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -165,7 +165,14 @@ fn parse_lists(file: &Path, servo_args: &[String], render_mode: RenderMode, id_o
"!=" => Different,
part => panic!("reftest line: '{:s}' has invalid kind '{:s}'", line, part)
};
let base = file.dir_path();
// If we're running this directly, file.dir_path() might be relative.
// (see issue #3521)
let base = match file.dir_path().is_relative() {
true => os::getcwd().join(file.dir_path()),
false => file.dir_path()
};
let file_left = base.join(test_line.file_left);
let file_right = base.join(test_line.file_right);