2016-01-15 18:15:24 +00:00
|
|
|
#!/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
|
2016-01-26 20:41:31 +00:00
|
|
|
args = ['py.test', os.path.dirname(__file__) + '/tests']
|
2016-01-15 18:15:24 +00:00
|
|
|
args.extend(sys.argv)
|
|
|
|
|
|
|
|
try:
|
2016-01-26 20:41:31 +00:00
|
|
|
os.execvp('py.test', args)
|
2016-01-15 18:15:24 +00:00
|
|
|
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.
|
2016-01-26 20:41:31 +00:00
|
|
|
print >>sys.stderr, '''
|
2016-01-15 18:15:24 +00:00
|
|
|
exec(py.test) failed; perhaps you are missing some dependencies?
|
2016-01-26 20:41:31 +00:00
|
|
|
See test/py/README.md for the list.'''
|
2016-02-03 17:42:11 +00:00
|
|
|
sys.exit(1)
|