diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f79556..9a54b74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.20.0 + +### Added + +- `modelcheck` and `MpsCheck` now support `parallel` flag to launch model checker in parallel mode. + ## 1.19.3 ### Fixed diff --git a/README.md b/README.md index 4292005..5e5d2ea 100644 --- a/README.md +++ b/README.md @@ -382,7 +382,8 @@ Parameters: the testcase will fail and the message of the model checking error will be reported. * `message` - generates one testcase for each model check error. For uniqueness reasons, the name of the testcase will reflect the specific model check error and the name of the testclass will be constructed from the checked node ID and its containing root node. - Full error message and the node URL will be reported in the testcase failure. Checked models will be mapped to testsuites with this option. + Full error message and the node URL will be reported in the testcase failure. Checked models will be mapped to testsuites with this option. +* `parallel` (since 1.20) - runs model checker in parallel mode. Supported in MPS 2021.3.4. Default is `false`. * `maxHeap` - maximum heap size setting for the JVM that executes the modelchecker. This is useful to limit the heap usage in scenarios like containerized build agents where the OS reported memory limit is not the maximum to be consumed by the container. The value is a string understood by the JVM command line argument `-Xmx` e.g. `3G` or `512M`. @@ -454,6 +455,7 @@ Parameters: of Gradle build cache key. * `junitFile` - the JUnit XML file to produce. Defaults to `$buildDir/TEST-${task.name}.xml` * `junitFormat` - the format of the JUnit XML file. Defaults to `module-and-model`. +* `parallel` (since 1.20) - runs model checker in parallel mode. Supported in MPS 2021.3.4. Default is `false`. * `mpsHome` - the home directory of the MPS distribution (or RCP) to use for testing. * `mpsVersion` - the MPS version, such as "2021.3". Autodetected by reading `$mpsHome/build.properties` by default. * `pluginRoots` - directories containing additional plugins to load diff --git a/build.gradle.kts b/build.gradle.kts index b1973aa..f5b6fcf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,7 +24,7 @@ plugins { id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2" } -val baseVersion = "1.19.3" +val baseVersion = "1.20.0" group = "de.itemis.mps" diff --git a/src/main/kotlin/de/itemis/mps/gradle/modelcheck/Plugin.kt b/src/main/kotlin/de/itemis/mps/gradle/modelcheck/Plugin.kt index 4e108a8..cc6ae14 100644 --- a/src/main/kotlin/de/itemis/mps/gradle/modelcheck/Plugin.kt +++ b/src/main/kotlin/de/itemis/mps/gradle/modelcheck/Plugin.kt @@ -24,6 +24,7 @@ open class ModelCheckPluginExtensions(objectFactory: ObjectFactory) : BasePlugin var errorNoFail = false var junitFile: File? = null var junitFormat: String? = null + var parallel: Boolean = false } open class ModelcheckMpsProjectPlugin : Plugin { @@ -81,6 +82,10 @@ open class ModelcheckMpsProjectPlugin : Plugin { if (extension.junitFormat != null) { args.add("--result-format=${extension.junitFormat}") } + + if (extension.parallel) { + args.add("--parallel") + } args }) diff --git a/src/main/kotlin/de/itemis/mps/gradle/tasks/MpsCheck.kt b/src/main/kotlin/de/itemis/mps/gradle/tasks/MpsCheck.kt index bc578f0..35b8bc6 100644 --- a/src/main/kotlin/de/itemis/mps/gradle/tasks/MpsCheck.kt +++ b/src/main/kotlin/de/itemis/mps/gradle/tasks/MpsCheck.kt @@ -61,6 +61,9 @@ abstract class MpsCheck : JavaExec(), VerificationTask { @get:Input val junitFormat: Property = objectFactory.property().convention("module-and-model") + @get:Input + val parallel: Property = objectFactory.property().convention(false) + @get:Internal("covered by classpath") val additionalModelcheckBackendClasspath: ConfigurableFileCollection = objectFactory.fileCollection().from(initialModelcheckBackendClasspath()) @@ -124,6 +127,10 @@ abstract class MpsCheck : JavaExec(), VerificationTask { result.add("--result-format=${junitFormat.get()}") } + if (parallel.get()) { + result.add("--parallel") + } + val effectiveLogLevel = logging.level ?: project.logging.level ?: project.gradle.startParameter.logLevel if (effectiveLogLevel <= LogLevel.INFO) { result.add("--log-level=info")