Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e88bd65
Introduce custom plugin's JavaDoc tags #565
onewhl Jul 22, 2022
43c4cf0
Render UtBot custom JavaDoc tags correctly #565
onewhl Jul 25, 2022
760594f
Add an option to generate summaries using custom JavaDoc tags #565
onewhl Jul 26, 2022
050550f
Fill value of utbot.iterates tag #565
onewhl Jul 27, 2022
ca86976
Collect info about Invoke, Iterate, and Return sections #565
onewhl Jul 28, 2022
d77e739
Review fixes
onewhl Aug 1, 2022
6ae1157
Add unit tests for summaries with custom JavaDoc tags #565
onewhl Aug 2, 2022
100e3df
Fix after rebasing
onewhl Aug 3, 2022
8d4063b
Add summary tests for MinStack #565
onewhl Aug 3, 2022
6d01afe
Fix broken tests
onewhl Aug 4, 2022
d03ad76
Add <pre> tag only in case when custom javadoc tags are not used
onewhl Aug 4, 2022
74c5822
Use a full exception name instead of simple name to build inline link…
onewhl Aug 6, 2022
7e4aaf9
Minor refactoring
onewhl Aug 6, 2022
92eb15d
Minor refactoring: avoid code duplication
onewhl Aug 6, 2022
cf9b60f
Add DocCustomTagStatement and CgCustomTagStatement
onewhl Aug 6, 2022
9c14eb0
Refactored code to avoid code duplication
onewhl Aug 6, 2022
6dce850
Fix tests: add full name for classes
onewhl Aug 6, 2022
7800d33
Add JUnit extension to control USE_CUSTOM_TAGS setting
onewhl Aug 6, 2022
d003962
Move useCustomJavaDocTags to UtSettings, make useFuzzing true
onewhl Aug 7, 2022
f8e6764
Remove unused import and fix broken tests
onewhl Aug 7, 2022
321bf0d
Fix broken tests
onewhl Aug 8, 2022
a52fb20
Add comments, remove unused method
onewhl Aug 8, 2022
83f4e71
Review fixes: fixed formatting, removed redundant types
onewhl Aug 9, 2022
abe7ca6
Review fixes: fixed formatting, removed useless overriding methods
onewhl Aug 15, 2022
475cae5
Review fixes: extracted method, polished code
onewhl Aug 15, 2022
99b06ad
fix after rebasing
onewhl Aug 17, 2022
21a7035
fix after rebasing
onewhl Aug 23, 2022
4951b6f
review fixes
onewhl Aug 23, 2022
bd616a9
fix rendering after updating to idea 2022.1. now we don't need to gen…
onewhl Aug 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add JUnit extension to control USE_CUSTOM_TAGS setting
  • Loading branch information
onewhl committed Aug 24, 2022
commit 7800d33780379daf6ff234885f0fc00011ff489d
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package examples

import org.junit.jupiter.api.extension.AfterEachCallback
import org.junit.jupiter.api.extension.BeforeEachCallback
import org.junit.jupiter.api.extension.ExtensionContext
import org.utbot.summary.UtSummarySettings

class CustomJavaDocTagsEnabler(private val enable: Boolean = true) : BeforeEachCallback, AfterEachCallback {
private var previousValue = false

override fun beforeEach(context: ExtensionContext?) {
previousValue = UtSummarySettings.USE_CUSTOM_JAVADOC_TAGS
UtSummarySettings.USE_CUSTOM_JAVADOC_TAGS = enable
}

override fun afterEach(context: ExtensionContext?) {
UtSummarySettings.USE_CUSTOM_JAVADOC_TAGS = previousValue
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ open class SummaryTestCaseGeneratorTest(
summaryKeys: List<String>,
methodNames: List<String> = listOf(),
displayNames: List<String> = listOf(),
clusterInfo: List<Pair<UtClusterInfo, Int>> = listOf(),
useCustomTags: Boolean = false
clusterInfo: List<Pair<UtClusterInfo, Int>> = listOf()
) {
workaround(WorkaroundReason.HACK) {
// @todo change to the constructor parameter
checkSolverTimeoutMillis = 0
checkNpeInNestedMethods = true
checkNpeInNestedNotPrivateMethods = true
UtSummarySettings.USE_CUSTOM_JAVADOC_TAGS = useCustomTags
}
val utMethod = UtMethod.from(method)
val testSet = executionsModel(utMethod, mockStrategy)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package examples.controlflow

import examples.CustomJavaDocTagsEnabler
import examples.SummaryTestCaseGeneratorTest
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.utbot.examples.DoNotCalculate
import org.utbot.examples.controlflow.Conditions
import org.utbot.framework.plugin.api.MockStrategyApi

@ExtendWith(CustomJavaDocTagsEnabler::class)
class SummaryConditionsTest : SummaryTestCaseGeneratorTest(
Conditions::class
) {
Expand Down Expand Up @@ -46,6 +49,6 @@ class SummaryConditionsTest : SummaryTestCaseGeneratorTest(
val mockStrategy = MockStrategyApi.NO_MOCKS
val coverage = DoNotCalculate

summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames, useCustomTags = true)
summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames)
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package examples.exceptions

import examples.CustomJavaDocTagsEnabler
import examples.SummaryTestCaseGeneratorTest
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.utbot.examples.DoNotCalculate
import org.utbot.examples.exceptions.ExceptionClusteringExamples
import org.utbot.framework.plugin.api.MockStrategyApi

@ExtendWith(CustomJavaDocTagsEnabler::class)
class SummaryExceptionClusteringExamplesTest : SummaryTestCaseGeneratorTest(
ExceptionClusteringExamples::class
) {
Expand Down Expand Up @@ -69,6 +72,6 @@ class SummaryExceptionClusteringExamplesTest : SummaryTestCaseGeneratorTest(
val mockStrategy = MockStrategyApi.NO_MOCKS
val coverage = DoNotCalculate

summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames, useCustomTags = true)
summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames)
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package examples.structures

import examples.CustomJavaDocTagsEnabler
import examples.SummaryTestCaseGeneratorTest
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.utbot.examples.DoNotCalculate
import org.utbot.examples.structures.MinStack
import org.utbot.framework.plugin.api.MockStrategyApi

@ExtendWith(CustomJavaDocTagsEnabler::class)
class SummaryMinStackTest : SummaryTestCaseGeneratorTest(
MinStack::class
) {
Expand Down Expand Up @@ -53,7 +56,7 @@ class SummaryMinStackTest : SummaryTestCaseGeneratorTest(
val mockStrategy = MockStrategyApi.NO_MOCKS
val coverage = DoNotCalculate

summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames, useCustomTags = true)
summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames)
}

@Test
Expand Down Expand Up @@ -92,7 +95,7 @@ class SummaryMinStackTest : SummaryTestCaseGeneratorTest(
val mockStrategy = MockStrategyApi.NO_MOCKS
val coverage = DoNotCalculate

summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames, useCustomTags = true)
summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames)
}

@Test
Expand Down Expand Up @@ -197,6 +200,6 @@ class SummaryMinStackTest : SummaryTestCaseGeneratorTest(
val mockStrategy = MockStrategyApi.NO_MOCKS
val coverage = DoNotCalculate

summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames, useCustomTags = true)
summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames)
}
}