Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/firecracker
Path: blob/main/tests/integration_tests/build/test_unittests.py
1958 views
1
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
# SPDX-License-Identifier: Apache-2.0
3
"""A test that ensures that all unit tests pass at integration time."""
4
5
import platform
6
7
import pytest
8
9
import host_tools.cargo_build as host # pylint:disable=import-error
10
11
MACHINE = platform.machine()
12
TARGETS = ["{}-unknown-linux-gnu".format(MACHINE),
13
"{}-unknown-linux-musl".format(MACHINE)]
14
15
16
@pytest.mark.parametrize(
17
"target",
18
TARGETS
19
)
20
def test_unittests(test_fc_session_root_path, target):
21
"""Run unit and doc tests for all supported targets."""
22
extra_args = "--release --target {} ".format(target)
23
24
if "musl" in target and MACHINE == "x86_64":
25
pytest.skip("On x86_64 with musl target unit tests"
26
" are already run as part of testing"
27
" code-coverage.")
28
29
host.cargo_test(
30
test_fc_session_root_path,
31
extra_args=extra_args
32
)
33
34