Skip to content

Commit

Permalink
Document Kotest tag filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
FWDekker committed Oct 3, 2023
1 parent 823f872 commit 1ddaf86
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ See [Plugin Signing](https://plugins.jetbrains.com/docs/intellij/plugin-signing.

### 🧪 Quality assurance
```bash
$ gradlew test # Run tests
$ gradlew test --tests X # Run tests in class X (package name optional)
$ gradlew check # Run tests and static analysis
$ gradlew runPluginVerifier # Check for compatibility issues
$ gradlew test # Run tests
$ gradlew test --tests X # Run tests in class X (package name optional)
$ gradlew test --kotest.tags="X" # Run tests with `NamedTag` X (also supports not (!), and (&), or (|))
$ gradlew check # Run tests and static analysis
$ gradlew runPluginVerifier # Check for compatibility issues
```

### 📚 Documentation
Expand Down
5 changes: 2 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ dependencies {

testImplementation("org.assertj:assertj-swing-junit:${properties("assertjSwingVersion")}")
testRuntimeOnly("org.junit.platform:junit-platform-runner:${properties("junitRunnerVersion")}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${properties("junitVersion")}")
testImplementation("org.junit.jupiter:junit-jupiter-engine:${properties("junitVersion")}")
testImplementation("org.junit.vintage:junit-vintage-engine:${properties("junitVersion")}")
testImplementation("io.kotest:kotest-assertions-core:${properties("kotestVersion")}")
testImplementation("io.kotest:kotest-framework-datatest:${properties("kotestVersion")}")
Expand Down Expand Up @@ -104,9 +102,10 @@ tasks {
// Tests/coverage
test {
systemProperty("java.awt.headless", "false")
if (project.hasProperty("kotest.tags")) systemProperty("kotest.tags", project.findProperty("kotest.tags")!!)

useJUnitPlatform {
includeEngines("junit-vintage", "junit-jupiter", "kotest")
includeEngines("junit-vintage", "kotest")
}

testLogging {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/fwdekker/randomness/Scheme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import kotlin.random.Random
/**
* A scheme is a [State] that is also a configurable random number generator.
*
* Schemes can additionally use [DecoratorScheme]s to extend their functionality.
* Schemes may use [DecoratorScheme]s to extend their functionality.
*/
abstract class Scheme : State() {
/**
Expand Down
10 changes: 7 additions & 3 deletions src/main/kotlin/com/fwdekker/randomness/State.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import kotlin.random.asJavaRandom


/**
* A state holds variables that can be configured.
* A state holds variables that can be configured, validated, copied, and loaded.
*
* All non-transient non-primitive fields of a state should be immutable references. For example, if a state has a field
* `list: List<String>`, then `list` should be a `val`, not a `var`, so that references to `state.list` remain valid
* even after `copyFrom`.
*/
abstract class State {
/**
Expand Down Expand Up @@ -59,8 +63,8 @@ abstract class State {
abstract fun deepCopy(retainUuid: Boolean = false): State

/**
* When invoked by the instance `this` as `self.deepCopyTransient()`, this method copies [Transient] fields from
* `this` to `self`, and returns `self`.
* When invoked by the instance `this` on (another) instance `self` as `self.deepCopyTransient()`, this method
* copies [Transient] fields from `this` to `self`, and returns `self`.
*
* @see deepCopy
*/
Expand Down

0 comments on commit 1ddaf86

Please sign in to comment.