diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 08285b7b852..7c4b403ca5b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -103,3 +103,11 @@ jobs: GH_TOKEN: ${{github.token}} RELEASE_PLEASE_TAG_NAME: ${{steps.release.outputs.tag_name}} if: steps.release.outputs.release_created + + distcheck-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + - run: env PYTESTFLAGS="--verbose -p no:cacheprovider --color=yes" test/macos-script.sh diff --git a/test/macos-script.sh b/test/macos-script.sh new file mode 100755 index 00000000000..959d182d8fe --- /dev/null +++ b/test/macos-script.sh @@ -0,0 +1,29 @@ +#!/bin/sh -eux + +# Note that this script is intended to be run only in throwaway environments; +# it may install undesirable things to system locations (if it succeeds in +# that). + +brew install \ + automake \ + bash + +python3 -m venv venv +#shellcheck disable=SC1091 +source venv/bin/activate +python3 -m pip install -r test/requirements.txt + +export bashcomp_bash=bash +env +LC_ALL=C sort <<<$'python-dev\npython3-dev' +LC_COLLATE=C sort <<<$'python-dev\npython3-dev' +LC_ALL=en_US.UTF-8 sort <<<$'python-dev\npython3-dev' +LC_COLLATE=en_US.UTF-8 sort <<<$'python-dev\npython3-dev' + + +autoreconf -i +./configure +make -j + +make distcheck \ + PYTESTFLAGS="${PYTESTFLAGS---verbose -p no:cacheprovider --numprocesses=auto --dist=loadfile}" diff --git a/test/t/conftest.py b/test/t/conftest.py index 803d57cf69f..5fa73820bcf 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -784,7 +784,7 @@ def startswith(self, prefix: str) -> bool: return self.output.startswith(prefix) def _items(self) -> List[str]: - return [x.strip() for x in self.output.strip().splitlines()] + return [x.strip() for x in self.output.strip().splitlines() if x] def __eq__(self, expected: object) -> bool: """ diff --git a/test/t/test_tar.py b/test/t/test_tar.py index 73db7c30905..8d03da296f0 100644 --- a/test/t/test_tar.py +++ b/test/t/test_tar.py @@ -129,7 +129,7 @@ def test_24(self, completion): # Test compression detection of gnu style options @pytest.mark.complete("tar --extract --xz --file ", cwd="tar") - def test_25(self, completion): + def test_25(self, completion, gnu_tar): assert completion == "archive.tar.xz dir/ dir2/".split() # TODO: "tar tf escape.tar a/b" diff --git a/test/t/test_vipw.py b/test/t/test_vipw.py index b78fcbda8b0..07b454bff4f 100644 --- a/test/t/test_vipw.py +++ b/test/t/test_vipw.py @@ -1,12 +1,7 @@ -import sys - import pytest class TestVipw: @pytest.mark.complete("vipw -", require_cmd=True) def test_1(self, completion): - if sys.platform == "darwin": - assert not completion # takes no options - else: - assert completion + assert completion diff --git a/test/t/unit/test_unit_dequote.py b/test/t/unit/test_unit_dequote.py index 392b54266f7..102c3470c80 100644 --- a/test/t/unit/test_unit_dequote.py +++ b/test/t/unit/test_unit_dequote.py @@ -37,6 +37,8 @@ def test_5_brace(self, bash, functions): assert output.strip() == "" def test_6_glob(self, bash, functions): + LC_out = assert_bash_exec(bash, "env | grep LC_", want_output=True) + print(f"LC_ vars:\n\n{LC_out}\n") output = assert_bash_exec(bash, "__tester 'a?b'", want_output=True) assert output.strip() == ""