Files
linux-nvgpu/userspace/unit.sh
Philip Elcan 45db303354 gpu: nvgpu: unit: update params for on target runs
When run on target, presumably as part of GVS, we need to run
multithreaded, without colors and with the nvtest output. This updates
unit.sh to apply those params on target.

Also use the long parameter names since they should be self documenting.

JIRA NVGPU-1042

Change-Id: I27f0d1371df9b553262e1ebe1e4b258202c322d2
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1924617
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-18 13:44:32 -07:00

34 lines
947 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"
cores=$(cat /proc/cpuinfo |grep processor |wc -l)
NVGPU_UNIT="./nvgpu_unit --nvtest --unit-load-path units/ --no-color \
--num-threads $cores"
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