diff --git a/tests/runtest.py b/tests/runtest.py index 62f30676e92a..86aa73d616c6 100755 --- a/tests/runtest.py +++ b/tests/runtest.py @@ -18,12 +18,12 @@ # The xunit runner currently relies on tests being built on the same host as the # target platform. This requires all tests run on linux x64 to be built by the # same platform and arch. If this is not done, the tests will run correctly; -# however, excpect failures due to incorrect exclusions in the xunit +# however, expect failures due to incorrect exclusions in the xunit # wrappers setup at build time. # -# Note that for linux targets the native componants to the tests are still built +# Note that for linux targets the native components to the tests are still built # by the product build. This requires all native components to be either copied -# into the Core_Root directory or the test's managed directory. The later is +# into the Core_Root directory or the test's managed directory. The latter is # prone to failure; however, copying into the Core_Root directory may create # naming conflicts. # @@ -71,12 +71,12 @@ The xunit runner currently relies on tests being built on the same host as the target platform. This requires all tests run on linux x64 to be built by the same platform and arch. If this is not done, the tests will run correctly; -however, excpect failures due to incorrect exclusions in the xunit +however, expect failures due to incorrect exclusions in the xunit wrappers setup at build time. -Note that for linux targets the native componants to the tests are still built +Note that for linux targets the native components to the tests are still built by the product build. This requires all native components to be either copied -into the Core_Root directory or the test's managed directory. The later is +into the Core_Root directory or the test's managed directory. The latter is prone to failure; however, copying into the Core_Root directory may create naming conflicts. @@ -349,7 +349,7 @@ def __create_bash_wrapper__(self): # the tests. # # In order to change how this wrapper is generated, see -# runtest.py:__create_batch_wrapper__(). Please note that it is possible +# runtest.py:__create_bash_wrapper__(). Please note that it is possible # to recreate this file by running tests/runtest.py --analyze_results_only # with the appropriate environment set and the correct arch and build_type # passed. @@ -773,8 +773,7 @@ def setup_args(args): test_native_bin_location = os.path.join(os.path.join(coreclr_repo_location, "bin", "obj", "%s.%s.%s" % (host_os, arch, build_type), "tests")) print "Native bin location: %s" % test_native_bin_location print - - if host_os != "Windows_NT": + if not os.path.isdir(test_native_bin_location): print "Error, test_native_bin_location: %s, does not exist." % test_native_bin_location sys.exit(1) diff --git a/tests/scripts/issues_targets_helper.py b/tests/scripts/issues_targets_helper.py deleted file mode 100644 index c38d0f013885..000000000000 --- a/tests/scripts/issues_targets_helper.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env python -# -## Licensed to the .NET Foundation under one or more agreements. -## The .NET Foundation licenses this file to you under the MIT license. -## See the LICENSE file in the project root for more information. -# -## -# Title :issues_targets_helper.py -# -# Script to help working with issues.targets -# -################################################################################ - -import argparse -import datetime -import json -import os -import platform -import shutil -import subprocess -import sys -import tempfile -import re -import string - -import xml.etree.ElementTree - -from collections import defaultdict -from sys import platform as _platform - -################################################################################ -# Argument Parser -################################################################################ - -description = ("""Script to help working with issues.targets. Specifically it - allows adding tests for a specific os/arch. It will also - de-dup and sort the exclusion list.""") - -# Use either - or / to designate switches. -parser = argparse.ArgumentParser(description=description, prefix_chars='-/') - -parser.add_argument("-arch", dest="arch", nargs='?', default="x64") -parser.add_argument("-core_root", dest="core_root", nargs='?', default=None) -parser.add_argument("-coreclr_repo_location", dest="coreclr_repo_location", default=os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) - -################################################################################ -# Classes -################################################################################ - -class ExcludeList: - def __init__(self, exclude_list_location): - assert os.path.isfile(exclude_list_location) - self.exclude_list_location = exclude_list_location - - project = xml.etree.ElementTree.parse(exclude_list_location).getroot() - - self.exclude_list = defaultdict(lambda: None) - - for exclude_list_element in project: - conditions = exclude_list_element.attrib['Condition'] - - arch = "any" - host_os = "any" - build_against_packages = False - - conditions = conditions.split("and") - for condition in conditions: - if "$(BuildArch)" in condition: - arch = condition.split("==")[1] - arch = re.sub("[" + " " + string.punctuation + "]", "", arch) - - if "$(TargetsWindows)" in condition: - host_os = "windows" if "==" in condition else "unix" - - if "$(BuildTestsAgainstPackages)" in condition: - build_against_packages = True if "==" in condition else False - - if self.exclude_list[host_os] is None: - self.exclude_list[host_os] = defaultdict(lambda: None) - - if self.exclude_list[host_os][arch] is None: - self.exclude_list[host_os][arch] = defaultdict(lambda: None) - - if self.exclude_list[host_os][arch][build_against_packages] is None: - self.exclude_list[host_os][arch][build_against_packages] = defaultdict(lambda: None) - - exclude_list = [] - for exclude_element in exclude_list_element: - issue = exclude_element[0].text - - if self.exclude_list[host_os][arch][build_against_packages][exclude_element.attrib["Include"]] is not None: - pass - self.exclude_list[host_os][arch][build_against_packages][exclude_element.attrib["Include"]] = issue - - def write(self, exclude_list_location): - """ Write out the exclude list with any changes. - """ - - project = xml.etree.ElementTree.Element("Project") - - - all_excludes = [(key, self.exclude_list["any"]["any"][key]) for key in self.exclude_list["any"]["any"]] - all_excludes.sort(lambda x, y: x[1] < y[1]) - - pass - - -################################################################################ -# Main -################################################################################ - -def main(args): - issues_targets_location = os.path.join(args.coreclr_repo_location, "tests", "issues.targets") - - exclude_list = ExcludeList(issues_targets_location) - exclude_list.write(issues_targets_location + ".new") - pass - -################################################################################ -# __main__ -################################################################################ - -if __name__ == "__main__": - args = parser.parse_args() - sys.exit(main(args)) \ No newline at end of file