diff options
Diffstat (limited to 'userspace')
-rwxr-xr-x | userspace/unit.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/userspace/unit.sh b/userspace/unit.sh index 078512f8..dd74322c 100755 --- a/userspace/unit.sh +++ b/userspace/unit.sh | |||
@@ -1,14 +1,23 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | # Copyright (c) 2018, NVIDIA CORPORATION. All Rights Reserved. | ||
4 | |||
3 | # | 5 | # |
4 | # Execute the unit test. Args to this script are passed on to the unit test | 6 | # Execute the unit test. Args to this script are passed on to the unit test |
5 | # core. This just serves to set the LD_LIBRARY_PATH environment variable such | 7 | # core. This just serves to set the LD_LIBRARY_PATH environment variable such |
6 | # that unit tests are found and nvgpu-drv is found. | 8 | # that unit tests are found and nvgpu-drv is found. |
7 | # | 9 | # |
8 | 10 | ||
9 | LD_LIBRARY_PATH="build:build/units" | 11 | if [ -f nvgpu_unit ]; then |
10 | NVGPU_UNIT=build/nvgpu_unit | 12 | # if the executable is in the current directory, we are running on |
11 | 13 | # target, so use that dir structure | |
14 | LD_LIBRARY_PATH=".:units" | ||
15 | NVGPU_UNIT="./nvgpu_unit -L units/" | ||
16 | else | ||
17 | # running on host | ||
18 | LD_LIBRARY_PATH="build:build/units" | ||
19 | NVGPU_UNIT=build/nvgpu_unit | ||
20 | fi | ||
12 | export LD_LIBRARY_PATH | 21 | export LD_LIBRARY_PATH |
13 | 22 | ||
14 | echo "$ $NVGPU_UNIT $*" | 23 | echo "$ $NVGPU_UNIT $*" |