Fixed few tidy errors

This commit is contained in:
Sandeep Hegde 2017-10-25 11:27:26 -04:00
parent 445ab9ae8d
commit 58ab11cf9b
4 changed files with 41 additions and 13 deletions

View file

@ -1,10 +1,8 @@
{ {
"xmlhttprequest.rs": "xmlhttprequest.rs": [
[ "XMLHttpRequest"
"XMLHttpRequest"
], ],
"range.rs": "range.rs": [
[ "dom/ranges"
"dom/ranges"
] ]
} }

View file

@ -1,4 +1,12 @@
import sys # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
import subprocess import subprocess
subprocess.call('python python/servo/mutation/init.py components/script/dom', shell=True) subprocess.call('python python/servo/mutation/init.py components/script/dom', shell=True)

View file

@ -1,16 +1,27 @@
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
from os import listdir from os import listdir
from os.path import isfile, isdir, join from os.path import isfile, isdir, join
import json import json
import sys import sys
import test import test
def get_folders_list(path): def get_folders_list(path):
folder_list = [] folder_list = []
for filename in listdir(path): for filename in listdir(path):
if (isdir(join(path, filename))): if (isdir(join(path, filename))):
folder_name = join(path,filename) folder_name = join(path, filename)
folder_list.append(folder_name) folder_list.append(folder_name)
return(folder_list) return(folder_list)
def mutation_test_for(mutation_path): def mutation_test_for(mutation_path):
test_mapping_file = join(mutation_path, 'Test_mapping.json') test_mapping_file = join(mutation_path, 'Test_mapping.json')
@ -19,11 +30,11 @@ def mutation_test_for(mutation_path):
test_mapping = json.loads(json_data) test_mapping = json.loads(json_data)
for src_file in test_mapping.keys(): for src_file in test_mapping.keys():
test.mutation_test(join(mutation_path,src_file.encode('utf-8')), test_mapping[src_file]) test.mutation_test(join(mutation_path, src_file.encode('utf-8')), test_mapping[src_file])
for folder in get_folders_list(mutation_path): for folder in get_folders_list(mutation_path):
mutation_test_for(folder) mutation_test_for(folder)
else: else:
print ("This folder %s has no test mapping file." %(mutation_path)) print("This folder {0} has no test mapping file.".format(mutation_path))
mutation_test_for(sys.argv[1]) mutation_test_for(sys.argv[1])

View file

@ -1,8 +1,18 @@
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
import fileinput import fileinput
import re import re
import subprocess import subprocess
import sys import sys
def mutate_line(file_name, line_number): def mutate_line(file_name, line_number):
lines = open(file_name, 'r').readlines() lines = open(file_name, 'r').readlines()
lines[line_number - 1] = re.sub(r'\s&&\s', ' || ', lines[line_number - 1]) lines[line_number - 1] = re.sub(r'\s&&\s', ' || ', lines[line_number - 1])
@ -10,6 +20,7 @@ def mutate_line(file_name, line_number):
out.writelines(lines) out.writelines(lines)
out.close() out.close()
def mutation_test(file_name, tests): def mutation_test(file_name, tests):
lineNumbers = [] lineNumbers = []
for line in fileinput.input(file_name): for line in fileinput.input(file_name):