Skip to content

Commit 0da0218

Browse files
committed
TinyALSA: Add wrapper for tinyALSA's tests
Add tinyalsa-wrapper used to run any test with tinyAlsa testsets. Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
1 parent 8b42d4b commit 0da0218

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test-case/tinyalsa-wrapper.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
##
4+
## Case Name: Wrapper to run a test case given with TinyALSA
5+
## Preconditions:
6+
## TinyALSA and SoX are installed.
7+
## Description:
8+
## This script serves as a wrapper to execute a test case script using TinyALSA.
9+
## It expects the test case script file name (without path) as the first parameter,
10+
## followed by other parameters required for that test case.
11+
## Case step:
12+
## 1. SOF_ALSA_TOOL environment variable is set to TinyALSA
13+
## 2. The test case script is executed.
14+
## Expect result:
15+
## The test case script is executed using TinyALSA
16+
##
17+
18+
set -e
19+
20+
# Ensure the test case script file name is provided
21+
if [ -z "$1" ]; then
22+
echo "Error: No test case script file name provided. Exiting..."
23+
exit 1
24+
fi
25+
26+
export SOF_ALSA_TOOL=tinyalsa
27+
28+
TESTDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
29+
30+
# shellcheck disable=SC2145
31+
[ -x "$TESTDIR/test-case/$(basename "$1")" ] && exec "$TESTDIR"/test-case/"$@"

0 commit comments

Comments
 (0)