comparison mx/mx_graal.py @ 15323:6b3bb5a9a889

mx: allow to specify a path for the whitelist in the unittest command
author Bernhard Urban <bernhard.urban@jku.at>
date Wed, 23 Apr 2014 11:48:38 +0200
parents 404d29e8cee6
children 5b5f47104c0d
comparison
equal deleted inserted replaced
15322:404d29e8cee6 15323:6b3bb5a9a889
905 _unittestHelpSuffix = """ 905 _unittestHelpSuffix = """
906 Unittest options: 906 Unittest options:
907 907
908 --short-only run short testcases only 908 --short-only run short testcases only
909 --long-only run long testcases only 909 --long-only run long testcases only
910 --baseline-whitelist run only testcases which are known to 910 --whitelist run only testcases which are included
911 work with the baseline compiler 911 in the given whitelist
912 912
913 To avoid conflicts with VM options '--' can be used as delimiter. 913 To avoid conflicts with VM options '--' can be used as delimiter.
914 914
915 If filters are supplied, only tests whose fully qualified name 915 If filters are supplied, only tests whose fully qualified name
916 includes a filter as a substring are run. 916 includes a filter as a substring are run.
946 epilog=_unittestHelpSuffix, 946 epilog=_unittestHelpSuffix,
947 ) 947 )
948 group = parser.add_mutually_exclusive_group() 948 group = parser.add_mutually_exclusive_group()
949 group.add_argument('--short-only', action='store_true', help='run short testcases only') 949 group.add_argument('--short-only', action='store_true', help='run short testcases only')
950 group.add_argument('--long-only', action='store_true', help='run long testcases only') 950 group.add_argument('--long-only', action='store_true', help='run long testcases only')
951 parser.add_argument('--baseline-whitelist', action='store_true', help='run baseline testcases only') 951 parser.add_argument('--whitelist', help='run testcases specified in whitelist only', metavar='<path>')
952 952
953 ut_args = [] 953 ut_args = []
954 delimiter = False 954 delimiter = False
955 # check for delimiter 955 # check for delimiter
956 while len(args) > 0: 956 while len(args) > 0:
966 else: 966 else:
967 # parse all know arguments 967 # parse all know arguments
968 parsed_args, args = parser.parse_known_args(ut_args) 968 parsed_args, args = parser.parse_known_args(ut_args)
969 969
970 whitelist = None 970 whitelist = None
971 if parsed_args.baseline_whitelist: 971 if parsed_args.whitelist:
972 baseline_whitelist_file = 'test/baseline_whitelist.txt'
973 try: 972 try:
974 with open(join(_graal_home, baseline_whitelist_file)) as fp: 973 with open(join(_graal_home, parsed_args.whitelist)) as fp:
975 whitelist = [l.rstrip() for l in fp.readlines()] 974 whitelist = [l.rstrip() for l in fp.readlines()]
976 except IOError: 975 except IOError:
977 mx.log('warning: could not read baseline whitelist: ' + baseline_whitelist_file) 976 mx.log('warning: could not read whitelist: ' + parsed_args.whitelist)
978 977
979 if parsed_args.short_only: 978 if parsed_args.short_only:
980 annotations = ['@Test'] 979 annotations = ['@Test']
981 else: 980 else:
982 annotations = ['@Test', '@Parameters'] 981 annotations = ['@Test', '@Parameters']