Skip to content
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

test/topology: make tplg-build.sh callable from anywhere #5633

Merged
merged 1 commit into from
Apr 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/build-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ usage: $0 [-c|-f|-h|-l|-p|-t|-T]
-l Rebuild logger/
-p Rebuild probes/
-T Rebuild topology/ (not topology/development/! Use ALL)
-t Rebuild test/topology/
-t Rebuild test/topology/ (or tools/test/topology/tplg-build.sh directly)

-C No build, only CMake re-configuration. Shows CMake targets.
EOFUSAGE
Expand Down Expand Up @@ -75,6 +75,7 @@ Build commands for respective tools:
probes: make -C "$BUILD_TOOLS_DIR" sof-probes
topologies: make -C "$BUILD_TOOLS_DIR" topologies
test tplgs: make -C "$BUILD_TOOLS_DIR" tests
(or ./tools/test/topology/tplg-build.sh directly)

fuzzer: make -C "$BUILD_TOOLS_DIR/fuzzer"

Expand Down
20 changes: 16 additions & 4 deletions tools/test/topology/tplg-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@
# binaries. Currently supports simple PCM <-> component <-> SSP style tests
# using simple_test()

# Remove possible old topologies
rm -f test-*.conf test-*.tplg

# fail immediately on any errors
set -e

MYDIR="$(cd $(dirname "$0") && pwd)"
cd "${MYDIR}"

# M4 preprocessor flags
export M4PATH="../../topology/topology1:../../topology/topology1/m4:../../topology/topology1/common:../../topology/topology1/platform/intel:../../topology/topology1/platform/common"

if [ -z "$SOF_TPLG_BUILD_OUTPUT" ]
then
BUILD_OUTPUT="."
BUILD_OUTPUT="./build_test_topo"
else
BUILD_OUTPUT="$SOF_TPLG_BUILD_OUTPUT"
fi
mkdir -p "$BUILD_OUTPUT"

# Remove possible old topologies
rm -f "$BUILD_OUTPUT"/test-*.conf "$BUILD_OUTPUT"/test-*.tplg

# Simple component test cases
# can be used on components with 1 sink and 1 source.
Expand Down Expand Up @@ -60,6 +64,7 @@ function simple_test {
then
TFILE="$i-dmic$6-${14}-$2-$4-$7-$((${13} / 1000))k-$1"
echo "M4 pre-processing test $i -> ${TFILE}"
(set -x
m4 ${M4_FLAGS} \
-DTEST_PIPE_NAME="$2" \
-DTEST_DAI_LINK_NAME="$3" \
Expand All @@ -76,8 +81,11 @@ function simple_test {
-DTEST_DMIC_PDM_CONFIG=${14} \
-DTEST_DMIC_UNMUTE_TIME=400 \
$i.m4 > "$BUILD_OUTPUT/${TFILE}.conf"
)
echo "Compiling test $i -> $BUILD_OUTPUT/${TFILE}.tplg"
(set -x
alsatplg -v 1 -c "$BUILD_OUTPUT/${TFILE}.conf" -o "$BUILD_OUTPUT/${TFILE}.tplg"
)
else
if [ "$USE_XARGS" == "yes" ]
then
Expand Down Expand Up @@ -123,6 +131,7 @@ function simple_test {
fi
fi
echo "M4 pre-processing test $i -> ${TFILE}"
( set -x
m4 ${M4_FLAGS} \
-DTEST_PIPE_NAME="$2" \
-DTEST_DAI_LINK_NAME="$3" \
Expand All @@ -138,8 +147,11 @@ function simple_test {
-DTEST_PIPE_AMOUNT=${14} \
-DTEST_DAI_TYPE=$5 \
$i.m4 > "$BUILD_OUTPUT/${TFILE}.conf"
)
echo "Compiling test $i -> $BUILD_OUTPUT/${TFILE}.tplg"
(set -x
alsatplg -v 1 -c "$BUILD_OUTPUT/${TFILE}.conf" -o "$BUILD_OUTPUT/${TFILE}.tplg"
)
fi
fi
fi
Expand Down