Skip to content

Commit

Permalink
BREAKING: junit: Set default lifecycle to PER_TEST
Browse files Browse the repository at this point in the history
This is a temporary reversal of the breaking change in
1ca007d until we support
`TestInstancePostProcessor`s.
  • Loading branch information
fmeum committed Sep 13, 2023
1 parent 4540c3c commit 7781986
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static java.util.Collections.unmodifiableList;

import com.code_intelligence.jazzer.junit.FuzzTest;
import com.code_intelligence.jazzer.junit.Lifecycle;
import com.example.PerExecutionLifecycleFuzzTest.LifecycleCallbacks1;
import com.example.PerExecutionLifecycleFuzzTest.LifecycleCallbacks2;
import com.example.PerExecutionLifecycleFuzzTest.LifecycleCallbacks3;
Expand Down Expand Up @@ -79,7 +80,7 @@ void disabledFuzz(byte[] data) {
throw new AssertionError("This test should not be executed");
}

@FuzzTest(maxExecutions = RUNS)
@FuzzTest(maxExecutions = RUNS, lifecycle = Lifecycle.PER_EXECUTION)
void lifecycleFuzz(byte[] data) {
events.add("lifecycleFuzz");
assertThat(beforeEachCalledOnInstance).isTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void disabledFuzz(byte[] data) {
throw new AssertionError("This test should not be executed");
}

@FuzzTest(maxExecutions = RUNS, lifecycle = Lifecycle.PER_TEST)
@FuzzTest(maxExecutions = RUNS)
void lifecycleFuzz(byte[] data) {
events.add("lifecycleFuzz");
assertThat(beforeEachCalledOnInstance).isTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
* <p>During regression testing, fuzz tests always go through the full JUnit lifecycle for every
* execution regardless of the value of this option.
*/
Lifecycle lifecycle() default Lifecycle.PER_EXECUTION;
Lifecycle lifecycle() default Lifecycle.PER_TEST;
}

// Internal use only.
Expand Down

0 comments on commit 7781986

Please sign in to comment.