Skip to content

Commit

Permalink
Declare use of testResultsOverview build service
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Sep 11, 2024
1 parent 504fd62 commit 545e370
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,9 +40,10 @@ public void apply(Project project) {
.getSharedServices()
.registerIfAbsent("testResultsOverview", TestResultsOverview.class, (spec) -> {
});
project.getTasks()
.withType(Test.class,
(test) -> test.addTestListener(new FailureRecordingTestListener(testResultsOverview, test)));
project.getTasks().withType(Test.class, (test) -> {
test.usesService(testResultsOverview);
test.addTestListener(new FailureRecordingTestListener(testResultsOverview, test));
});
}

private final class FailureRecordingTestListener implements TestListener {
Expand Down

0 comments on commit 545e370

Please sign in to comment.