Skip to content

Commit a8c771b

Browse files
committed
Make a few misc. improvements
1 parent e51c38d commit a8c771b

File tree

1 file changed

+41
-7
lines changed

1 file changed

+41
-7
lines changed

project_future.py

+41-7
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,18 @@ def passes(self):
668668
def all(self):
669669
return [i for l in self.subresults.values() for i in l]
670670

671+
def recursive_all(self):
672+
stack = self.all()
673+
actions = []
674+
while stack:
675+
result = stack.pop(0)
676+
if isinstance(result, ActionResult):
677+
actions.append(result)
678+
else:
679+
for r in result.all():
680+
stack.insert(0, r)
681+
return actions
682+
671683
@property
672684
def result(self):
673685
if self.subresults[Result.FAIL]:
@@ -695,10 +707,14 @@ class ProjectListResult(ListResult):
695707
def __str__(self):
696708
output = ""
697709

698-
xfails = [ar for pr in self.all() for vr in pr.all() for ar in vr.xfails()]
699-
fails = [ar for pr in self.all() for vr in pr.all() for ar in vr.fails()]
700-
upasses = [ar for pr in self.all() for vr in pr.all() for ar in vr.upasses()]
701-
passes = [ar for pr in self.all() for vr in pr.all() for ar in vr.passes()]
710+
xfails = [ar for ar in self.recursive_all()
711+
if ar.result == Result.XFAIL]
712+
fails = [ar for ar in self.recursive_all()
713+
if ar.result == Result.FAIL]
714+
upasses = [ar for ar in self.recursive_all()
715+
if ar.result == Result.UPASS]
716+
passes = [ar for ar in self.recursive_all()
717+
if ar.result == Result.PASS]
702718

703719
if xfails:
704720
output += ('='*40) + '\n'
@@ -863,15 +879,14 @@ def __init__(self, swiftc, swift_version, swift_branch,
863879
added_xcodebuild_flags,
864880
skip_clean, build_config,
865881
strip_resource_phases,
866-
action, version, project):
882+
action, project):
867883
self.swiftc = swiftc
868884
self.swift_version = swift_version
869885
self.swift_branch = swift_branch
870886
set_swift_branch(swift_branch)
871887
self.sandbox_profile_xcodebuild = sandbox_profile_xcodebuild
872888
self.sandbox_profile_package = sandbox_profile_package
873889
self.project = project
874-
self.version = version
875890
self.action = action
876891
self.root_path = common.private_workspace('project_cache')
877892
self.current_platform = platform.system()
@@ -965,6 +980,26 @@ def succeeded(self, identifier):
965980

966981

967982
class CompatActionBuilder(ActionBuilder):
983+
def __init__(self,
984+
swiftc, swift_version, swift_branch,
985+
sandbox_profile_xcodebuild,
986+
sandbox_profile_package,
987+
added_swift_flags,
988+
added_xcodebuild_flags,
989+
skip_clean, build_config,
990+
strip_resource_phases,
991+
action, version, project):
992+
super(CompatActionBuilder, self).__init__(
993+
swiftc, swift_version, swift_branch,
994+
sandbox_profile_xcodebuild,
995+
sandbox_profile_package,
996+
added_swift_flags,
997+
added_xcodebuild_flags,
998+
skip_clean, build_config,
999+
strip_resource_phases,
1000+
action, project
1001+
)
1002+
self.version = version
9681003

9691004
def dispatch(self, identifier, stdout=sys.stdout, stderr=sys.stderr):
9701005
if not self.swift_version:
@@ -1032,7 +1067,6 @@ def failed(self, identifier, error):
10321067
)
10331068
if 'destination' in self.action:
10341069
error_str += ', ' + self.action['destination']
1035-
error_str += ', ' + str(error)
10361070
result = ActionResult(Result.FAIL, error_str)
10371071
common.debug_print(error_str)
10381072
return result

0 commit comments

Comments
 (0)