test-instrumenter

A Java Agent for instrumenting tests, mainly used for undeclared inputs checking (see test-inputs-check).

Debugging

If you want to see debug logs and stack traces from the JVM, add this line to your local.properties:

test.instrumenter.debug=true

System properties

The following system properties are recognized:

System propertyDescriptionSource
test.instrumenter.debugEnable/disable debug logging and JVM stack traceslocal.properties
test.instrumenter.inputs.check.enabledEnable/disable inputs checking instrumentationtest-inputs-check
test.instrumenter.root.dirRoot dir of kotlin.gittest-inputs-check
test.instrumenter.build.dirBuild dir of the project executing teststest-inputs-check
test.instrumenter.declared.inputs.filePath to file containg list of declared inputstest-inputs-check

Benchmarking

The performance of the TestInputsChecker is measured by the JMH microbenchmark TestInputsCheckerBenchmark.

To run the benchmark:

./gradlew :test-instrumenter:jmh

After it completes, the benchmark-baseline.txt file will be updated.

The number of milliseconds in Score column should be interpreted as how much overhead the input checking instrumentation adds per 100k files accessed.

[!TIP] Run the benchmark before and after modifying TestInputsChecker to compare the performance