-
Notifications
You must be signed in to change notification settings - Fork 45
Go. Big update #2206
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
Go. Big update #2206
Conversation
| }, | ||
| modify = Routine.ForEach(listOf(chanType.elementTypeId!!)) { self, i, values -> | ||
| val model = self as GoUtChanModel | ||
| if (i >= model.value.size) { |
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.
Isn't this check always false?
| object GoNilValueProvider : ValueProvider<GoTypeId, GoUtModel, GoDescription> { | ||
| override fun accept(type: GoTypeId): Boolean = type is GoSliceTypeId || type is GoMapTypeId | ||
| override fun accept(type: GoTypeId): Boolean = | ||
| type is GoSliceTypeId || type is GoMapTypeId || type is GoChanTypeId || type is GoPointerTypeId || type is GoInterfaceTypeId |
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.
setOf(...).any(...) would be easier to ready
| construct = Routine.Create(listOf(pointerType.elementTypeId!!)) { values -> | ||
| GoUtPointerModel(value = values.first(), typeId = pointerType) | ||
| }, | ||
| modify = sequenceOf(Routine.Call(listOf(pointerType.elementTypeId)) { self, values -> |
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.
Look likes this duplicates the logic from the construct and the sequence can be empty in this case
| }, | ||
| modify = Routine.ForEach(listOf(sliceType.elementTypeId!!)) { self, i, values -> | ||
| val model = self as GoUtSliceModel | ||
| if (i >= model.length) { |
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.
Same as before: do we really need this check?
|
|
||
| fun modifyEnvironment(goExecutableAbsolutePath: Path, gopathAbsolutePath: Path): MutableMap<String, String> { | ||
| val environment = System.getenv().toMutableMap().apply { | ||
| this["Path"] = goExecutableAbsolutePath.parent.toString() + File.pathSeparator + (this["Path"] ?: "") |
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.
Path.resolve(String other) can be used here
| cell(allFunctionExecutionTimeoutSecondsSpinner) | ||
| cell(JBLabel("seconds")) | ||
| } | ||
| row("Number of fuzzing processes:") { |
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.
Should a user know about this number?
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.
I think this is important if he wants to run fuzzing instead of generating tests.
| fun modifyEnvironment(goExecutableAbsolutePath: Path, gopathAbsolutePath: Path): MutableMap<String, String> { | ||
| val environment = System.getenv().toMutableMap().apply { | ||
| this["Path"] = goExecutableAbsolutePath.parent.toString() + File.pathSeparator + (this["Path"] ?: "") | ||
| this["Path"] = goExecutableAbsolutePath.resolve(File.pathSeparator).toString() + (this["Path"] ?: "") |
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.
Resolve should resolve a child element of the current path.
Description
Added support for new types:
Changed test generation template
Added support for methods
Parallel fuzzing
Traces -> coverage
Fixes #2117
How to test
Manual tests
Test on
utbot-go/go-samples/simple/samples.goandutbot-go/go-samples/simple/supported_types.gofiles.Self-check list