-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testbench: dont build testbench, tools and topologies in the source directory #9871
base: main
Are you sure you want to change the base?
Conversation
Allow both scripts to be executed from the SOF FW directory or the parent SOF workspace directory without an environment variable. This simplifies usage and opens the way for vscode integration. Signed-off-by: Liam Girdwood <[email protected]>
Dont built binaries in the source directory, build in the workspace. Signed-off-by: Liam Girdwood <[email protected]>
Fix the indentation. Signed-off-by: Liam Girdwood <[email protected]>
I expect this to break CI if we have hard coded assumptions of where to find certain binaries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general a very good idea! Having tools' build directories withing the source tree was always quite inconvenient
scripts/sof-testbench-helper.sh
Outdated
echo Converting raw output to "$OUTWAV" | ||
if [[ "$BITS" == "24" ]]; then | ||
sox --encoding signed-integer -L -r "$RATE_OUT" -c "$CHANNELS_OUT" -b 32 "$OUTFILE1" "$OUTWAV" vol 256 | ||
sox --encoding signed-integer -L -r "$RATE_OUT" -c "$CHANNELS_OUT" -b 32 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original indentation seems to have been correct. Also this and the following line shouldn't have equal indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is a mixture of tabs/spaces for indentation. Fixed this part.
echo "Error: environment variable SOF_WORKSPACE need to be set to top level sof directory" | ||
|
||
# check if we are in the sof FW directory | ||
if [ -f "Kconfig.sof" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we maybe use something like $(dirname "$0")
to identify the target directory, where we have to switch to? Then it'll be possible to call the script from anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That adds a bit of complexity if we say this is allowed to be executed from anywhere, in general this will be called from the SOF directory or the parent SOF workspace directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No blockers, @singalsu probably better to comment on the end-user impact on testbench scripting (see my comment).
This will need to be merged at the same time with Jenkins build changes. Another option is to make the build-outside-src an option, merge this in SOF and let Jenkins adopt this when it is ready (no flag day approach).
Move all testbench build and test collateral outside of the SOF source directory to the workspace directory. Signed-off-by: Liam Girdwood <[email protected]>
Move the test data files outside of the source directory and add more context to their names for easier lookup. Do the same with the outfile and generate it if we keep the temporary files. Signed-off-by: Liam Girdwood <[email protected]>
5d17e7d
to
a4b62b7
Compare
This depends on #9870 so DNM as for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, please add these changes to keep Matlab script tests working
diff --git a/tools/test/audio/comp_run.sh b/tools/test/audio/comp_run.sh
index 096ff2c34..6beaf74f5 100755
--- a/tools/test/audio/comp_run.sh
+++ b/tools/test/audio/comp_run.sh
@@ -132,13 +132,13 @@ run_testbench ()
parse_args "$@"
# Path to topologies
-TPLG_DIR=../../build_tools/test/topology
+TPLG_DIR=../../../../build_tools/test/topology
# Testbench path and executable
if [[ -z $XTRUN ]]; then
- PATH_TESTBENCH=../../testbench/build_testbench/install/bin/$TESTBENCH
+ PATH_TESTBENCH=../../../../build_testbench/install/bin/$TESTBENCH
else
- BUILD_DIR=../../testbench/build_xt_testbench
+ BUILD_DIR=../../../../build_xt_testbench
PATH_TESTBENCH="$BUILD_DIR"/$TESTBENCH
source "$BUILD_DIR"/xtrun_env.sh
XTRUN_CMD=$XTENSA_PATH/$XTRUN
@@ -168,7 +168,7 @@ PIPELINES=
[[ $DIRECTION == "playback" ]] && PIPELINES="-p 1,2"
[[ $DIRECTION == "capture" ]] && PIPELINES="-p 3,4"
TPLGFN=sof-hda-benchmark-${COMP}${BITS_IN}.tplg
- TPLG_DIR="../../build_tools/topology/topology2/development"
+ TPLG_DIR="../../../../build_tools/topology/topology2/development"
TPLG_BUILD_TIP="Please run scripts/build-tools.sh"
}
Currently all topologies, testbench and some tools are built within the FW source directory unlike FW which has separate binary destination directories outside of the main FW source directory.
This series moves all tools, testbench and topologies binaries to outside the source directory to the parent SOF "workspace" directory alongside the FW build output directories.