Skip to content

Commit

Permalink
#1843 Enables globalAssertSoftly through system properties (#1845)
Browse files Browse the repository at this point in the history
* #1843 Enables globalAssertSoftly through system properties

* #1843 Makes globalAssertSoftly all lowercase
  • Loading branch information
ashishkujoy committed Nov 13, 2020
1 parent 236669b commit 5a9d04d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,9 @@ object KotestEngineSystemProperties {
* If set -> filter testCases by this severity level and higher, else running all
*/
const val severityPrefix = "kotest.framework.test.severity"

/**
* Enable assert softly globally.
* */
const val globalAssertSoftly = "kotest.framework.assertion.globalassertsoftly"
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ internal fun allowMultilineTestName(): Option<Boolean> =
internal fun concurrencyMode(): Option<ConcurrencyMode> =
sysprop(KotestEngineSystemProperties.concurrencyMode).toOption().map { ConcurrencyMode.valueOf(it) }

internal fun globalAssertSoftly(): Option<Boolean> =
sysprop(KotestEngineSystemProperties.globalAssertSoftly).toOption().map { it.toUpperCase() == "TRUE" }

/**
* Returns a [DetectedProjectConfig] which is built from system properties where supported.
*/
Expand All @@ -39,6 +42,7 @@ internal fun loadConfigFromSystemProperties(): DetectedProjectConfig {
concurrencyMode = concurrencyMode(),
timeout = timeout(),
invocationTimeout = invocationTimeout(),
testNameRemoveWhitespace = allowMultilineTestName()
testNameRemoveWhitespace = allowMultilineTestName(),
globalAssertSoftly = globalAssertSoftly()
)
}

0 comments on commit 5a9d04d

Please sign in to comment.