~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: 95859a66e29b791784efad585573c8e6c173bc23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0

# Copyright (c) 2015 Stephen Warren
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.

# Wrapper script to invoke pytest with the directory name that contains the
# U-Boot tests.

import os
import os.path
import sys
import pytest
from pkg_resources import load_entry_point

if __name__ == '__main__':
    # argv; py.test test_directory_name user-supplied-arguments
    args = [os.path.dirname(__file__) + '/tests']
    args.extend(sys.argv)

    # Use short format by default
    if not [arg for arg in args if '--tb=' in arg]:
        args.append('--tb=short')

    sys.exit(pytest.main(args))