summaryrefslogtreecommitdiff
path: root/build-aux/measurestack/test_app_plugins.py
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-30 15:28:08 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-05-12 12:50:04 -0600
commit8d62847854ce2cc132177712efc88607a7e1cfb0 (patch)
tree9a12b9d2b768202cab959c1f0d42d3aef874dd37 /build-aux/measurestack/test_app_plugins.py
parentcd5e55ebb7d5a51c0a8bd62137ab75a0f6ff1356 (diff)
measurestack: Rework the nstatic memoization to be easier to think aboutlukeshu/measurestack-refactor
Diffstat (limited to 'build-aux/measurestack/test_app_plugins.py')
-rw-r--r--build-aux/measurestack/test_app_plugins.py29
1 files changed, 3 insertions, 26 deletions
diff --git a/build-aux/measurestack/test_app_plugins.py b/build-aux/measurestack/test_app_plugins.py
index da8be65..d0a8d2a 100644
--- a/build-aux/measurestack/test_app_plugins.py
+++ b/build-aux/measurestack/test_app_plugins.py
@@ -8,7 +8,7 @@
import typing
from . import analyze, app_plugins, testutil, util
-from .analyze import BaseName, Node, QName, SkipModel
+from .analyze import BaseName, NodeHandler, QName
def test_assert_msg_fail() -> None:
@@ -48,31 +48,8 @@ def test_assert_msg_fail() -> None:
graph_plugin = testutil.GraphProviderPlugin(max_call_depth, graph)
class SkipPlugin(testutil.NopPlugin):
- def skipmodels(self) -> dict[BaseName, SkipModel]:
- models = app_plugins.LibMiscPlugin(arg_c_fnames=[]).skipmodels()
- assert BaseName("__assert_msg_fail") in models
- orig_model = models[BaseName("__assert_msg_fail")]
-
- def wrapped_model_fn(
- chain: typing.Sequence[QName], node: Node, call: QName
- ) -> bool:
- dbgstr = (
- ("=>".join(str(c) for c in [*chain, node.funcname]))
- + "=?=>"
- + str(call)
- )
- assert dbgstr in [
- "__assert_msg_fail=?=>__lm_light_printf",
- "__assert_msg_fail=?=>__lm_abort",
- "__assert_msg_fail=>__lm_light_printf=>fmt_vfctprintf=>stdio_putchar=>__assert_msg_fail=?=>__lm_light_printf",
- "__assert_msg_fail=>__lm_light_printf=>fmt_vfctprintf=>stdio_putchar=>__assert_msg_fail=?=>__lm_abort",
- ]
- return orig_model.fn(chain, node, call)
-
- models[BaseName("__assert_msg_fail")] = SkipModel(
- orig_model.nchain, wrapped_model_fn
- )
- return models
+ def node_handlers(self) -> dict[BaseName, NodeHandler]:
+ return app_plugins.LibMiscPlugin(arg_c_fnames=[]).node_handlers()
def test_filter(name: QName) -> tuple[int, bool]:
if name.base() == BaseName("main"):