git: 9a65dc5984e3 - main - devel/blueprint-compiler: unbreak "make test"

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Sun, 09 Oct 2022 14:11:24 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9a65dc5984e327cade8669642f9fc71fae294251

commit 9a65dc5984e327cade8669642f9fc71fae294251
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2022-10-09 14:10:09 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-10-09 14:10:21 +0000

    devel/blueprint-compiler: unbreak "make test"
    
    $ make test
    [...]
    ===>  Testing for blueprint-compiler-0.4.0
    ===>   blueprint-compiler-0.4.0 depends on file: /usr/local/bin/python3.9 - found
    [  0% 1/1] /usr/local/bin/meson test --no-rebuild --print-errorlogs
    1/1 tests        FAIL            0.16s   exit status 1
    >>> MALLOC_PERTURB_=73 /usr/local/bin/python3.9 -m unittest
    ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
    stdout:
    error: Could not find GTK 4 introspection files. Is gobject-introspection installed?
    at accessibility.blp line 1 column 11:
       1 |using Gtk 4.0;
         |          ^
    hint: search path: /usr/local/lib/girepository-1.0
    
    stderr:
    EEF...
    ======================================================================
    ERROR: test_decompiler (tests.test_samples.TestSamples)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/tests/test_samples.py", line 120, in assert_decompile
        actual = decompiler.decompile(ui_path)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/decompiler.py", line 186, in decompile
        ctx = DecompileCtx()
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/decompiler.py", line 61, in __init__
        self.gir.add_namespace(get_namespace("Gtk", "4.0"))
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/gir.py", line 52, in get_namespace
        raise CompileError(
    blueprintcompiler.errors.CompileError: Namespace Gtk-4.0 could not be found
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/tests/test_samples.py", line 212, in test_decompiler
        self.assert_decompile("accessibility_dec")
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/tests/test_samples.py", line 127, in assert_decompile
        e.pretty_print(name + ".blp", blueprint)
    NameError: name 'blueprint' is not defined
    
    ======================================================================
    ERROR: test_sample_errors (tests.test_samples.TestSamples)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/tests/test_samples.py", line 164, in test_sample_errors
        self.assert_sample_error("a11y_in_non_widget")
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/tests/test_samples.py", line 83, in assert_sample_error
        self.assert_completions_dont_crash(blueprint, ast, tokens)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/tests/test_samples.py", line 40, in assert_completions_dont_crash
        list(complete(ast, tokens, i))
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/completions.py", line 64, in complete
        yield from _complete(ast_node, tokens, idx, token_idx)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/completions.py", line 36, in _complete
        yield from _complete(child, tokens, idx, token_idx)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/completions.py", line 36, in _complete
        yield from _complete(child, tokens, idx, token_idx)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/completions.py", line 36, in _complete
        yield from _complete(child, tokens, idx, token_idx)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/completions.py", line 49, in _complete
        yield from completer(prev_tokens, ast_node)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/completions_utils.py", line 73, in inner
        yield from func(ast_node, match_variables)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/language/gtk_a11y.py", line 194, in a11y_name_completer
        yield Completion(name, CompletionItemKind.Property, docs=_get_docs(ast_node.root.gir, type))
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/language/gtk_a11y.py", line 98, in _get_docs
        gir.get_type("AccessibleProperty", "Gtk").members.get(name)
    AttributeError: 'NoneType' object has no attribute 'members'
    
    ======================================================================
    FAIL: test_samples (tests.test_samples.TestSamples)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/tests/test_samples.py", line 54, in assert_sample
        if len(ast.errors):
      File "/usr/local/lib/python3.9/functools.py", line 993, in __get__
        val = self.func(instance)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/ast_utils.py", line 79, in errors
        return list(self._get_errors())
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/ast_utils.py", line 84, in _get_errors
        validator(self)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/ast_utils.py", line 160, in inner
        func(self)
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/blueprintcompiler/language/ui.py", line 71, in gir_errors
        raise MultipleErrors(self._gir_errors)
    blueprintcompiler.errors.MultipleErrors
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/tests/test_samples.py", line 132, in test_samples
        self.assert_sample("accessibility")
      File "/wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/tests/test_samples.py", line 69, in assert_sample
        raise AssertionError()
    AssertionError
    
    ----------------------------------------------------------------------
    Ran 6 tests in 0.036s
    
    FAILED (failures=1, errors=2)
    ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
    
    Summary of Failures:
    
    1/1 tests FAIL            0.16s   exit status 1
    
    Ok:                 0
    Expected Fail:      0
    Fail:               1
    Unexpected Pass:    0
    Skipped:            0
    Timeout:            0
    
    Full log written to /wrkdirs/usr/ports/devel/blueprint-compiler/work/blueprint-compiler-75a6d95988736ec0471d22ceb07579c0cedac2ad/_build/meson-logs/testlog.txt
    FAILED: meson-internal__test
    /usr/local/bin/meson test --no-rebuild --print-errorlogs
    ninja: build stopped: subcommand failed.
    *** Error code 1
---
 devel/blueprint-compiler/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/devel/blueprint-compiler/Makefile b/devel/blueprint-compiler/Makefile
index a4448692b953..28ba2af8fecb 100644
--- a/devel/blueprint-compiler/Makefile
+++ b/devel/blueprint-compiler/Makefile
@@ -10,6 +10,8 @@ WWW=		https://gitlab.gnome.org/jwestman/blueprint-compiler
 LICENSE=	LGPL3+
 LICENSE_FILE=	${WRKSRC}/COPYING
 
+TEST_DEPENDS=	gtk4>0:x11-toolkits/gtk40
+
 USES=		gnome meson python shebangfix
 USE_GITLAB=	yes
 USE_GNOME=	pygobject3