From bf99dfdaf2dd974723dfce23d815b2f5ee83673d Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Fri, 21 Sep 2018 10:59:49 -0400 Subject: gpu: nvgpu: unit: update unit.h for target The directory structure is every so slightly different on target, so this handles the differences. JIRA NVGPU-1042 Change-Id: I5a0566c7d371fcb5cd541c71841e8acedfaac6e2 Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/1837443 Reviewed-by: svc-misra-checker Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/unit.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'userspace/unit.sh') 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 @@ #!/bin/bash +# Copyright (c) 2018, NVIDIA CORPORATION. All Rights Reserved. + # # Execute the unit test. Args to this script are passed on to the unit test # core. This just serves to set the LD_LIBRARY_PATH environment variable such # that unit tests are found and nvgpu-drv is found. # -LD_LIBRARY_PATH="build:build/units" -NVGPU_UNIT=build/nvgpu_unit - +if [ -f nvgpu_unit ]; then + # if the executable is in the current directory, we are running on + # target, so use that dir structure + LD_LIBRARY_PATH=".:units" + NVGPU_UNIT="./nvgpu_unit -L units/" +else + # running on host + LD_LIBRARY_PATH="build:build/units" + NVGPU_UNIT=build/nvgpu_unit +fi export LD_LIBRARY_PATH echo "$ $NVGPU_UNIT $*" -- cgit v1.2.2