From 898dd620223d2726fe299b2a6bf7957b7c9ae513 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sun, 3 Apr 2022 10:46:10 +0100 Subject: [PATCH] Add test for argument passthrough --- test/test_from_sdist.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/test_from_sdist.py b/test/test_from_sdist.py index c3eeda49..fe312fd9 100644 --- a/test/test_from_sdist.py +++ b/test/test_from_sdist.py @@ -175,3 +175,44 @@ def test_internal_config_file_argument(tmp_path, capfd): # check that before-all was run captured = capfd.readouterr() assert "test log statement from before-all 1829" in captured.out + + +def test_argument_passthrough(tmp_path, capfd): + basic_project = test_projects.new_c_project() + + # make an sdist of a project + sdist_dir = tmp_path / "sdist" + sdist_dir.mkdir() + sdist_path = make_sdist(basic_project, sdist_dir) + + # make a call that should pass some args through to cibuildwheel + # this asks cibuildwheel to print the ppc64le build identifiers + process = subprocess.run( + [ + sys.executable, + "-m", + "cibuildwheel.from_sdist", + sdist_path, + "--platform", + "linux", + "--archs", + "ppc64le", + "--print-build-identifiers", + ], + env={ + **os.environ, + "CIBW_BUILD": "cp38-*", + }, + check=True, + stdout=subprocess.PIPE, + universal_newlines=True, + ) + + # fmt: off + assert process.stdout == textwrap.dedent( + """ + cp38-manylinux_ppc64le + cp38-musllinux_ppc64le + """ + ).lstrip() + # fmt: on