Skip to content

Commit

Permalink
limit number of testcases displayed if minimizing
Browse files Browse the repository at this point in the history
  • Loading branch information
edwin1729 committed Aug 5, 2024
1 parent f2498a6 commit d763c46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.vorpal.research.kex.jacoco.minimization

import org.vorpal.research.kex.config.kexConfig
import java.nio.file.Path

private class Test(
Expand Down Expand Up @@ -39,7 +40,8 @@ class GreedyTestReductionImpl : TestSuiteMinimizer {

var satisfiedReq = 0
val importantTests = mutableSetOf<Path>()
while (satisfiedReq < requestSet.size) {
val maxTests = kexConfig.getIntValue("testGen", "maxTests", Integer.MAX_VALUE)
while (satisfiedReq < requestSet.size && importantTests.size < maxTests) {
val (maxTestPath, maxTest) = tests.maxByOrNull { it.value.power } ?: break
if (maxTest.power == 0) break

Expand Down
1 change: 1 addition & 0 deletions kex.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ generateAssertions = true
logJUnit = true
testTimeout = 10
surroundInTryCatch = false
maxTests = 5

ignoreStatic = class java.lang.System
ignoreStatic = class kex.java.util.Arrays
Expand Down

0 comments on commit d763c46

Please sign in to comment.