Tom Rini | fe1193e | 2019-10-24 11:59:20 -0400 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 2 | # SPDX-License-Identifier: GPL-2.0 |
Stephen Warren | d201506 | 2016-01-15 11:15:24 -0700 | [diff] [blame] | 3 | |
| 4 | # Copyright (c) 2015 Stephen Warren |
| 5 | # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. |
Stephen Warren | d201506 | 2016-01-15 11:15:24 -0700 | [diff] [blame] | 6 | |
| 7 | # Wrapper script to invoke pytest with the directory name that contains the |
| 8 | # U-Boot tests. |
| 9 | |
| 10 | import os |
| 11 | import os.path |
| 12 | import sys |
Heinrich Schuchardt | 89d52af | 2021-01-28 12:46:11 +0100 | [diff] [blame] | 13 | import pytest |
Tom Rini | 8add4fa | 2019-10-24 11:59:25 -0400 | [diff] [blame] | 14 | from pkg_resources import load_entry_point |
Stephen Warren | d201506 | 2016-01-15 11:15:24 -0700 | [diff] [blame] | 15 | |
Tom Rini | 8add4fa | 2019-10-24 11:59:25 -0400 | [diff] [blame] | 16 | if __name__ == '__main__': |
Heinrich Schuchardt | 89d52af | 2021-01-28 12:46:11 +0100 | [diff] [blame] | 17 | # argv; py.test test_directory_name user-supplied-arguments |
| 18 | args = [os.path.dirname(__file__) + '/tests'] |
| 19 | args.extend(sys.argv) |
Simon Glass | b04f64a | 2021-10-05 20:18:00 -0600 | [diff] [blame] | 20 | |
| 21 | # Use short format by default |
| 22 | if not [arg for arg in args if '--tb=' in arg]: |
| 23 | args.append('--tb=short') |
| 24 | |
Heinrich Schuchardt | 89d52af | 2021-01-28 12:46:11 +0100 | [diff] [blame] | 25 | sys.exit(pytest.main(args)) |