From 6cc2a5774208ce0abf9fde24a3af60682cb31ff2 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Sat, 8 Nov 2025 11:02:48 -0800 Subject: [PATCH] [fuzz] rename fuzzer source files and update cmake macro (#12125) Rename all fuzzer source files in `tests/fuzz` from `{name}.cpp` to `fuzz_{name}.cpp`. Update the `ot_nexus_test` macro in `tests/fuzz/CMakeLists.txt` to reflect this change, using `fuzz_{name}.cpp` as the source file while naming the test `{name}-fuzzer`. This change improves consistency and makes it easier to distinguish fuzzer source files from other similarly named files during searches. --- tests/fuzz/CMakeLists.txt | 6 +++--- tests/fuzz/{cli.cpp => fuzz_cli.cpp} | 0 tests/fuzz/{icmp6.cpp => fuzz_icmp6.cpp} | 0 tests/fuzz/{ip6.cpp => fuzz_ip6.cpp} | 0 tests/fuzz/{mdns.cpp => fuzz_mdns.cpp} | 0 tests/fuzz/{radio-one-node.cpp => fuzz_radio-one-node.cpp} | 0 tests/fuzz/{trel.cpp => fuzz_trel.cpp} | 0 7 files changed, 3 insertions(+), 3 deletions(-) rename tests/fuzz/{cli.cpp => fuzz_cli.cpp} (100%) rename tests/fuzz/{icmp6.cpp => fuzz_icmp6.cpp} (100%) rename tests/fuzz/{ip6.cpp => fuzz_ip6.cpp} (100%) rename tests/fuzz/{mdns.cpp => fuzz_mdns.cpp} (100%) rename tests/fuzz/{radio-one-node.cpp => fuzz_radio-one-node.cpp} (100%) rename tests/fuzz/{trel.cpp => fuzz_trel.cpp} (100%) diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt index f3b6c4499..66e0e57dc 100644 --- a/tests/fuzz/CMakeLists.txt +++ b/tests/fuzz/CMakeLists.txt @@ -56,12 +56,12 @@ macro(ot_nexus_test name) # Macro to add an OpenThread nexus test. # - # Nexus test name will be `nexus_{name}`. Test source file of - # `test_{name}.cpp` is used. Optional extra arguments can be + # Nexus test name will be `{name}-fuzzer`. Test source file of + # `fuzz_{name}.cpp` is used. Optional extra arguments can be # passed to provide additional source files. add_executable(${name}-fuzzer - ${name}.cpp ${ARGN} + fuzz_${name}.cpp ${ARGN} ) target_include_directories(${name}-fuzzer diff --git a/tests/fuzz/cli.cpp b/tests/fuzz/fuzz_cli.cpp similarity index 100% rename from tests/fuzz/cli.cpp rename to tests/fuzz/fuzz_cli.cpp diff --git a/tests/fuzz/icmp6.cpp b/tests/fuzz/fuzz_icmp6.cpp similarity index 100% rename from tests/fuzz/icmp6.cpp rename to tests/fuzz/fuzz_icmp6.cpp diff --git a/tests/fuzz/ip6.cpp b/tests/fuzz/fuzz_ip6.cpp similarity index 100% rename from tests/fuzz/ip6.cpp rename to tests/fuzz/fuzz_ip6.cpp diff --git a/tests/fuzz/mdns.cpp b/tests/fuzz/fuzz_mdns.cpp similarity index 100% rename from tests/fuzz/mdns.cpp rename to tests/fuzz/fuzz_mdns.cpp diff --git a/tests/fuzz/radio-one-node.cpp b/tests/fuzz/fuzz_radio-one-node.cpp similarity index 100% rename from tests/fuzz/radio-one-node.cpp rename to tests/fuzz/fuzz_radio-one-node.cpp diff --git a/tests/fuzz/trel.cpp b/tests/fuzz/fuzz_trel.cpp similarity index 100% rename from tests/fuzz/trel.cpp rename to tests/fuzz/fuzz_trel.cpp