-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlin mutator testing #23
Conversation
Removed redundant scala files
Many bugs fixed with tests not being run by maven Modified KotlinAST to fake immutability, I am pretty sure you can insert new elements into KtElements however this would change the hashCode of the AST and result in problems. Added more constructors for kotlin classes to support variety in used mutators
…tlin.test again instead of using jupyter)
# Conflicts: # stryker4jvm-mutator-kotlin/src/test/kotlin/stryker4jvm/mutator/kotlin/InstrumenterTest.kt
# Conflicts: # stryker4jvm-mutator-kotlin/src/main/kotlin/stryker4jvm/mutator/kotlin/KotlinInstrumenter.kt # stryker4jvm-mutator-kotlin/src/main/kotlin/stryker4jvm/mutator/kotlin/KotlinParser.kt
Circumvent is made because the current way of passing down a config makes it really hard to test individual components as they now all require a configuration. Would be better if they were passed to the constructor once (of the class that extends LanguageMutator) such that individual components do not depend on this configuration anymore (config can be used once and then discarded as classes should be initialized based on config) Fixed issue with stryker4jvm-core exception having multiple constructors
plugins { | ||
kotlin("jvm") //version "1.5.10" | ||
kotlin("plugin.serialization") version "1.5.10" | ||
kotlin("jvm") version "1.4.20" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a downgrade necessary here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yessir, that is the reason why we get runtime exceptions. Version 1.5 and above does not allow illegal reflections which stryker4k depends on
@@ -45,4 +46,8 @@ class KotlinCollector : Collector<KotlinAST> { | |||
|
|||
return res | |||
} | |||
|
|||
fun collect(tree: KotlinAST?): CollectedMutants<KotlinAST> { | |||
return collect(tree, LanguageMutatorConfig(mutableSetOf())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are not using the languageconfig, can't you leave it null and add a nullable to collect(tree, config)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, I fogot about that because instead of compiler issues I was given a runtime exception because the private config variable of the base language mutator was null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has now been changed
stryker4jvm-mutator-kotlin/src/main/kotlin/stryker4jvm/mutator/kotlin/KotlinInstrumenter.kt
Outdated
Show resolved
Hide resolved
stryker4jvm-mutator-kotlin/src/main/kotlin/stryker4jvm/mutator/kotlin/KotlinMutator.kt
Outdated
Show resolved
Hide resolved
stryker4jvm-mutator-kotlin/src/main/kotlin/stryker4jvm/mutator/kotlin/KotlinMutator.kt
Outdated
Show resolved
Hide resolved
stryker4jvm-mutator-kotlin/src/main/kotlin/stryker4jvm/mutator/kotlin/KotlinParser.kt
Outdated
Show resolved
Hide resolved
…ST but instead modifying the original. Note that it still modifies the original but that we wrap the resulting tree into a new AST
What it does
Testing for kotlin language specific implementation
How it works
Converted stryker4jvm-mutator-kotlin to gradle module to resolve runtime reflection issues.
Implemented tests for all components.
Currently circumvents config as the current design makes the testing of individual components a hassle
README
Do not forget to clean install stryker4jvm-core as well as doing a clean build with gradle for stryker4jvm-mutator-kotlin followed by a publishToMavenLocal!