diff --git a/build.gradle.kts b/build.gradle.kts index bd584ee69..e51a2456e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,7 +52,8 @@ kotlin { val benchmarksClassPath = compileDependencyFiles + runtimeDependencyFiles + - output.allOutputs + output.allOutputs + + files("$buildDir/processedResources/jvm/main") val benchmarksTestClassesDirs = output.classesDirs @@ -60,9 +61,10 @@ kotlin { val benchmark = tasks.register("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("jvmBenchmarkSuite") { classpath = benchmarksClassPath testClassesDirs = benchmarksTestClassesDirs @@ -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 @@ -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") diff --git a/src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/AbstractLincheckBenchmark.kt b/src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/AbstractLincheckBenchmark.kt index 5b0a85cb7..1aa07ac1e 100644 --- a/src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/AbstractLincheckBenchmark.kt +++ b/src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/AbstractLincheckBenchmark.kt @@ -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)" diff --git a/src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/README.md b/src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/README.md index ee3022ff1..c57940843 100644 --- a/src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/README.md +++ b/src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/README.md @@ -94,7 +94,7 @@ 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. @@ -102,7 +102,7 @@ By default, this task produces all available plots in `.html` format and stores To see a description of all available task options, run the following command: ``` -./gradlew :runBenchmarksPlots --args="--help" +./gradlew :runBenchmarkPlots --args="--help" ``` diff --git a/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt b/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt index 98eba41d6..b231ec908 100644 --- a/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt +++ b/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt @@ -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 } }