Skip to content

test: make invalid-option parsing checks portable across platforms#1001

Merged
wismill merged 1 commit intoxkbcommon:masterfrom
psumbera:solaris
Apr 1, 2026
Merged

test: make invalid-option parsing checks portable across platforms#1001
wismill merged 1 commit intoxkbcommon:masterfrom
psumbera:solaris

Conversation

@psumbera
Copy link
Copy Markdown
Contributor

No description provided.

@wismill
Copy link
Copy Markdown
Member

wismill commented Mar 20, 2026

Thank you for your interest. Could you provide a description and and example where it fails?

@wismill wismill added the testing Indicates a need for improvements or additions to testing label Mar 20, 2026
@wismill wismill added this to the 1.14.0 milestone Mar 20, 2026
@psumbera psumbera force-pushed the solaris branch 3 times, most recently from c6a7c80 to 9cfb988 Compare March 20, 2026 14:29
@psumbera
Copy link
Copy Markdown
Contributor Author

Thank you for your interest. Could you provide a description and and example where it fails?

It fails during tests on Solaris 11.4 like this:

FAIL: test_invalid_option (main.TestXkbcli.test_invalid_option) (tool=XkbcliTool(subtool=None, skipIf=(), skipError=())) 
Traceback (most recent call last):
  File "/builds/psumbera/userland-libxkbcommon/components/x11/lib/libxkbcommon/libxkbcommon-xkbcommon-1.13.1/test/tool-option-parsing.py", line 375, in test_invalid_option
    tool.run_command_unrecognized_option(["--foobar"])
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/builds/psumbera/userland-libxkbcommon/components/x11/lib/libxkbcommon/libxkbcommon-xkbcommon-1.13.1/test/tool-option-parsing.py", line 247, in run_command_unrecognized_option
    assert "unrecognized option" in stderr
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError 

Copy link
Copy Markdown
Member

@wismill wismill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the MR. Could you improve the commit message so that it explains exactly what it fixes, with an example (e.g. Solaris).

Keep checking EXIT_INVALID_USAGE for invalid options, but stop requiring
the exact GNU-style stderr text "unrecognized option".

On Solaris the same failure may report "illegal option", "unknown option",
or only usage/help text, while still returning the expected exit code.
@wismill wismill merged commit 48500df into xkbcommon:master Apr 1, 2026
6 checks passed
@wismill
Copy link
Copy Markdown
Member

wismill commented Apr 1, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Indicates a need for improvements or additions to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants