CI: enforce GNU run of unit and doc tests
Adds a integration tests for ensuring correctness of the doc tests. The
doc tests can only be run by using the default host target (i.e GNU).
@@ -22,7 +22,7 @@ CARGO_UNITTEST_REL_PATH = os.path.join(host.CARGO_BUILD_REL_PATH, "test")
@pytest.mark.timeout(240)
def test_unittests(test_session_root_path):
- """Run all unit tests from all Rust crates in the repo."""
+ """Run unit and doc tests from all crates using default target."""
run(
'CARGO_TARGET_DIR={} RUST_BACKTRACE=1 cargo test --all --no-fail-fast'
.format(
@@ -31,3 +31,15 @@ def test_unittests(test_session_root_path):
shell=True,
check=True
)
+
+
+def test_gnutests(test_session_root_path):
+ """Run unit and doc tests from all crates using GNU target."""
+ run(
+ 'CARGO_TARGET_DIR={} RUST_BACKTRACE=1 cargo test '
+ '--target x86_64-unknown-linux-gnu --all --no-fail-fast'.format(
+ os.path.join(test_session_root_path, CARGO_UNITTEST_REL_PATH),
+ ),
+ shell=True,
+ check=True
+ )
