Skip to content

Commit

Permalink
can configure the default package name externally
Browse files Browse the repository at this point in the history
  • Loading branch information
edwin1729 committed Aug 27, 2024
1 parent 2348cdb commit 66fc329
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ val BasicBlock.validName get() = name.toString().replace(Regex("[^a-zA-Z0-9]"),
// If there is no package assign an arbitrary package name 'example'
// This is necessary since tests generated by kex use the same package structure and imports are made from helper files
// In java imports are not possible from the default package
val Method.packageName get() = klass.pkg.concreteName.ifBlank { "example" }
val Method.packageName get() = klass.pkg.concreteName.ifBlank { kexConfig.getStringValue("testGen", "defaultPackageName", "example") }
val Method.klassName get() = "${klass.validName}_${validName}_${abs(hashCode())}"

abstract class TestCasePrinter(
Expand Down
1 change: 1 addition & 0 deletions kex.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ compileDir = compiled/
[testGen]
enabled = true
testsDir = tests/
defaultPackageName = example
accessLevel = private
testCaseLanguage = java
generateSetup = true
Expand Down

0 comments on commit 66fc329

Please sign in to comment.