From bfe460de9e482bdd40b6ec6f702d612d1bb5b43b Mon Sep 17 00:00:00 2001 From: askeing Date: Thu, 14 Apr 2016 15:55:25 +0800 Subject: [PATCH] Package tidy - Modified the testing commands - Added the requirements - Moved python/tidy/tests to python/tidy/servo_tidy_tests for self tidy tests --- python/mach_bootstrap.py | 1 + python/requirements.txt | 2 ++ python/servo/testing_commands.py | 6 +++--- python/tidy/{tests => servo_tidy_tests}/__init__.py | 0 .../tidy/{tests => servo_tidy_tests}/incorrect_license.rs | 0 python/tidy/{tests => servo_tidy_tests}/long_line.rs | 0 python/tidy/{tests => servo_tidy_tests}/rust_tidy.rs | 0 python/tidy/{tests => servo_tidy_tests}/spec.webidl | 0 python/tidy/{tests => servo_tidy_tests}/speclink.rs | 0 python/tidy/{tests => servo_tidy_tests}/test.toml | 0 python/tidy/{tests => servo_tidy_tests}/test_tidy.py | 2 +- python/tidy/{tests => servo_tidy_tests}/tidy_self_test.py | 0 python/tidy/{tests => servo_tidy_tests}/whatwg_link.rs | 0 python/tidy/{tests => servo_tidy_tests}/wrong_space.rs | 0 14 files changed, 7 insertions(+), 4 deletions(-) rename python/tidy/{tests => servo_tidy_tests}/__init__.py (100%) rename python/tidy/{tests => servo_tidy_tests}/incorrect_license.rs (100%) rename python/tidy/{tests => servo_tidy_tests}/long_line.rs (100%) rename python/tidy/{tests => servo_tidy_tests}/rust_tidy.rs (100%) rename python/tidy/{tests => servo_tidy_tests}/spec.webidl (100%) rename python/tidy/{tests => servo_tidy_tests}/speclink.rs (100%) rename python/tidy/{tests => servo_tidy_tests}/test.toml (100%) rename python/tidy/{tests => servo_tidy_tests}/test_tidy.py (98%) rename python/tidy/{tests => servo_tidy_tests}/tidy_self_test.py (100%) rename python/tidy/{tests => servo_tidy_tests}/whatwg_link.rs (100%) rename python/tidy/{tests => servo_tidy_tests}/wrong_space.rs (100%) diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py index 05b21c4fdfa..e77c78e0851 100644 --- a/python/mach_bootstrap.py +++ b/python/mach_bootstrap.py @@ -13,6 +13,7 @@ from pipes import quote SEARCH_PATHS = [ os.path.join("python", "mach"), + os.path.join("python", "tidy"), os.path.join("tests", "wpt"), os.path.join("tests", "wpt", "harness"), ] diff --git a/python/requirements.txt b/python/requirements.txt index 5d6602fc7ba..2a7c0437183 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -13,3 +13,5 @@ pyflakes == 0.8.0 # For test-webidl ply == 3.8 + +servo_tidy == 0.0.1 diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index ea7cb7e50b8..66a2da5be3e 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -29,8 +29,8 @@ from mach.decorators import ( from servo.command_base import CommandBase, call, check_call from wptrunner import wptcommandline from update import updatecommandline -import tidy -from tidy_self_test import tidy_self_test +from servo_tidy import tidy +from servo_tidy_tests import test_tidy SCRIPT_PATH = os.path.split(__file__)[0] PROJECT_TOPLEVEL_PATH = os.path.abspath(os.path.join(SCRIPT_PATH, "..", "..")) @@ -279,7 +279,7 @@ class MachCommands(CommandBase): help="Run unit tests for tidy") def test_tidy(self, faster, no_progress, self_test): if self_test: - return tidy_self_test.do_tests() + return test_tidy.do_tests() else: return tidy.scan(faster, not no_progress) diff --git a/python/tidy/tests/__init__.py b/python/tidy/servo_tidy_tests/__init__.py similarity index 100% rename from python/tidy/tests/__init__.py rename to python/tidy/servo_tidy_tests/__init__.py diff --git a/python/tidy/tests/incorrect_license.rs b/python/tidy/servo_tidy_tests/incorrect_license.rs similarity index 100% rename from python/tidy/tests/incorrect_license.rs rename to python/tidy/servo_tidy_tests/incorrect_license.rs diff --git a/python/tidy/tests/long_line.rs b/python/tidy/servo_tidy_tests/long_line.rs similarity index 100% rename from python/tidy/tests/long_line.rs rename to python/tidy/servo_tidy_tests/long_line.rs diff --git a/python/tidy/tests/rust_tidy.rs b/python/tidy/servo_tidy_tests/rust_tidy.rs similarity index 100% rename from python/tidy/tests/rust_tidy.rs rename to python/tidy/servo_tidy_tests/rust_tidy.rs diff --git a/python/tidy/tests/spec.webidl b/python/tidy/servo_tidy_tests/spec.webidl similarity index 100% rename from python/tidy/tests/spec.webidl rename to python/tidy/servo_tidy_tests/spec.webidl diff --git a/python/tidy/tests/speclink.rs b/python/tidy/servo_tidy_tests/speclink.rs similarity index 100% rename from python/tidy/tests/speclink.rs rename to python/tidy/servo_tidy_tests/speclink.rs diff --git a/python/tidy/tests/test.toml b/python/tidy/servo_tidy_tests/test.toml similarity index 100% rename from python/tidy/tests/test.toml rename to python/tidy/servo_tidy_tests/test.toml diff --git a/python/tidy/tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py similarity index 98% rename from python/tidy/tests/test_tidy.py rename to python/tidy/servo_tidy_tests/test_tidy.py index b2dad4f0e54..f49f6d9a23d 100644 --- a/python/tidy/tests/test_tidy.py +++ b/python/tidy/servo_tidy_tests/test_tidy.py @@ -12,7 +12,7 @@ from servo_tidy import tidy def iterFile(name): - return iter(['tests/' + name]) + return iter(['python/tidy/servo_tidy_tests/' + name]) class CheckTidiness(unittest.TestCase): diff --git a/python/tidy/tests/tidy_self_test.py b/python/tidy/servo_tidy_tests/tidy_self_test.py similarity index 100% rename from python/tidy/tests/tidy_self_test.py rename to python/tidy/servo_tidy_tests/tidy_self_test.py diff --git a/python/tidy/tests/whatwg_link.rs b/python/tidy/servo_tidy_tests/whatwg_link.rs similarity index 100% rename from python/tidy/tests/whatwg_link.rs rename to python/tidy/servo_tidy_tests/whatwg_link.rs diff --git a/python/tidy/tests/wrong_space.rs b/python/tidy/servo_tidy_tests/wrong_space.rs similarity index 100% rename from python/tidy/tests/wrong_space.rs rename to python/tidy/servo_tidy_tests/wrong_space.rs