summaryrefslogtreecommitdiff
path: root/tools/checker/checker.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/checker/checker.py')
-rwxr-xr-xtools/checker/checker.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/checker/checker.py b/tools/checker/checker.py
index ed630e3d12..bc5e17da6a 100755
--- a/tools/checker/checker.py
+++ b/tools/checker/checker.py
@@ -17,6 +17,7 @@
import argparse
import os
+from common.archs import archs_list
from common.logger import Logger
from file_format.c1visualizer.parser import ParseC1visualizerStream
from file_format.checker.parser import ParseCheckerStream
@@ -34,6 +35,8 @@ def ParseArguments():
help="print a list of all passes found in the tested file")
parser.add_argument("--dump-pass", dest="dump_pass", metavar="PASS",
help="print a compiler pass dump")
+ parser.add_argument("--arch", dest="arch", choices=archs_list,
+ help="Run the tests for the specified target architecture.")
parser.add_argument("-q", "--quiet", action="store_true",
help="print only errors")
return parser.parse_args()
@@ -62,7 +65,7 @@ def DumpPass(outputFilename, passName):
def FindCheckerFiles(path):
""" Returns a list of files to scan for check annotations in the given path.
Path to a file is returned as a single-element list, directories are
- recursively traversed and all '.java' files returned.
+ recursively traversed and all '.java' and '.smali' files returned.
"""
if not path:
Logger.fail("No source path provided")
@@ -80,13 +83,13 @@ def FindCheckerFiles(path):
Logger.fail("Source path \"" + path + "\" not found")
-def RunTests(checkPrefix, checkPath, outputFilename):
+def RunTests(checkPrefix, checkPath, outputFilename, targetArch):
c1File = ParseC1visualizerStream(os.path.basename(outputFilename), open(outputFilename, "r"))
for checkFilename in FindCheckerFiles(checkPath):
checkerFile = ParseCheckerStream(os.path.basename(checkFilename),
checkPrefix,
open(checkFilename, "r"))
- MatchFiles(checkerFile, c1File)
+ MatchFiles(checkerFile, c1File, targetArch)
if __name__ == "__main__":
@@ -100,4 +103,4 @@ if __name__ == "__main__":
elif args.dump_pass:
DumpPass(args.tested_file, args.dump_pass)
else:
- RunTests(args.check_prefix, args.source_path, args.tested_file)
+ RunTests(args.check_prefix, args.source_path, args.tested_file, args.arch)