From 740f6b8f06f7d6d722ca16ca3d9d537a1f089b2f Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Wed, 27 Feb 2019 15:10:20 +0100 Subject: rewriter: Implemented a CLI --- run_unittests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index 9c4d904..192b533 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -5196,7 +5196,7 @@ class RewriterTests(BasePlatformTests): def prime(self, dirname): copy_tree(os.path.join(self.rewrite_test_dir, dirname), self.builddir) - def rewrite(self, directory, args): + def rewrite_raw(self, directory, args): if isinstance(args, str): args = [args] command = self.rewrite_command + ['--sourcedir', directory] + args @@ -5209,6 +5209,11 @@ class RewriterTests(BasePlatformTests): raise subprocess.CalledProcessError(p.returncode, command, output=p.stdout) return p.stdout + def rewrite(self, directory, args): + if isinstance(args, str): + args = [args] + return self.rewrite_raw(directory, ['command'] + args) + def extract_test_data(self, out): match = RewriterTests.data_regex.match(out) result = {} -- cgit v1.1