Skip to content

Commit

Permalink
fixes after rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeniy Moiseenko <[email protected]>
  • Loading branch information
eupp committed Jun 10, 2024
1 parent 0b96846 commit 27870e2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,19 @@ kotlin {
val benchmarksClassPath =
compileDependencyFiles +
runtimeDependencyFiles +
output.allOutputs
output.allOutputs +
files("$buildDir/processedResources/jvm/main")

val benchmarksTestClassesDirs = output.classesDirs

// task allowing to run benchmarks using JUnit API
val benchmark = tasks.register<Test>("jvmBenchmark") {
classpath = benchmarksClassPath
testClassesDirs = benchmarksTestClassesDirs
dependsOn("processResources")
}

// task aggregating all benchmarks into single suite and producing custom reports
// task aggregating all benchmarks into a single suite and producing custom reports
val benchmarkSuite = tasks.register<Test>("jvmBenchmarkSuite") {
classpath = benchmarksClassPath
testClassesDirs = benchmarksTestClassesDirs
Expand All @@ -73,6 +75,7 @@ kotlin {
systemProperty("statisticsGranularity", System.getProperty("statisticsGranularity"))
// always re-run test suite
outputs.upToDateWhen { false }
dependsOn("processResources")
}

// task producing plots given the benchmarks report file
Expand Down Expand Up @@ -128,6 +131,7 @@ kotlin {
val letsPlotKotlinVersion: String by project
val cliktVersion: String by project
dependencies {
implementation(project(":bootstrap"))
implementation("junit:junit:$junitVersion")
implementation("org.jctools:jctools-core:$jctoolsVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class AbstractLincheckBenchmark(
)
val klass = this@AbstractLincheckBenchmark::class
val checker = LinChecker(klass.java, this)
val failure = checker.checkImpl(tracker = statisticsTracker)
val failure = checker.checkImpl(customTracker = statisticsTracker)
if (failure == null) {
assert(expectedFailures.isEmpty()) {
"This test should fail, but no error has been occurred (see the logs for details)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ The gradle task `runBenchmarkPlots` can be invoked to produce the plots.
It expects the path to the `.json` report file to be provided as the first argument:

```
./gradlew :runBenchmarksPlots --args="benchmarks-results.json"
./gradlew :runBenchmarkPlots --args="benchmarks-results.json"
```

By default, this task produces all available plots in `.html` format and stores them into `lets-plot-images` directory.

To see a description of all available task options, run the following command:

```
./gradlew :runBenchmarksPlots --args="--help"
./gradlew :runBenchmarkPlots --args="--help"
```


Expand Down
4 changes: 2 additions & 2 deletions src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ class LinChecker(private val testClass: Class<*>, options: Options<*, *>?) {
* @return TestReport with information about concurrent test run.
*/
@Synchronized // never run Lincheck tests in parallel
internal fun checkImpl(): LincheckFailure? {
internal fun checkImpl(customTracker: LincheckRunTracker? = null): LincheckFailure? {
check(testConfigurations.isNotEmpty()) { "No Lincheck test configuration to run" }
lincheckVerificationStarted()
for (testCfg in testConfigurations) {
withLincheckJavaAgent(testCfg.instrumentationMode) {
val failure = testCfg.checkImpl()
val failure = testCfg.checkImpl(customTracker)
if (failure != null) return failure
}
}
Expand Down

0 comments on commit 27870e2

Please sign in to comment.