Skip to content

Commit

Permalink
servo: Merge #19338 - Replace compiletest suite by doc-tests with `co…
Browse files Browse the repository at this point in the history
…mpile_fail` (from servo:compiletest); r=nox

`compiletest-rs` use internal rustc APIs and is broken in today’s Nightly. rustdoc however is maintained with rustc and so much less fragile.

Closes #9945.

Source-Repo: https://github.com/servo/servo
Source-Revision: 5213e2a5a9ed8859a004e480f52c7e04f8d7f85e

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 4549a7b8d21ba3085be304d96d93b958f1a83655
  • Loading branch information
SimonSapin committed Nov 22, 2017
1 parent f129b7e commit b8801af
Show file tree
Hide file tree
Showing 20 changed files with 267 additions and 244 deletions.
54 changes: 25 additions & 29 deletions servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion servo/etc/ci/buildbot_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ linux-dev:
- ./mach test-tidy --no-progress --all
- ./mach test-tidy --no-progress --self-test
- env CC=gcc-5 CXX=g++-5 ./mach build --dev
- env ./mach test-compiletest
- env ./mach test-unit
- env ./mach package --dev
- env ./mach build-cef
Expand Down
4 changes: 0 additions & 4 deletions servo/etc/rustdoc-with-private

This file was deleted.

5 changes: 3 additions & 2 deletions servo/ports/servo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ test = false
bench = false

[dev-dependencies]
compiletest_helper = {path = "../../tests/compiletest/helper"}
deny_public_fields_tests = {path = "../../tests/unit/deny_public_fields"}
gfx_tests = {path = "../../tests/unit/gfx"}
layout_tests = {path = "../../tests/unit/layout"}
malloc_size_of_tests = {path = "../../tests/unit/malloc_size_of"}
metrics_tests = {path = "../../tests/unit/metrics"}
msg_tests = {path = "../../tests/unit/msg"}
net_tests = {path = "../../tests/unit/net"}
net_traits_tests = {path = "../../tests/unit/net_traits"}
plugin_compiletest = {path = "../../tests/compiletest/plugin"}
profile_tests = {path = "../../tests/unit/profile"}
script_tests = {path = "../../tests/unit/script"}
script_plugins_tests = {path = "../../tests/unit/script_plugins"}
servo_config_tests = {path = "../../tests/unit/servo_config"}
servo_remutex_tests = {path = "../../tests/unit/servo_remutex"}
style_tests = {path = "../../tests/unit/style"}
Expand Down
2 changes: 1 addition & 1 deletion servo/python/servo/command_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def package_dir(package):
if hosts_file_path:
env['HOST_FILE'] = hosts_file_path

env['RUSTDOC'] = path.join(self.context.topdir, 'etc', 'rustdoc-with-private')
env['RUSTDOCFLAGS'] = "--document-private-items"

if self.config["build"]["rustflags"]:
env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " " + self.config["build"]["rustflags"]
Expand Down
61 changes: 0 additions & 61 deletions servo/python/servo/testing_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
("unit", {"kwargs": {},
"paths": [path.abspath(path.join("tests", "unit"))],
"include_arg": "test_name"}),
("compiletest", {"kwargs": {"release": False},
"paths": [path.abspath(path.join("tests", "compiletest"))],
"include_arg": "test_name"})
])

TEST_SUITES_BY_PREFIX = {path: k for k, v in TEST_SUITES.iteritems() if "paths" in v for path in v["paths"]}
Expand Down Expand Up @@ -117,7 +114,6 @@ def test(self, params, render_mode=DEFAULT_RENDER_MODE, release=False, tidy_all=
"stylo": False}
suites["wpt"]["kwargs"] = {"release": release}
suites["unit"]["kwargs"] = {}
suites["compiletest"]["kwargs"] = {"release": release}

selected_suites = OrderedDict()

Expand Down Expand Up @@ -302,63 +298,6 @@ def test_stylo(self, release=False, test_name=None):
with cd(path.join("ports", "geckolib")):
return call(args, env=env)

@Command('test-compiletest',
description='Run compiletests',
category='testing')
@CommandArgument('--package', '-p', default=None, help="Specific package to test")
@CommandArgument('test_name', nargs=argparse.REMAINDER,
help="Only run tests that match this pattern or file path")
@CommandArgument('--release', default=False, action="store_true",
help="Run with a release build of servo")
def test_compiletest(self, test_name=None, package=None, release=False):
if test_name is None:
test_name = []

self.ensure_bootstrapped()

if package:
packages = {package}
else:
packages = set()

test_patterns = []
for test in test_name:
# add package if 'tests/compiletest/<package>'
match = re.search("tests/compiletest/(\\w+)/?$", test)
if match:
packages.add(match.group(1))
# add package & test if '<package>/<test>', 'tests/compiletest/<package>/<test>.rs', or similar
elif re.search("\\w/\\w", test):
tokens = test.split("/")
packages.add(tokens[-2])
test_prefix = tokens[-1]
if test_prefix.endswith(".rs"):
test_prefix = test_prefix[:-3]
test_prefix += "::"
test_patterns.append(test_prefix)
# add test as-is otherwise
else:
test_patterns.append(test)

if not packages:
packages = set(os.listdir(path.join(self.context.topdir, "tests", "compiletest"))) - set(['.DS_Store'])

packages.remove("helper")

args = ["cargo", "test"]
for crate in packages:
args += ["-p", "%s_compiletest" % crate]
args += test_patterns

env = self.build_env()
if release:
env["BUILD_MODE"] = "release"
args += ["--release"]
else:
env["BUILD_MODE"] = "debug"

return call(args, env=env, cwd=self.servo_crate())

@Command('test-content',
description='Run the content tests',
category='testing')
Expand Down
28 changes: 0 additions & 28 deletions servo/tests/compiletest/helper/lib.rs

This file was deleted.

16 changes: 0 additions & 16 deletions servo/tests/compiletest/plugin/Cargo.toml

This file was deleted.

This file was deleted.

This file was deleted.

27 changes: 0 additions & 27 deletions servo/tests/compiletest/plugin/compile-fail/unrooted_must_root.rs

This file was deleted.

10 changes: 0 additions & 10 deletions servo/tests/compiletest/plugin/lib.rs

This file was deleted.

12 changes: 12 additions & 0 deletions servo/tests/unit/deny_public_fields/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "deny_public_fields_tests"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"

[lib]
path = "lib.rs"
test = false

[dependencies]
deny_public_fields = {path = "../../../components/deny_public_fields"}
Loading

0 comments on commit b8801af

Please sign in to comment.