Ejemplo n.º 1
0
def run_for_fleet(ndk_path, fleet, out_dir, log_dir, test_filter, use_color=False):
    # Note that we are duplicating some testing here.
    #
    # * The awk tests only need to be run once because they do not vary by
    #   configuration.
    # * The build tests only vary per-device by the PIE configuration, so we
    #   only need to run them twice per ABI/toolchain.
    # * The build tests are already run as a part of the build process.
    results = []
    details = {}
    good = True
    for version in fleet.get_versions():
        details[version] = {}
        for abi in fleet.get_abis(version):
            details[version][abi] = {}
            device = fleet.get_device(version, abi)
            for toolchain in ("clang", "4.9"):
                if device is None:
                    results.append("android-{} {} {}: {}".format(version, abi, toolchain, "SKIP"))
                    continue

                details[version][abi][toolchain] = None

                result, run_details = run_tests(ndk_path, device, abi, toolchain, out_dir, log_dir, test_filter)
                pass_label = util.maybe_color("PASS", "green", use_color)
                fail_label = util.maybe_color("FAIL", "red", use_color)
                results.append(
                    "android-{} {} {}: {}".format(version, abi, toolchain, pass_label if result else fail_label)
                )
                details[version][abi][toolchain] = run_details
                if not result:
                    good = False

    print("\n".join(results))
    return good, details
Ejemplo n.º 2
0
def run_for_fleet(ndk_path,
                  fleet,
                  out_dir,
                  log_dir,
                  test_filter,
                  use_color=False):
    # Note that we are duplicating some testing here.
    #
    # * The awk tests only need to be run once because they do not vary by
    #   configuration.
    # * The build tests only vary per-device by the PIE configuration, so we
    #   only need to run them twice per ABI/toolchain.
    # * The build tests are already run as a part of the build process.
    results = []
    details = {}
    good = True
    for version in fleet.get_versions():
        details[version] = {}
        for abi in fleet.get_abis(version):
            details[version][abi] = {}
            device = fleet.get_device(version, abi)
            for toolchain in ('clang', '4.9'):
                if device is None:
                    results.append('android-{} {} {}: {}'.format(
                        version, abi, toolchain, 'SKIP'))
                    continue

                details[version][abi][toolchain] = None

                result, run_details = run_tests(ndk_path, device, abi,
                                                toolchain, out_dir, log_dir,
                                                test_filter)
                pass_label = util.maybe_color('PASS', 'green', use_color)
                fail_label = util.maybe_color('FAIL', 'red', use_color)
                results.append('android-{} {} {}: {}'.format(
                    version, abi, toolchain,
                    pass_label if result else fail_label))
                details[version][abi][toolchain] = run_details
                if not result:
                    good = False

    print('\n'.join(results))
    return good, details
Ejemplo n.º 3
0
 def to_string(self, colored=False):
     label = util.maybe_color('SHOULD FAIL', 'red', colored)
     return '{} {}: unexpected success for {} ({})'.format(
         label, self.test_name, self.config, self.bug)
Ejemplo n.º 4
0
 def to_string(self, colored=False):
     label = util.maybe_color('KNOWN FAIL', 'yellow', colored)
     return '{} {}: known failure for {} ({})'.format(
         label, self.test_name, self.config, self.bug)
Ejemplo n.º 5
0
 def to_string(self, colored=False):
     label = util.maybe_color('SKIP', 'yellow', colored)
     return '{} {}: {}'.format(label, self.test_name, self.reason)
Ejemplo n.º 6
0
 def to_string(self, colored=False):
     label = util.maybe_color('PASS', 'green', colored)
     return '{} {}'.format(label, self.test_name)
Ejemplo n.º 7
0
 def to_string(self, colored=False):
     label = util.maybe_color('FAIL', 'red', colored)
     return '{} {}: {}'.format(label, self.test_name, self.message)
 def to_string(self, colored=False):
     label = util.maybe_color('SHOULD FAIL', 'red', colored)
     return '{} {}: unexpected success for {} ({})'.format(
         label, self.test_name, self.config, self.bug)
 def to_string(self, colored=False):
     label = util.maybe_color('KNOWN FAIL', 'yellow', colored)
     return '{} {}: known failure for {} ({})'.format(
         label, self.test_name, self.config, self.bug)
Ejemplo n.º 10
0
 def to_string(self, colored=False):
     label = util.maybe_color('SKIP', 'yellow', colored)
     return '{} {}: {}'.format(label, self.test_name, self.reason)
Ejemplo n.º 11
0
 def to_string(self, colored=False):
     label = util.maybe_color('PASS', 'green', colored)
     return '{} {}'.format(label, self.test_name)
Ejemplo n.º 12
0
 def to_string(self, colored=False):
     label = util.maybe_color('FAIL', 'red', colored)
     return '{} {}: {}'.format(label, self.test_name, self.message)