summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorWei Yang <richard.weiyang@gmail.com>2025-03-10 07:49:36 +0000
committerAndrew Morton <akpm@linux-foundation.org>2025-03-17 12:17:01 -0700
commitccaf3efceefc2c3abc6c23277d5a93238efa5c58 (patch)
tree1afe9e48de7d5f5827a5b62607662fd1b560842d /tools
parent82114e45131ff8006435ce40f4275c9c8910b404 (diff)
lib/interval_tree: add test case for span iteration
Verify interval_tree_span_iter_xxx() helpers works as expected. Link: https://lkml.kernel.org/r/20250310074938.26756-6-richard.weiyang@gmail.com Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Michel Lespinasse <michel@lespinasse.org> Cc: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/rbtree/Makefile6
-rw-r--r--tools/testing/rbtree/interval_tree_test.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/tools/testing/rbtree/Makefile b/tools/testing/rbtree/Makefile
index bac6931b499d..d7bbae2af4c7 100644
--- a/tools/testing/rbtree/Makefile
+++ b/tools/testing/rbtree/Makefile
@@ -3,7 +3,7 @@
.PHONY: clean
TARGETS = rbtree_test interval_tree_test
-OFILES = $(LIBS) rbtree-shim.o interval_tree-shim.o
+OFILES = $(SHARED_OFILES) rbtree-shim.o interval_tree-shim.o maple-shim.o
DEPS = ../../../include/linux/rbtree.h \
../../../include/linux/rbtree_types.h \
../../../include/linux/rbtree_augmented.h \
@@ -25,7 +25,9 @@ $(TARGETS): $(OFILES)
rbtree-shim.o: $(DEPS)
rbtree_test.o: ../../../lib/rbtree_test.c
interval_tree-shim.o: $(DEPS)
+interval_tree-shim.o: CFLAGS += -DCONFIG_INTERVAL_TREE_SPAN_ITER
interval_tree_test.o: ../../../lib/interval_tree_test.c
+interval_tree_test.o: CFLAGS += -DCONFIG_INTERVAL_TREE_SPAN_ITER
clean:
- $(RM) $(TARGETS) *.o generated/*
+ $(RM) $(TARGETS) *.o radix-tree.c idr.c generated/*
diff --git a/tools/testing/rbtree/interval_tree_test.c b/tools/testing/rbtree/interval_tree_test.c
index 63775b831c1c..49bc5b534330 100644
--- a/tools/testing/rbtree/interval_tree_test.c
+++ b/tools/testing/rbtree/interval_tree_test.c
@@ -6,6 +6,7 @@
#include <linux/math64.h>
#include <linux/kern_levels.h>
#include "shared.h"
+#include "maple-shared.h"
#include "../../../lib/interval_tree_test.c"
@@ -51,6 +52,7 @@ int main(int argc, char **argv)
usage();
}
+ maple_tree_init();
interval_tree_tests();
return 0;
}