mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-07 05:34:28 +00:00
8add4fa417
Now that we have moved to being based on pytest for python3 we need to make our test.py wrapper more robust in terms of only calling python3 rather than possibly finding and using python2. To do this, change from execvp()'ing pytest to invoking the package itself via python. In the event that pytest is unavailable we still get a user-friendly error: pkg_resources.DistributionNotFound: The 'pytest' distribution was not found and is required by the application Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com> Tested-by: Simon Glass <sjg@chromium.org> [on sandbox] Signed-off-by: Tom Rini <trini@konsulko.com>
20 lines
569 B
Python
Executable file
20 lines
569 B
Python
Executable file
#!/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
|
|
from pkg_resources import load_entry_point
|
|
|
|
# argv; py.test test_directory_name user-supplied-arguments
|
|
args = [os.path.dirname(__file__) + '/tests']
|
|
args.extend(sys.argv)
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(load_entry_point('pytest', 'console_scripts', 'pytest')(args))
|