Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/firecracker
Path: blob/main/tests/integration_tests/build/test_clippy.py
1958 views
1
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
# SPDX-License-Identifier: Apache-2.0
3
"""Tests ensuring codebase style compliance for Rust and Python."""
4
5
6
import platform
7
import pytest
8
import framework.utils as utils
9
10
SUCCESS_CODE = 0
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_rust_clippy(target):
21
"""Fails if clippy generates any error, warnings are ignored."""
22
utils.run_cmd(
23
'cargo clippy --target {} --all --profile test'
24
' -- -D warnings'.format(target))
25
26