Package edu.berkeley.cs.jqf.junit5
Class JUnit5FuzzConfig
java.lang.Object
edu.berkeley.cs.jqf.junit5.JUnit5FuzzConfig
Reads a
@FuzzTest's run configuration from its annotation, system
properties, the environment, and any externally installed guidance.
This is the single place that decides between the two modes (regression and
fuzzing), builds the Guidance for a fuzzing campaign, and enumerates the
inputs replayed by a regression run.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA named source of one regression input's bytes. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClears any externally installed guidance.Builds the guidance for a fuzzing campaign.static JUnit5FuzzConfigReads the configuration for one fuzz-test method.static GuidanceReturns the externally installed guidance, ornullif none is set.static voidinstallGuidance(Guidance guidance) Installs a guidance to drive every subsequent@FuzzTestrun.booleanReports whether this run should fuzz rather than replay a bounded regression.Returns the output directory for this method's fuzzing results,<base>/<FQCN>/<method>where the base istarget/fuzz-resultsunless overridden by thejqf.fuzz.outsystem property.Enumerates the inputs replayed by a regression run: the saved corpus from a previous fuzzing run, anyseeds, and one empty (all-zero) input.
-
Method Details
-
from
Reads the configuration for one fuzz-test method.- Parameters:
testClass- the test classmethod- the@FuzzTestmethod- Returns:
- the configuration
-
installGuidance
Installs a guidance to drive every subsequent@FuzzTestrun.- Parameters:
guidance- the guidance to install
-
installedGuidance
Returns the externally installed guidance, ornullif none is set.- Returns:
- the installed guidance, or
null
-
clearInstalledGuidance
public static void clearInstalledGuidance()Clears any externally installed guidance. -
isFuzzingMode
public boolean isFuzzingMode()Reports whether this run should fuzz rather than replay a bounded regression.Fuzzing is selected by an installed guidance, the
jqf.fuzzsystem property, theJQF_FUZZenvironment variable, or areproinput.- Returns:
truefor a fuzzing campaign,falsefor regression
-
createGuidance
Builds the guidance for a fuzzing campaign.- Returns:
- an installed, repro, or fresh Zest guidance
- Throws:
IOException- if the guidance's output directory cannot be prepared
-
regressionInputs
Enumerates the inputs replayed by a regression run: the saved corpus from a previous fuzzing run, anyseeds, and one empty (all-zero) input.- Returns:
- the regression inputs, in replay order
-
outputDirectory
Returns the output directory for this method's fuzzing results,<base>/<FQCN>/<method>where the base istarget/fuzz-resultsunless overridden by thejqf.fuzz.outsystem property.- Returns:
- the output directory
-