mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #23856 - servo:stylo-engines, r=nox
Stylo: replace product={gecko,servo} with engine={gecko,servo-2013,servo-2020} Renaming the variable helped make sure I looked at every use. Also auto-generate relevant parts of `CSSStyleDeclaration.webidl`, to make libscript compile accordingly. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23856) <!-- Reviewable:end -->
This commit is contained in:
commit
8e7daa77b6
58 changed files with 993 additions and 1100 deletions
|
@ -4,9 +4,8 @@
|
|||
|
||||
use serde_json::{self, Value};
|
||||
use std::env;
|
||||
use std::fs::{remove_file, File};
|
||||
use std::fs::File;
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
|
||||
#[test]
|
||||
fn properties_list_json() {
|
||||
|
@ -19,67 +18,10 @@ fn properties_list_json() {
|
|||
.join("doc")
|
||||
.join("servo")
|
||||
.join("css-properties.json");
|
||||
if json.exists() {
|
||||
remove_file(&json).unwrap()
|
||||
}
|
||||
let python = env::var("PYTHON").ok().unwrap_or_else(find_python);
|
||||
let script = top
|
||||
.join("components")
|
||||
.join("style")
|
||||
.join("properties")
|
||||
.join("build.py");
|
||||
let status = Command::new(python)
|
||||
.arg(&script)
|
||||
.arg("servo")
|
||||
.arg("html")
|
||||
.arg("regular")
|
||||
.status()
|
||||
.unwrap();
|
||||
assert!(status.success(), "{:?}", status);
|
||||
|
||||
let properties: Value = serde_json::from_reader(File::open(json).unwrap()).unwrap();
|
||||
assert!(properties.as_object().unwrap().len() > 100);
|
||||
assert!(properties.as_object().unwrap().contains_key("margin"));
|
||||
assert!(properties.as_object().unwrap().contains_key("margin-top"));
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn find_python() -> String {
|
||||
if Command::new("python2.7.exe")
|
||||
.arg("--version")
|
||||
.output()
|
||||
.is_ok()
|
||||
{
|
||||
return "python2.7.exe".to_owned();
|
||||
}
|
||||
|
||||
if Command::new("python27.exe")
|
||||
.arg("--version")
|
||||
.output()
|
||||
.is_ok()
|
||||
{
|
||||
return "python27.exe".to_owned();
|
||||
}
|
||||
|
||||
if Command::new("python.exe").arg("--version").output().is_ok() {
|
||||
return "python.exe".to_owned();
|
||||
}
|
||||
|
||||
panic!("Can't find python (tried python27.exe and python.exe)! Try fixing PATH or setting the PYTHON env var");
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn find_python() -> String {
|
||||
if Command::new("python2.7")
|
||||
.arg("--version")
|
||||
.output()
|
||||
.unwrap()
|
||||
.status
|
||||
.success()
|
||||
{
|
||||
"python2.7"
|
||||
} else {
|
||||
"python"
|
||||
}
|
||||
.to_owned()
|
||||
let longhands = properties["longhands"].as_object().unwrap();
|
||||
assert!(longhands.len() > 100);
|
||||
assert!(longhands.get("margin-top").is_some());
|
||||
assert!(properties["shorthands"].get("margin").is_some());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue