Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC tests fail on non-x86 platforms #1201

Open
2 of 3 tasks
awilfox opened this issue May 27, 2024 · 1 comment
Open
2 of 3 tasks

GCC tests fail on non-x86 platforms #1201

awilfox opened this issue May 27, 2024 · 1 comment

Comments

@awilfox
Copy link

awilfox commented May 27, 2024

Describe the bug

The test_march_native and test_mtune_generic tests fail when run on my 64-bit PowerPC workstation.

To reproduce

  1. Have a computer running an ISA that doesn't use -march in GCC (or support generic for -mtune).
  2. Run the test suite (make check).

Expected behavior

Passing tests.

Versions (please complete the following information)

  • Operating system name/distribution and version: Adélie Linux 1.0-beta5
  • bash version, echo "$BASH_VERSION": 5.1.16(1)-release
  • bash-completion version, (IFS=.; echo "${BASH_COMPLETION_VERSINFO[*]}"): affects git HEAD, but testing with 2.13.0.

Additional context

GCC doesn't use -march for every ISA, and -mtune=generic isn't available on every arch either.

Debug trace

============================================================ FAILURES ============================================================
___________________________________________________ TestGcc.test_march_native ____________________________________________________

self = <test_gcc.TestGcc object at 0x3fff89b2a7d0>, completion = <CompletionResult []>, gcc_with_completion = None

    @pytest.mark.complete("gcc -march=")
    def test_march_native(self, completion, gcc_with_completion):
>       assert "native" in completion
E       AssertionError: assert 'native' in <CompletionResult []>

/home/awilcox/Code/awilfox/gcc-next/user/bash-completion/src/bash-completion-2.11/test/t/test_gcc.py:60: AssertionError
___________________________________________________ TestGcc.test_mtune_generic ___________________________________________________

self = <test_gcc.TestGcc object at 0x3fff89b0ea90>
completion = <CompletionResult ['401', '403', '405', '405fp', '440', '440fp', '464', '464fp', '476', '476fp', '505', '601', '602', ... 'power5+', 'power6', 'power6x', 'power7', 'power8', 'power9', 'powerpc', 'powerpc64', 'powerpc64le', 'rs64', 'titan']>
gcc_with_completion = None

    @pytest.mark.complete("gcc -mtune=")
    def test_mtune_generic(self, completion, gcc_with_completion):
>       assert "generic" in completion
E       AssertionError: assert 'generic' in <CompletionResult ['401', '403', '405', '405fp', '440', '440fp', '464', '464fp', '476', '476fp', '505', '601', '602', ... 'power5+', 'power6', 'power6x', 'power7', 'power8', 'power9', 'powerpc', 'powerpc64', 'powerpc64le', 'rs64', 'titan']>

/home/awilcox/Code/awilfox/gcc-next/user/bash-completion/src/bash-completion-2.11/test/t/test_gcc.py:64: AssertionError
==================================================== short test summary info =====================================================
FAILED test_gcc.py::TestGcc::test_march_native - AssertionError: assert 'native' in <CompletionResult []>
FAILED test_gcc.py::TestGcc::test_mtune_generic - AssertionError: assert 'generic' in <CompletionResult ['401', '403', '405', '...
========================= 2 failed, 1210 passed, 327 skipped, 19 xfailed, 4 xpassed in 789.83s (0:13:09) =========================

I've worked around it in our packaging by extending those two tests with the gcc_x86 fixture, and I would be happy to submit that change as an MR if it is palatable. Technically, -march=native would work on at least aarch64 as well.

@scop
Copy link
Owner

scop commented May 30, 2024

Thanks for the report! I would rather add some arch specific expectations than exclude those tests altogether on non-x86. For -mtune, perhaps even do something like this

--- a/test/t/test_gcc.py
+++ b/test/t/test_gcc.py
@@ -60,5 +60,8 @@ class TestGcc:
         assert "native" in completion
 
     @pytest.mark.complete("gcc -mtune=")
-    def test_mtune_generic(self, completion, gcc_with_completion):
-        assert "generic" in completion
+    def test_mtune(self, completion, gcc_with_completion):
+        # generic: x86, some others
+        # power*: ppc
+        assert "generic" in completion or \
+            any(x.startswith("power") for x in completion)

(Aside, when we sometime get the macOS tests to usable state in GitHub CI, we could get a bit of coverage on these.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants