File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree
utbot-framework-api/src/main/kotlin/org/utbot/framework Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,13 @@ object UtSettings : AbstractSettings(
240
240
*/
241
241
var treatOverflowAsError: Boolean by getBooleanProperty(false )
242
242
243
+ /* *
244
+ * Generate tests that treat assertions as error suits.
245
+ *
246
+ * True by default.
247
+ */
248
+ var treatAssertAsErrorSuit: Boolean by getBooleanProperty(true )
249
+
243
250
/* *
244
251
* Instrument all classes before start
245
252
*/
Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ import org.utbot.summary.SummarySentenceConstants.TAB
149
149
import java.lang.reflect.InvocationTargetException
150
150
import java.security.AccessControlException
151
151
import java.lang.reflect.ParameterizedType
152
+ import org.utbot.framework.UtSettings
152
153
153
154
private const val DEEP_EQUALS_MAX_DEPTH = 5 // TODO move it to plugin settings?
154
155
@@ -365,6 +366,7 @@ internal class CgMethodConstructor(val context: CgContext) : CgContextOwner by c
365
366
if (exception is AccessControlException ) return false
366
367
// tests with timeout or crash should be processed differently
367
368
if (exception is TimeoutException || exception is ConcreteExecutionFailureException ) return false
369
+ if (UtSettings .treatAssertAsErrorSuit && exception is AssertionError ) return false
368
370
369
371
val exceptionRequiresAssert = exception !is RuntimeException || runtimeExceptionTestsBehaviour == PASS
370
372
val exceptionIsExplicit = execution.result is UtExplicitlyThrownException
You can’t perform that action at this time.
0 commit comments