mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-20 00:15:29 +00:00
Add capability to only fail when running tests.
This commit is contained in:
1 parent
2cbf6f766b
commit
e50d44b071
2 files changed
+22
-2
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2024 The Project Lombok Authors.
|
||||
* Copyright (C) 2009-2026 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -34,6 +34,7 @@ import org.junit.runner.Runner;
|
||||
import org.junit.runner.notification.Failure;
|
||||
import org.junit.runner.notification.RunNotifier;
|
||||
|
||||
import lombok.core.handlers.HandlerUtil;
|
||||
import lombok.eclipse.Eclipse;
|
||||
import lombok.javac.Javac;
|
||||
|
||||
@@ -170,9 +171,12 @@ public class DirectoryRunner extends Runner {
|
||||
|
||||
notifier.fireTestStarted(testDescription);
|
||||
try {
|
||||
HandlerUtil.incrementRunningInTest();
|
||||
tester.runTest();
|
||||
} catch (Throwable t) {
|
||||
notifier.fireTestFailure(new Failure(testDescription, t));
|
||||
} finally {
|
||||
HandlerUtil.decrementRunningInTest();
|
||||
}
|
||||
notifier.fireTestFinished(testDescription);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user