summaryrefslogblamecommitdiffstats
path: root/userspace/unit.sh
blob: dd74322cc295d2d13706eeab4a76b91fd901e698 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

           

                                                               





                                                                             









                                                                          




                       
#!/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.
#

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 $*