Skip to content

Commit c138e8f

Browse files
Marcono1234oetr
authored andcommitted
docs: mention that JUnit inputs should be treated as binary
1 parent f438eb7 commit c138e8f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class ParserTests {
8787

8888
A complete Maven example project can be found in [`examples/junit`](examples/junit).
8989

90+
A detailed description of the JUnit integration can be found in the [documentation](docs/junit-integration.md).
91+
9092
### GitHub releases
9193

9294
You can also use GitHub release archives to run a standalone Jazzer binary that starts its own JVM configured for fuzzing:

docs/junit-integration.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ value (`true`, `1`, `yes`)) and in regression mode (when `JAZZER_FUZZ` is not se
365365

366366
JUnit will call the following methods for each test marked with `FuzzTest`.
367367

368+
> [!NOTE]\
369+
> In fuzzing mode, only a single fuzz test is executed per test run
370+
> (see [#599](https://github.com/CodeIntelligenceTesting/jazzer/issues/599) for details).
371+
368372
#### `evaluateExecutionCondition`
369373

370374
The first call to this test will determine if the test should be run at all. In fuzzing mode, we only allow one test to
@@ -429,6 +433,12 @@ The tests from the resources directory are gathered by `walkInputs`. This will l
429433
JUnit will use the file's name as the name of the test case for its reporting. It also accepts .jar files where it will
430434
search with the given directory in the jar.
431435

436+
> [!IMPORTANT]\
437+
> When adding these inputs files to a Git repository, consider creating a `.gitattributes` file containing
438+
> `src/test/resources/** binary` or similar to explicitly mark the files as binary files. Otherwise Git might
439+
> erroneously consider them text files, misinterpret bytes as line terminators and convert them on checkout.
440+
> This would change the content of the inputs files and can lead to unexpected behavior.
441+
432442
##### Corpus
433443

434444
The corpus kept in `.cifuzz-corpus/<test class name>/<test method name>` holds any inputs that libfuzzer found worth

0 commit comments

Comments
 (0)