Skip to content

Commit d4620d9

Browse files
authored
Merge pull request hathach#1716 from silvergasp/master
fuzz: Add support for fuzzing
2 parents ab8cfb3 + c19bffb commit d4620d9

36 files changed

+2727
-57
lines changed

.github/workflows/build_aarch64.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Build AArch64
33
on:
44
push:
55
paths:
6-
- 'src'
7-
- 'examples'
8-
- 'lib'
9-
- 'hw'
6+
- 'src/**'
7+
- 'examples/**'
8+
- 'lib/**'
9+
- 'hw/**'
1010
pull_request:
1111
branches: [ master ]
1212
paths:
13-
- 'src'
14-
- 'examples'
15-
- 'lib'
16-
- 'hw'
13+
- 'src/**'
14+
- 'examples/**'
15+
- 'lib/**'
16+
- 'hw/**'
1717

1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/build_arm.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Build ARM
33
on:
44
push:
55
paths:
6-
- 'src'
7-
- 'examples'
8-
- 'lib'
9-
- 'hw'
6+
- 'src/**'
7+
- 'examples/**'
8+
- 'lib/**'
9+
- 'hw/**'
1010
pull_request:
1111
branches: [ master ]
1212
paths:
13-
- 'src'
14-
- 'examples'
15-
- 'lib'
16-
- 'hw'
13+
- 'src/**'
14+
- 'examples/**'
15+
- 'lib/**'
16+
- 'hw/**'
1717

1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/build_esp.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Build ESP
33
on:
44
push:
55
paths:
6-
- 'src'
7-
- 'examples'
8-
- 'lib'
9-
- 'hw'
6+
- 'src/**'
7+
- 'examples/**'
8+
- 'lib/**'
9+
- 'hw/**'
1010
pull_request:
1111
branches: [ master ]
1212
paths:
13-
- 'src'
14-
- 'examples'
15-
- 'lib'
16-
- 'hw'
13+
- 'src/**'
14+
- 'examples/**'
15+
- 'lib/**'
16+
- 'hw/**'
1717

1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/build_msp430.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Build MSP430
33
on:
44
push:
55
paths:
6-
- 'src'
7-
- 'examples'
8-
- 'lib'
9-
- 'hw'
6+
- 'src/**'
7+
- 'examples/**'
8+
- 'lib/**'
9+
- 'hw/**'
1010
pull_request:
1111
branches: [ master ]
1212
paths:
13-
- 'src'
14-
- 'examples'
15-
- 'lib'
16-
- 'hw'
13+
- 'src/**'
14+
- 'examples/**'
15+
- 'lib/**'
16+
- 'hw/**'
1717

1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/build_renesas.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Build Renesas
33
on:
44
push:
55
paths:
6-
- 'src'
7-
- 'examples'
8-
- 'lib'
9-
- 'hw'
6+
- 'src/**'
7+
- 'examples/**'
8+
- 'lib/**'
9+
- 'hw/**'
1010
pull_request:
1111
branches: [ master ]
1212
paths:
13-
- 'src'
14-
- 'examples'
15-
- 'lib'
16-
- 'hw'
13+
- 'src/**'
14+
- 'examples/**'
15+
- 'lib/**'
16+
- 'hw/**'
1717

1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/build_riscv.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Build RISC-V
33
on:
44
push:
55
paths:
6-
- 'src'
7-
- 'examples'
8-
- 'lib'
9-
- 'hw'
6+
- 'src/**'
7+
- 'examples/**'
8+
- 'lib/**'
9+
- 'hw/**'
1010
pull_request:
1111
branches: [ master ]
1212
paths:
13-
- 'src'
14-
- 'examples'
15-
- 'lib'
16-
- 'hw'
13+
- 'src/**'
14+
- 'examples/**'
15+
- 'lib/**'
16+
- 'hw/**'
1717

1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/pre-commit.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,13 @@ jobs:
3434
# Install Ceedling
3535
gem install ceedling
3636
cd test/unit-test
37-
ceedling test:all
37+
ceedling test:all
38+
39+
- name: Build Fuzzer
40+
run: |
41+
fuzz_harness=$(ls -d test/fuzz/device/*/)
42+
for h in $fuzz_harness
43+
do
44+
make -C $h get-deps
45+
make -C $h all
46+
done

.github/workflows/test_hardware.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Hardware Test
33
on:
44
push:
55
paths:
6-
- 'src'
7-
- 'examples'
8-
- 'lib'
9-
- 'hw'
6+
- 'src/**'
7+
- 'examples/**'
8+
- 'lib/**'
9+
- 'hw/**'
1010
pull_request:
1111
branches: [ master ]
1212
paths:
13-
- 'src'
14-
- 'examples'
15-
- 'lib'
16-
- 'hw'
13+
- 'src/**'
14+
- 'examples/**'
15+
- 'lib/**'
16+
- 'hw/**'
1717

1818
# Hardware in the loop (HIL)
1919
# Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user

src/class/cdc/cdc_device.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ uint32_t tud_cdc_n_write(uint8_t itf, void const* buffer, uint32_t bufsize)
171171
uint16_t ret = tu_fifo_write_n(&p_cdc->tx_ff, buffer, (uint16_t) bufsize);
172172

173173
// flush if queue more than packet size
174+
// may need to suppress -Wunreachable-code since most of the time CFG_TUD_CDC_TX_BUFSIZE < BULK_PACKET_SIZE
174175
if ( (tu_fifo_count(&p_cdc->tx_ff) >= BULK_PACKET_SIZE) || ((CFG_TUD_CDC_TX_BUFSIZE < BULK_PACKET_SIZE) && tu_fifo_full(&p_cdc->tx_ff)) )
175176
{
176177
tud_cdc_n_write_flush(itf);

0 commit comments

Comments
 (0)