From 1001232191e644c0f46f583de6ac58dd5127ec83 Mon Sep 17 00:00:00 2001 From: Simon Walker Date: Tue, 31 Dec 2024 23:19:36 +0000 Subject: [PATCH] Add pre-command for printing cfitsio version This is mostly useful for CI --- bin/test | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bin/test b/bin/test index 2da962dd..64295042 100755 --- a/bin/test +++ b/bin/test @@ -52,7 +52,17 @@ class TestRunner: sys.exit(e.returncode) print() + def _print_cfitsio_version_with_features(self, *features: str, default_features: bool = True): + cmd = ["cargo", "run", "--package", "fitsio-sys", "--example", "print_version"] + for feature in features: + cmd.extend(["--features", feature]) + if not default_features: + cmd.append("--no-default-features") + print(f"Running {' '.join(cmd)}") + sp.check_call(cmd) + def _run_test_workspace(self): + self._print_cfitsio_version_with_features() self._run_cargo("test", "--locked", "--", "--test-threads", "1") def _run_test_clippy(self, extra_clippy_flags: str): @@ -75,6 +85,7 @@ class TestRunner: self._run_cargo("test", "--locked", "--manifest-path", "fitsio/Cargo.toml", "--features", "array", "--", "--test-threads", "1") def _run_test_fitsio_src(self): + self._print_cfitsio_version_with_features("fitsio-src") self._run_cargo( "test", "--locked", @@ -88,6 +99,7 @@ class TestRunner: ) def _run_test_fitsio_src_and_bindgen(self): + self._print_cfitsio_version_with_features("fitsio-src", "with-bindgen") self._run_cargo( "test", "--locked", @@ -103,6 +115,7 @@ class TestRunner: ) def _run_test_bindgen(self): + self._print_cfitsio_version_with_features("with-bindgen", default_features=False) self._run_cargo( "test", "--locked",