summaryrefslogtreecommitdiff
path: root/build-aux/measurestack/test_app_plugins.py
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/measurestack/test_app_plugins.py')
-rw-r--r--build-aux/measurestack/test_app_plugins.py101
1 files changed, 1 insertions, 100 deletions
diff --git a/build-aux/measurestack/test_app_plugins.py b/build-aux/measurestack/test_app_plugins.py
index 808d55a..3e281b7 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, QName
+from .analyze import QName
def test_fct() -> None:
@@ -70,102 +70,3 @@ def test_fct() -> None:
graph_plugin.assert_nstatic(result.groups["Main"].rows[QName("a")].nstatic, exp_a)
graph_plugin.assert_nstatic(result.groups["Main"].rows[QName("b")].nstatic, exp_b)
-
-
-def test_assert_formatter() -> None:
- # _____________________________________________________
- # | |
- # | |
- # | main |
- # | | |
- # | __wrap_vprintf |
- # | | _______________ |
- # | fmt_vfctprintf / \ |
- # | \ fmt_state_printf | |
- # | \____ ____/ | |
- # | \ / | |
- # | _vfctprintf | |
- # | ____/ \____ ^ |
- # | / ?<---snip | |
- # | conv_builtin \ | |
- # | | libfmt_conv_formatter | |
- # | | | | |
- # | \ lib9p_msg_Rread_format | |
- # | \___________ __/ \___________/ |
- # | \ / |
- # | fmt_state_putchar |
- # | | |
- # | stdio_buffered_printer |
- # | |
- # |_____________________________________________________|
- #
- graph: typing.Sequence[tuple[str, typing.Collection[str]]] = [
- ("main", {"vprintf"}),
- ("__wrap_vprintf", {"fmt_vfctprintf"}),
- ("fmt_vfctprintf", {"_vfctprintf"}),
- ("fmt_state_printf", {"_vfctprintf"}),
- ("_vfctprintf", {"conv_builtin", "libfmt_conv_formatter"}),
- ("conv_builtin", {"fmt_state_putchar"}),
- ("libfmt_conv_formatter", {"lib9p_msg_Rread_format"}),
- ("lib9p_msg_Rread_format", {"fmt_state_putchar", "fmt_state_printf"}),
- ("fmt_state_putchar", {"stdio_buffered_printer", "_out_buffer"}),
- ("stdio_buffered_printer", {}),
- ("_out_buffer", {}), # wrong fct
- ]
-
- # 1 2 3 4 5 6 7 8 9 10 11 <= call_depth
- # - main() ; +
- # - __wrap__vprintf() ; +
- # - fmt_vfctprintf() ; +
- # - _vfctprintf() ; +
- # - conv_builtin() ;
- # - fmt_state_putchar() ;
- # - stdio_buffered_printer() ;
- # - libfmt_conv_formatter() ; +
- # - lib9p_msg_Rread_format() ; +
- # - fmt_state_putchar() ;
- # - stdio_buffered_printer() ;
- # - fmt_state_printf() ; +
- # - _vfctprintf() ; +
- # - conv_builtin() ; +
- # - fmt_state_putchar() ; +
- # - stdio_buffered_printer() ; +
- # - libfmt_conv_formatter() ; skip (formatter won't use %v)
- max_call_depth = 11
- exp = [
- "main",
- "__wrap_vprintf",
- "fmt_vfctprintf",
- "_vfctprintf",
- "libfmt_conv_formatter",
- "lib9p_msg_Rread_format",
- "fmt_state_printf",
- "_vfctprintf",
- "conv_builtin",
- "fmt_state_putchar",
- "stdio_buffered_printer",
- ]
-
- graph_plugin = testutil.GraphProviderPlugin(max_call_depth, graph)
-
- plugins: list[util.Plugin] = [
- graph_plugin,
- app_plugins.LibMiscPlugin(arg_c_fnames=[]),
- app_plugins.PicoFmtPlugin("rp2040", [BaseName("lib9p_msg_Rread_format")]),
- ]
-
- def test_filter(name: QName) -> tuple[int, bool]:
- if name.base() == BaseName("main"):
- return 1, True
- return 0, False
-
- result = analyze.analyze(
- ci_fnames=[],
- app_func_filters={
- "Main": test_filter,
- },
- app=util.PluginApplication(testutil.nop_location_xform, plugins),
- cfg_max_call_depth=max_call_depth,
- )
-
- graph_plugin.assert_nstatic(result.groups["Main"].rows[QName("main")].nstatic, exp)