Files
linux-nvgpu/userspace/unit.sh
Philip Elcan 24a678ea81 gpu: nvgpu: unit: run test in right path
This make sure we're in the assumed path for running the unit fw.
This is done for GVS/nvgpu_submit.

JIRA NVGPU-1042

Change-Id: I7dfc874fdde2d97d543c25ac139db23f723985a1
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1848120
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:10 +05:30

32 lines
815 B
Bash
Executable File

#!/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.
#
this_script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
pushd $this_script_dir
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 $*"
$NVGPU_UNIT $*
rc=$?
popd
exit $rc