mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Merge msg and msg_tests
This commit is contained in:
parent
671b69c0b7
commit
a17a1fd06e
6 changed files with 21 additions and 48 deletions
9
Cargo.lock
generated
9
Cargo.lock
generated
|
@ -1916,15 +1916,8 @@ dependencies = [
|
|||
"malloc_size_of_derive 0.0.1",
|
||||
"nonzero 0.0.1",
|
||||
"serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webrender_api 0.56.1 (git+https://github.com/servo/webrender)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "msg_tests"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"msg 0.0.1",
|
||||
"size_of_test 0.0.1",
|
||||
"webrender_api 0.56.1 (git+https://github.com/servo/webrender)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -8,6 +8,8 @@ publish = false
|
|||
[lib]
|
||||
name = "msg"
|
||||
path = "lib.rs"
|
||||
test = false
|
||||
doctest = false
|
||||
|
||||
[features]
|
||||
unstable = ["nonzero/unstable"]
|
||||
|
@ -19,3 +21,6 @@ malloc_size_of_derive = { path = "../malloc_size_of_derive" }
|
|||
nonzero = {path = "../nonzero"}
|
||||
serde = "1.0.14"
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
|
||||
[dev-dependencies]
|
||||
size_of_test = {path = "../size_of_test"}
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#![cfg(target_pointer_width = "64")]
|
||||
|
||||
extern crate msg;
|
||||
#[macro_use] extern crate size_of_test;
|
||||
|
||||
use msg::constellation_msg::BrowsingContextId;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use msg::constellation_msg::TopLevelBrowsingContextId;
|
|
@ -231,27 +231,18 @@ class MachCommands(CommandBase):
|
|||
else:
|
||||
test_patterns.append(test)
|
||||
|
||||
in_crate_packages = []
|
||||
|
||||
# Since the selectors tests have no corresponding selectors_tests crate in tests/unit,
|
||||
# we need to treat them separately from those that do.
|
||||
try:
|
||||
packages.remove('selectors')
|
||||
in_crate_packages += ["selectors"]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
self_contained_tests = ["msg", "selectors"]
|
||||
if not packages:
|
||||
packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit"))) - set(['.DS_Store'])
|
||||
in_crate_packages += ["selectors"]
|
||||
packages |= set(self_contained_tests)
|
||||
|
||||
# Since the selectors tests have no corresponding selectors_tests crate in tests/unit,
|
||||
# we need to treat them separately from those that do.
|
||||
try:
|
||||
packages.remove('selectors')
|
||||
in_crate_packages += ["selectors"]
|
||||
except KeyError:
|
||||
pass
|
||||
in_crate_packages = []
|
||||
for crate in self_contained_tests:
|
||||
try:
|
||||
packages.remove(crate)
|
||||
in_crate_packages += [crate]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
packages.discard('stylo')
|
||||
|
||||
|
@ -264,7 +255,7 @@ class MachCommands(CommandBase):
|
|||
env["PATH"] = "%s%s%s" % (path.dirname(self.get_binary_path(False, False)), os.pathsep, env["PATH"])
|
||||
|
||||
features = self.servo_features()
|
||||
if len(packages) > 0:
|
||||
if len(packages) > 0 or len(in_crate_packages) > 0:
|
||||
args = ["cargo", "bench" if bench else "test", "--manifest-path", self.servo_manifest()]
|
||||
for crate in packages:
|
||||
args += ["-p", "%s_tests" % crate]
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
[package]
|
||||
name = "msg_tests"
|
||||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
|
||||
[lib]
|
||||
name = "msg_tests"
|
||||
path = "lib.rs"
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
msg = {path = "../../../components/msg"}
|
||||
size_of_test = {path = "../../../components/size_of_test"}
|
|
@ -1,7 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#[cfg(all(test, target_pointer_width = "64"))] extern crate msg;
|
||||
#[cfg(all(test, target_pointer_width = "64"))] #[macro_use] extern crate size_of_test;
|
||||
#[cfg(all(test, target_pointer_width = "64"))] mod size_of;
|
Loading…
Add table
Add a link
Reference in a new issue