Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 006c2e6

Browse files
committed
Add a procedural macro for expanding all function signatures
Introduce `libm_test::for_each_function`. which macro takes a callback macro and invokes it once per function signature. This provides an easier way of registering various tests and benchmarks without duplicating the function names and signatures each time.
1 parent ae31b8d commit 006c2e6

File tree

5 files changed

+887
-0
lines changed

5 files changed

+887
-0
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ resolver = "2"
2828
members = [
2929
"crates/compiler-builtins-smoke-test",
3030
"crates/libm-bench",
31+
"crates/libm-macros",
3132
"crates/libm-test",
3233
"crates/musl-math-sys",
3334
]
3435
default-members = [
3536
".",
37+
"crates/libm-macros",
3638
"crates/libm-test",
3739
]
3840

crates/libm-macros/Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "libm-macros"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[lib]
7+
proc-macro = true
8+
9+
[dependencies]
10+
proc-macro2 = "1.0.88"
11+
quote = "1.0.37"
12+
syn = { version = "2.0.79", features = ["full", "extra-traits", "visit-mut"] }

0 commit comments

Comments
 (0)