Skip to content

Commit 18cd871

Browse files
committed
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). Signed-off-by: Diana Popa <[email protected]>
1 parent 9237cf5 commit 18cd871

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/integration_tests/build/test_unittests.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
@pytest.mark.timeout(240)
2424
def test_unittests(test_session_root_path):
25-
"""Run all unit tests from all Rust crates in the repo."""
25+
"""Run unit and doc tests from all crates using default target."""
2626
run(
2727
'CARGO_TARGET_DIR={} RUST_BACKTRACE=1 cargo test --all --no-fail-fast'
2828
.format(
@@ -31,3 +31,15 @@ def test_unittests(test_session_root_path):
3131
shell=True,
3232
check=True
3333
)
34+
35+
36+
def test_gnutests(test_session_root_path):
37+
"""Run unit and doc tests from all crates using GNU target."""
38+
run(
39+
'CARGO_TARGET_DIR={} RUST_BACKTRACE=1 cargo test '
40+
'--target x86_64-unknown-linux-gnu --all --no-fail-fast'.format(
41+
os.path.join(test_session_root_path, CARGO_UNITTEST_REL_PATH),
42+
),
43+
shell=True,
44+
check=True
45+
)

0 commit comments

Comments
 (0)