@@ -14,7 +14,6 @@ import org.utbot.framework.UtSettings
14
14
import org.utbot.framework.plugin.api.MockStrategyApi
15
15
import org.utbot.framework.plugin.api.util.UtContext
16
16
import org.utbot.framework.plugin.api.util.executableId
17
- import org.utbot.framework.plugin.api.util.withUtContext
18
17
import org.utbot.framework.plugin.services.JdkInfoDefaultProvider
19
18
import org.utbot.framework.util.SootUtils
20
19
import org.utbot.tests.infrastructure.TestSpecificTestCaseGenerator
@@ -23,9 +22,9 @@ import java.util.concurrent.TimeUnit
23
22
@State(Scope .Benchmark )
24
23
@Fork(1 )
25
24
@Threads(1 )
26
- @Warmup(iterations = 2 )
25
+ @Warmup(iterations = 1 )
27
26
@Measurement(iterations = 4 , timeUnit = TimeUnit .SECONDS )
28
- class BenchmarksTest {
27
+ class Benchmark {
29
28
lateinit var testCaseGenerator: TestSpecificTestCaseGenerator
30
29
lateinit var context: UtContext
31
30
@@ -51,52 +50,42 @@ class BenchmarksTest {
51
50
52
51
@Benchmark
53
52
fun benchmarkLongMethod () {
54
- withUtContext(context) {
55
- testCaseGenerator.generate(
56
- Benchmarks ::longMethod.executableId,
57
- MockStrategyApi .NO_MOCKS
58
- )
59
- }
53
+ testCaseGenerator.generate(
54
+ Benchmarks ::longMethod.executableId,
55
+ MockStrategyApi .NO_MOCKS
56
+ )
60
57
}
61
58
62
59
63
60
@Benchmark
64
61
fun benchmarkCycle () {
65
- withUtContext(context) {
66
- testCaseGenerator.generate(
67
- Benchmarks ::cycle.executableId,
68
- MockStrategyApi .NO_MOCKS
69
- )
70
- }
62
+ testCaseGenerator.generate(
63
+ Benchmarks ::cycle.executableId,
64
+ MockStrategyApi .NO_MOCKS
65
+ )
71
66
}
72
67
73
68
@Benchmark
74
69
fun benchmarkExceptionInToString () {
75
- withUtContext(context) {
76
- testCaseGenerator.generate(
77
- StringConcat ::exceptionInToString.executableId,
78
- MockStrategyApi .NO_MOCKS
79
- )
80
- }
70
+ testCaseGenerator.generate(
71
+ StringConcat ::exceptionInToString.executableId,
72
+ MockStrategyApi .NO_MOCKS
73
+ )
81
74
}
82
75
83
76
@Benchmark
84
77
fun benchmarkPutAndGet () {
85
- withUtContext(context) {
86
- testCaseGenerator.generate(
87
- Benchmarks ::mapPutAndGet.executableId,
88
- MockStrategyApi .NO_MOCKS
89
- )
90
- }
78
+ testCaseGenerator.generate(
79
+ Benchmarks ::mapPutAndGet.executableId,
80
+ MockStrategyApi .NO_MOCKS
81
+ )
91
82
}
92
83
93
84
@Benchmark
94
85
fun benchmarkPutInMapFromParameters () {
95
- withUtContext(context) {
96
- testCaseGenerator.generate(
97
- Benchmarks ::putInMapFromParameters.executableId,
98
- MockStrategyApi .NO_MOCKS
99
- )
100
- }
86
+ testCaseGenerator.generate(
87
+ Benchmarks ::putInMapFromParameters.executableId,
88
+ MockStrategyApi .NO_MOCKS
89
+ )
101
90
}
102
91
}
0 commit comments