diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2022-01-24 23:50:00 +0100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2022-01-24 23:56:34 +0100 |
commit | 939cf5a8ef159b52faa171c719f7c56afae20543 (patch) | |
tree | 799f749ffaff703208e9eac8b6b12b85cc15cd75 | |
parent | 0777ba1f687956bc0e326d0576d8570cdbdcec96 (diff) | |
download | hardware_replicant_libsamsung-ipc-939cf5a8ef159b52faa171c719f7c56afae20543.tar.gz hardware_replicant_libsamsung-ipc-939cf5a8ef159b52faa171c719f7c56afae20543.tar.bz2 hardware_replicant_libsamsung-ipc-939cf5a8ef159b52faa171c719f7c56afae20543.zip |
tests: nv_data-md5: fix test with out of tree builds
When running the tests in an out of tree build directory (here in
scripts/src/), without that fix, we have the following error in
src/samsung-ipc/tests/test-suite.log when running 'make check':
FAIL: nv_data-md5
=================
Traceback (most recent call last):
File "[...]/scripts/src/tools/../../../tools/nv_data-md5.py", line 69, in <module>
rc = main()
File "[...]/scripts/src/tools/../../../tools/nv_data-md5.py", line 64, in main
nv_data_md5 = NvDataMD5()
File "[...]/scripts/src/tools/../../../tools/nv_data-md5.py", line 39, in __init__
self.nv_data_md5 = sh.Command(srcdir + os.sep + 'nv_data-md5')
File "/usr/lib/python3.9/site-packages/sh.py", line 1342, in __init__
raise CommandNotFound(path)
sh.CommandNotFound: ../../../tools/nv_data-md5
FAIL nv_data-md5.py (exit status: 1)
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rwxr-xr-x | tools/nv_data-md5.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/nv_data-md5.py b/tools/nv_data-md5.py index 2dc98ab..54a8ad1 100755 --- a/tools/nv_data-md5.py +++ b/tools/nv_data-md5.py @@ -32,11 +32,17 @@ def get_output(data): class NvDataMD5(object): def __init__(self): srcdir = os.environ.get('srcdir', None) - # Enable also to test without automake - if not srcdir: - srcdir = os.path.dirname(sys.argv[0]) - self.nv_data_md5 = sh.Command(srcdir + os.sep + 'nv_data-md5') + command_path = '' + if srcdir: + command_path = '.' + os.sep + 'nv_data-md5' + # Enable to run tests without automake + else: + command_path = os.path.dirname(sys.argv[0]) \ + + os.sep \ + + 'nv_data-md5' + + self.nv_data_md5 = sh.Command(command_path) def test_help(self): try: self.nv_data_md5() |