Project Extension
Registering the extension is optional, but recommended. It offers the following features:
Global Configuration
You can configure your own defaults for test execution parameters. Otherwise, the same defaults will be used. See below for a detailed description of each parameter.
Display Name Formatting
All
AdventSpecs will have a nicely formatted display name derived from their@AdventDayannotation. For example,@AdventDay(2015, 1, "Not Quite Lisp", "FP")will becomeY2015D01: Not Quite Lisp (FP). All other specs and tests follow the normal Kotest formatting rules.Automatic Execution Ordering
AdventSpecs will always execute in chronological order. All other specs will run before them, in the order they were discovered. Note that this overrides Kotest's own spec ordering.
Registering The Extension
To register it, add it to your Kotest project level config, for example in src/test/my/aoc/TestConfig.kt:
To make Kotest use this configuration, you must register the FQN as a system property for Gradle:
Configuration Properties
Preferences that can be set as constructor arguments.
efficiencyBenchmark
Only applies to tests against user input, not examples. If the solution completes under this time value, it will pass the efficiency test.
You can lower this value if you want to further challenge yourself, but careful when going too low, as JVM execution times depend on warm-up and might lead to flaky tests.
The default value is 15 seconds, a reference to the about page, which states that "every problem has a solution that completes in at most 15 seconds on ten-year-old hardware", if you go above that it usually means you did not find the intended solution.
executionMode
Determines which tests will run.
Possible values are:
All: Runs all the tests it can find. The default behavior.ExamplesOnly: Will not run against user inputs even if they are present. Useful when running a project with encrypted inputs (e.g.: running a clone of someone else's solution repo).SkipExamples: Will only run against user inputs even if examples are defined. Useful when all you care about is ensuring your solutions still give the correct answer.