File: test.py

package info (click to toggle)
u-boot 2016.11%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 104,408 kB
  • ctags: 428,706
  • sloc: ansic: 1,260,674; asm: 33,807; python: 10,106; perl: 8,014; makefile: 7,111; sh: 1,975; cpp: 1,829; yacc: 604; lex: 363; tcl: 28; sed: 24; awk: 6
file content (33 lines) | stat: -rwxr-xr-x 872 bytes parent folder | download
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
26
27
28
29
30
31
32
33
#!/usr/bin/env python

# Copyright (c) 2015 Stephen Warren
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
#
# SPDX-License-Identifier: GPL-2.0

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

import os
import os.path
import sys

# Get rid of argv[0]
sys.argv.pop(0)

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

try:
    os.execvp('py.test', args)
except:
    # Log full details of any exception for detailed analysis
    import traceback
    traceback.print_exc()
    # Hint to the user that they likely simply haven't installed the required
    # dependencies.
    print >>sys.stderr, '''
exec(py.test) failed; perhaps you are missing some dependencies?
See test/py/README.md for the list.'''
    sys.exit(1)