|
| 1 | +## Project Description |
| 2 | + |
| 3 | +This is an extended example Bazel project with multiple packages and |
| 4 | +two fuzztests `main/tests:explore_me_fuzz_test` and `fuzztests:test_me_fuzz_test`. |
| 5 | + |
| 6 | +The `explore_me_fuzz_test` is defined in the same package as the source |
| 7 | +code and `test_me_fuzz_test` is located in a separated package. |
| 8 | + |
| 9 | +## Run |
| 10 | + |
| 11 | +### Heap Buffer Overflow and Undefined Behaviour |
| 12 | + |
| 13 | +``` |
| 14 | +cifuzz run main/tests:explore_me_fuzz_test |
| 15 | +``` |
| 16 | + |
| 17 | +### Heap Use After Free |
| 18 | + |
| 19 | +``` |
| 20 | +cifuzz run fuzztests:test_me_fuzz_test |
| 21 | +``` |
| 22 | + |
| 23 | +## Bundle |
| 24 | + |
| 25 | +### explore_me_fuzz_test |
| 26 | + |
| 27 | +``` |
| 28 | +cifuzz bundle main/tests:explore_me_fuzz_test |
| 29 | +``` |
| 30 | + |
| 31 | +Should include one fuzz test with two targets to cover fuzzing and coverage builds. |
| 32 | + |
| 33 | +``` |
| 34 | +... |
| 35 | +target: main/tests/explore_me_fuzz_test |
| 36 | +path: libfuzzer/address+undefined/main/tests/explore_me_fuzz_test/bin/explore_me_fuzz_test |
| 37 | +... |
| 38 | +target: main/tests/explore_me_fuzz_test |
| 39 | +path: replayer/coverage/main/tests/explore_me_fuzz_test/bin/explore_me_fuzz_test |
| 40 | +``` |
| 41 | + |
| 42 | +### test_me_fuzz_test |
| 43 | + |
| 44 | +``` |
| 45 | +cifuzz bundle |
| 46 | +``` |
| 47 | + |
| 48 | +Should include one fuzz test with two targets to cover fuzzing and coverage builds. |
| 49 | + |
| 50 | +``` |
| 51 | +... |
| 52 | +target: fuzztests/test_me_fuzz_test |
| 53 | +path: libfuzzer/address+undefined/fuzztests/test_me_fuzz_test/bin/test_me_fuzz_test |
| 54 | +... |
| 55 | +target: fuzztests/test_me_fuzz_test |
| 56 | +path: replayer/coverage/fuzztests/test_me_fuzz_test/bin/test_me_fuzz_test |
| 57 | +... |
| 58 | +``` |
| 59 | + |
| 60 | +## Coverage |
| 61 | + |
| 62 | +### explore_me_fuzz_test |
| 63 | + |
| 64 | +``` |
| 65 | +cifuzz coverage main/tests:explore_me_fuzz_test |
| 66 | +``` |
| 67 | + |
| 68 | +``` |
| 69 | + File | Functions Hit/Found | Lines Hit/Found | Branches Hit/Found |
| 70 | + main/src/explore_me.cpp | 1 / 1 (100.0%) | 15 / 15 (100.0%) | 8 / 8 (100.0%) |
| 71 | +main/tests/explore_me_fuzz_test.cpp | 2 / 2 (100.0%) | 8 / 8 (100.0%) | 0 / 0 (100.0%) |
| 72 | + | | | |
| 73 | + | Functions Hit/Found | Lines Hit/Found | Branches Hit/Found |
| 74 | + Total | 3 / 3 | 23 / 23 | 8 / 8 |
| 75 | +``` |
| 76 | + |
| 77 | +### test_me_fuzz_test |
| 78 | + |
| 79 | +``` |
| 80 | +cifuzz coverage fuzztests:test_me_fuzz_test |
| 81 | +``` |
| 82 | + |
| 83 | +``` |
| 84 | + File | Functions Hit/Found | Lines Hit/Found | Branches Hit/Found |
| 85 | +fuzztests/test_me_fuzz_test.cpp | 2 / 2 (100.0%) | 6 / 6 (100.0%) | 0 / 0 (100.0%) |
| 86 | + | | | |
| 87 | + | Functions Hit/Found | Lines Hit/Found | Branches Hit/Found |
| 88 | + Total | 2 / 2 | 6 / 6 | 0 / 0 |
| 89 | +``` |
0 commit comments