aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/mutation/test.py
diff options
context:
space:
mode:
authorSandeep Hegde <dsandeephegde@gmail.com>2017-10-24 22:16:48 -0400
committerSandeep Hegde <dsandeephegde@gmail.com>2017-11-06 13:00:12 -0500
commitba2152900cc0aa82e62905033e943fb3e4320945 (patch)
tree087e04d17b1483bae08bab3b306d6fd6497a6c77 /python/servo/mutation/test.py
parent0d2ad9a5beebfb2ac19e99139dd6ddb747bb4bbb (diff)
downloadservo-ba2152900cc0aa82e62905033e943fb3e4320945.tar.gz
servo-ba2152900cc0aa82e62905033e943fb3e4320945.zip
Added Test Mapping framework and running through a path.
Diffstat (limited to 'python/servo/mutation/test.py')
-rw-r--r--python/servo/mutation/test.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/python/servo/mutation/test.py b/python/servo/mutation/test.py
index 790789f3fdd..533e7cffe4b 100644
--- a/python/servo/mutation/test.py
+++ b/python/servo/mutation/test.py
@@ -10,7 +10,7 @@ def mutate_line(file_name, line_number):
out.writelines(lines)
out.close()
-def mutation_test(file_name):
+def mutation_test(file_name, tests):
lineNumbers = []
for line in fileinput.input(file_name):
if re.search(r'\s&&\s', line):
@@ -21,17 +21,16 @@ def mutation_test(file_name):
mutate_line(file_name, lineToMutate)
print "compling mutant {0}-{1}".format(file_name, lineToMutate)
sys.stdout.flush()
- subprocess.call('python mach build --release', shell=True)
+ #subprocess.call('python mach build --release', shell=True)
print "running tests for mutant {0}-{1}".format(file_name, lineToMutate)
sys.stdout.flush()
- testStatus = subprocess.call('python mach test-wpt XMLHttpRequest --release', shell=True)
- if testStatus != 0:
- print('Failed in while running `python mach test-wpt XMLHttpRequest --release`')
- print "mutated file {0} diff".format(file_name)
- sys.stdout.flush()
- subprocess.call('git --no-pager diff {0}'.format(file_name), shell=True)
+ for test in tests:
+ testStatus = subprocess.call("python mach test-wpt {0} --release".format(test.encode('utf-8')), shell=True)
+ if testStatus != 0:
+ print('Failed in while running `python mach test-wpt {0} --release`'.format(test.encode('utf-8')))
+ print "mutated file {0} diff".format(file_name)
+ sys.stdout.flush()
+ subprocess.call('git --no-pager diff {0}'.format(file_name), shell=True)
print "reverting mutant {0}-{1}".format(file_name, lineToMutate)
sys.stdout.flush()
subprocess.call('git checkout {0}'.format(file_name), shell=True)
-
-mutation_test('components/script/dom/xmlhttprequest.rs')