Skip to content

Commit feded0f

Browse files
lgirdwoodlrgirdwo
authored andcommitted
scripts: testbench: move build output outside of source directory
Move all testbench build and test collateral outside of the SOF source directory to the workspace directory. Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
1 parent 8a5b40e commit feded0f

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

scripts/rebuild-testbench.sh

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,27 @@
55
# stop on most errors
66
set -e
77

8-
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
9-
SOF_REPO=$(dirname "$SCRIPT_DIR")
10-
TESTBENCH_DIR="$SOF_REPO"/tools/testbench
8+
# check if we are in the sof FW directory
9+
if [ -f "Kconfig.sof" ]; then
10+
# now go to parent sof workspace directory
11+
cd ..
12+
fi
13+
14+
# check we are in the workspace directory
15+
if [ ! -d "sof" ]; then
16+
echo "Error: This script must be run from the sof firmware toplevel or workspace directory"
17+
exit 1
18+
fi
19+
20+
TESTBENCH_DIR=$PWD/sof/tools/testbench
1121

1222
# Defaults
1323
BUILD_BACKEND='make'
1424
BUILD_TYPE=native
15-
BUILD_DIR_NAME=build_testbench
25+
BUILD_DIR_NAME=$PWD/build_testbench
1626
BUILD_TARGET=install
1727
: "${SOF_AFL:=$HOME/sof/work/AFL/afl-gcc}"
28+
SCRIPT_DIR=$PWD/sof/scripts
1829

1930
print_usage()
2031
{
@@ -59,7 +70,7 @@ setup_xtensa_tools_build()
5970
{
6071
BUILD_TYPE=xt
6172
BUILD_TARGET=
62-
BUILD_DIR_NAME=build_xt_testbench
73+
BUILD_DIR_NAME=$PWD/build_xt_testbench
6374

6475
# check needed environment variables
6576
test -n "${XTENSA_TOOLS_ROOT}" || die "XTENSA_TOOLS_ROOT need to be set.\n"
@@ -90,7 +101,7 @@ setup_xtensa_tools_build()
90101

91102
export_xtensa_setup()
92103
{
93-
export_dir=$TESTBENCH_DIR/$BUILD_DIR_NAME
104+
export_dir=$BUILD_DIR_NAME
94105
export_script=$export_dir/xtrun_env.sh
95106
xtbench=$export_dir/sof-testbench4
96107
xtbench_run="XTENSA_CORE=$XTENSA_CORE \$XTENSA_TOOLS_ROOT/$install_bin/xt-run $xtbench"
@@ -114,14 +125,14 @@ Success!
114125

115126
For temporary, interactive Kconfiguration use:
116127

117-
$BUILD_BACKEND -C $TESTBENCH_DIR/$BUILD_DIR_NAME/sof_ep/build/ menuconfig
128+
$BUILD_BACKEND -C $BUILD_DIR_NAME/sof_ep/build/ menuconfig
118129

119130
Permanent configuration is "src/arch/host/configs/library_defconfig".
120131

121132
For instant, incremental build:
122133

123134
$src_env_msg
124-
$BUILD_BACKEND -C $TESTBENCH_DIR/$BUILD_DIR_NAME/ -j$(nproc)
135+
$BUILD_BACKEND -C $BUILD_DIR_NAME/ -j$(nproc)
125136

126137
EOF0
127138

scripts/sof-testbench-build-profile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fi
3030

3131
#set default values
3232
PLATFORM=none
33-
PDIR=$PWD/sof/tools/testbench/profile
33+
PDIR=$PWD/testbench/profile
3434

3535
while getopts "hp:d:" opt; do
3636
case "${opt}" in

scripts/sof-testbench-helper.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ if [[ "$BITS" == "24" ]]; then
126126
else
127127
sox --encoding signed-integer "$CLIP" -L -r "$RATE_IN" -c "$CHANNELS_IN" -b "$BITS" "$INFILE1"
128128
fi
129-
130-
TB4="$PWD/sof/tools/testbench/build_testbench/install/bin/sof-testbench4"
131-
XTB4="$PWD/sof/tools/testbench/build_xt_testbench/sof-testbench4"
132-
XTB4_SETUP="$PWD/sof/tools/testbench/build_xt_testbench/xtrun_env.sh"
129+
TOOLSDIR="$PWD/build_tools/testbench"
130+
TB4="$PWD/build_testbench/install/bin/sof-testbench4"
131+
XTB4="$PWD/build_xt_testbench/sof-testbench4"
132+
XTB4_SETUP="$PWD/build_xt_testbench/xtrun_env.sh"
133133
if [ -z "$TPLG0" ]; then
134-
TPLG="$PWD/sof/tools/build_tools/topology/topology2/development/sof-hda-benchmark-${MODULE}${BITS}.tplg"
134+
TPLG="$PWD/build_tools/topology/topology2/development/sof-hda-benchmark-${MODULE}${BITS}.tplg"
135135
else
136-
TPLG="$PWD/sof/tools/build_tools/topology/topology2/$TPLG0"
136+
TPLG="$PWD/build_tools/topology/topology2/$TPLG0"
137137
fi
138138
FMT="S${BITS}_LE"
139139
OPTS="-r $RATE_IN -R $RATE_OUT -c $CHANNELS_IN -c $CHANNELS_OUT -b $FMT -p $PIPELINES -t $TPLG -i $INFILE1 -o $OUTFILE1"

0 commit comments

Comments
 (0)