Skip to content

Commit ba80bb9

Browse files
Initial work on filtering code coverage by test size
1 parent 24dc6fc commit ba80bb9

41 files changed

Lines changed: 1474 additions & 836 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Data/ProcessedClassType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ final class ProcessedClassType
2626
public readonly int $startLine;
2727
public int $executableLines;
2828
public int $executedLines;
29+
public int $executedLinesBySmallTests = 0;
30+
public int $executedLinesByMediumTests = 0;
31+
public int $executedLinesByLargeTests = 0;
32+
public int $executedLinesBySmallOrMediumTests = 0;
33+
public int $executedLinesBySmallOrMediumOrLargeTests = 0;
2934
public int $executableBranches;
3035
public int $executedBranches;
3136
public int $executablePaths;

src/Data/ProcessedFunctionType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ final class ProcessedFunctionType
2323
public readonly int $endLine;
2424
public int $executableLines;
2525
public int $executedLines;
26+
public int $executedLinesBySmallTests = 0;
27+
public int $executedLinesByMediumTests = 0;
28+
public int $executedLinesByLargeTests = 0;
29+
public int $executedLinesBySmallOrMediumTests = 0;
30+
public int $executedLinesBySmallOrMediumOrLargeTests = 0;
2631
public int $executableBranches;
2732
public int $executedBranches;
2833
public int $executablePaths;

src/Data/ProcessedMethodType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ final class ProcessedMethodType
2323
public readonly int $endLine;
2424
public int $executableLines;
2525
public int $executedLines;
26+
public int $executedLinesBySmallTests = 0;
27+
public int $executedLinesByMediumTests = 0;
28+
public int $executedLinesByLargeTests = 0;
29+
public int $executedLinesBySmallOrMediumTests = 0;
30+
public int $executedLinesBySmallOrMediumOrLargeTests = 0;
2631
public int $executableBranches;
2732
public int $executedBranches;
2833
public int $executablePaths;

src/Data/ProcessedTraitType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ final class ProcessedTraitType
2626
public readonly int $startLine;
2727
public int $executableLines;
2828
public int $executedLines;
29+
public int $executedLinesBySmallTests = 0;
30+
public int $executedLinesByMediumTests = 0;
31+
public int $executedLinesByLargeTests = 0;
32+
public int $executedLinesBySmallOrMediumTests = 0;
33+
public int $executedLinesBySmallOrMediumOrLargeTests = 0;
2934
public int $executableBranches;
3035
public int $executedBranches;
3136
public int $executablePaths;

src/Node/AbstractNode.php

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,46 @@ public function percentageOfExecutedLines(): Percentage
135135
);
136136
}
137137

138+
public function percentageOfExecutedLinesBySmallTests(): Percentage
139+
{
140+
return Percentage::fromFractionAndTotal(
141+
$this->numberOfExecutedLinesBySmallTests(),
142+
$this->numberOfExecutableLines(),
143+
);
144+
}
145+
146+
public function percentageOfExecutedLinesByMediumTests(): Percentage
147+
{
148+
return Percentage::fromFractionAndTotal(
149+
$this->numberOfExecutedLinesByMediumTests(),
150+
$this->numberOfExecutableLines(),
151+
);
152+
}
153+
154+
public function percentageOfExecutedLinesByLargeTests(): Percentage
155+
{
156+
return Percentage::fromFractionAndTotal(
157+
$this->numberOfExecutedLinesByLargeTests(),
158+
$this->numberOfExecutableLines(),
159+
);
160+
}
161+
162+
public function percentageOfExecutedLinesBySmallOrMediumTests(): Percentage
163+
{
164+
return Percentage::fromFractionAndTotal(
165+
$this->numberOfExecutedLinesBySmallOrMediumTests(),
166+
$this->numberOfExecutableLines(),
167+
);
168+
}
169+
170+
public function percentageOfExecutedLinesBySmallOrMediumOrLargeTests(): Percentage
171+
{
172+
return Percentage::fromFractionAndTotal(
173+
$this->numberOfExecutedLinesBySmallOrMediumOrLargeTests(),
174+
$this->numberOfExecutableLines(),
175+
);
176+
}
177+
138178
public function percentageOfExecutedBranches(): Percentage
139179
{
140180
return Percentage::fromFractionAndTotal(
@@ -161,6 +201,31 @@ public function numberOfTestedClassesAndTraits(): int
161201
return $this->numberOfTestedClasses() + $this->numberOfTestedTraits();
162202
}
163203

204+
public function numberOfTestedClassesAndTraitsBySmallTests(): int
205+
{
206+
return $this->numberOfTestedClassesBySmallTests() + $this->numberOfTestedTraitsBySmallTests();
207+
}
208+
209+
public function numberOfTestedClassesAndTraitsByMediumTests(): int
210+
{
211+
return $this->numberOfTestedClassesByMediumTests() + $this->numberOfTestedTraitsByMediumTests();
212+
}
213+
214+
public function numberOfTestedClassesAndTraitsByLargeTests(): int
215+
{
216+
return $this->numberOfTestedClassesByLargeTests() + $this->numberOfTestedTraitsByLargeTests();
217+
}
218+
219+
public function numberOfTestedClassesAndTraitsBySmallOrMediumTests(): int
220+
{
221+
return $this->numberOfTestedClassesBySmallOrMediumTests() + $this->numberOfTestedTraitsBySmallOrMediumTests();
222+
}
223+
224+
public function numberOfTestedClassesAndTraitsBySmallOrMediumOrLargeTests(): int
225+
{
226+
return $this->numberOfTestedClassesBySmallOrMediumOrLargeTests() + $this->numberOfTestedTraitsBySmallOrMediumOrLargeTests();
227+
}
228+
164229
/**
165230
* @return array<string, ProcessedClassType|ProcessedTraitType>
166231
*/
@@ -179,6 +244,31 @@ public function numberOfTestedFunctionsAndMethods(): int
179244
return $this->numberOfTestedFunctions() + $this->numberOfTestedMethods();
180245
}
181246

247+
public function numberOfTestedFunctionsAndMethodsBySmallTests(): int
248+
{
249+
return $this->numberOfTestedFunctionsBySmallTests() + $this->numberOfTestedMethodsBySmallTests();
250+
}
251+
252+
public function numberOfTestedFunctionsAndMethodsByMediumTests(): int
253+
{
254+
return $this->numberOfTestedFunctionsByMediumTests() + $this->numberOfTestedMethodsByMediumTests();
255+
}
256+
257+
public function numberOfTestedFunctionsAndMethodsByLargeTests(): int
258+
{
259+
return $this->numberOfTestedFunctionsByLargeTests() + $this->numberOfTestedMethodsByLargeTests();
260+
}
261+
262+
public function numberOfTestedFunctionsAndMethodsBySmallOrMediumTests(): int
263+
{
264+
return $this->numberOfTestedFunctionsBySmallOrMediumTests() + $this->numberOfTestedMethodsBySmallOrMediumTests();
265+
}
266+
267+
public function numberOfTestedFunctionsAndMethodsBySmallOrMediumOrLargeTests(): int
268+
{
269+
return $this->numberOfTestedFunctionsBySmallOrMediumOrLargeTests() + $this->numberOfTestedMethodsBySmallOrMediumOrLargeTests();
270+
}
271+
182272
/**
183273
* @return non-negative-int
184274
*/
@@ -218,6 +308,16 @@ abstract public function numberOfExecutableLines(): int;
218308

219309
abstract public function numberOfExecutedLines(): int;
220310

311+
abstract public function numberOfExecutedLinesBySmallTests(): int;
312+
313+
abstract public function numberOfExecutedLinesByMediumTests(): int;
314+
315+
abstract public function numberOfExecutedLinesByLargeTests(): int;
316+
317+
abstract public function numberOfExecutedLinesBySmallOrMediumTests(): int;
318+
319+
abstract public function numberOfExecutedLinesBySmallOrMediumOrLargeTests(): int;
320+
221321
abstract public function numberOfExecutableBranches(): int;
222322

223323
abstract public function numberOfExecutedBranches(): int;
@@ -230,18 +330,58 @@ abstract public function numberOfClasses(): int;
230330

231331
abstract public function numberOfTestedClasses(): int;
232332

333+
abstract public function numberOfTestedClassesBySmallTests(): int;
334+
335+
abstract public function numberOfTestedClassesByMediumTests(): int;
336+
337+
abstract public function numberOfTestedClassesByLargeTests(): int;
338+
339+
abstract public function numberOfTestedClassesBySmallOrMediumTests(): int;
340+
341+
abstract public function numberOfTestedClassesBySmallOrMediumOrLargeTests(): int;
342+
233343
abstract public function numberOfTraits(): int;
234344

235345
abstract public function numberOfTestedTraits(): int;
236346

347+
abstract public function numberOfTestedTraitsBySmallTests(): int;
348+
349+
abstract public function numberOfTestedTraitsByMediumTests(): int;
350+
351+
abstract public function numberOfTestedTraitsByLargeTests(): int;
352+
353+
abstract public function numberOfTestedTraitsBySmallOrMediumTests(): int;
354+
355+
abstract public function numberOfTestedTraitsBySmallOrMediumOrLargeTests(): int;
356+
237357
abstract public function numberOfMethods(): int;
238358

239359
abstract public function numberOfTestedMethods(): int;
240360

361+
abstract public function numberOfTestedMethodsBySmallTests(): int;
362+
363+
abstract public function numberOfTestedMethodsByMediumTests(): int;
364+
365+
abstract public function numberOfTestedMethodsByLargeTests(): int;
366+
367+
abstract public function numberOfTestedMethodsBySmallOrMediumTests(): int;
368+
369+
abstract public function numberOfTestedMethodsBySmallOrMediumOrLargeTests(): int;
370+
241371
abstract public function numberOfFunctions(): int;
242372

243373
abstract public function numberOfTestedFunctions(): int;
244374

375+
abstract public function numberOfTestedFunctionsBySmallTests(): int;
376+
377+
abstract public function numberOfTestedFunctionsByMediumTests(): int;
378+
379+
abstract public function numberOfTestedFunctionsByLargeTests(): int;
380+
381+
abstract public function numberOfTestedFunctionsBySmallOrMediumTests(): int;
382+
383+
abstract public function numberOfTestedFunctionsBySmallOrMediumOrLargeTests(): int;
384+
245385
private function processId(): void
246386
{
247387
if ($this->parent === null) {

0 commit comments

Comments
 (0)