aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>2012-02-09 06:34:15 +0100
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>2012-02-09 06:34:15 +0100
commit342a006ef839a17ea09d2b49f588e3c6badfd5d4 (patch)
tree7d445b22f57e0d62bd3cf261ec0434a64b555394
parent88f74b38e44323b874b9fcdd4e33e8142b1ea088 (diff)
downloade2eaudiotest-342a006ef839a17ea09d2b49f588e3c6badfd5d4.tar.gz
fix parser definitionHEADmaster
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
-rw-r--r--e2eaudiotest.json3
-rw-r--r--e2eaudiotest.py14
-rwxr-xr-xe2eaudiotest.sh6
-rw-r--r--testfreq.c4
4 files changed, 13 insertions, 14 deletions
diff --git a/e2eaudiotest.json b/e2eaudiotest.json
index e50457c..e4a6df5 100644
--- a/e2eaudiotest.json
+++ b/e2eaudiotest.json
@@ -10,8 +10,9 @@
"steps": ["cd e2eaudiotest; gcc testfreq.c utils_alsa.c -lasound -lfftw3 -o testfreq ; ./e2eaudiotest.sh"]
},
"parse" : {
- "pattern": "^e2eaudiotest:\\W+(?P<result>)\\W+! Sinewave at 440 detected",
+ "pattern": "^(?P<test_case_id>\\w+):\\W+(?P<result>\\w+)\\W+(?P<measurement>\\d+)\\W+sinewave",
"appendall": {
+ "units": "Hz"
}
}
}
diff --git a/e2eaudiotest.py b/e2eaudiotest.py
index a1bd6d0..3f9d701 100644
--- a/e2eaudiotest.py
+++ b/e2eaudiotest.py
@@ -13,11 +13,11 @@ INSTALLSTEPS = ['git clone git://git.linaro.org/people/bgaignard/e2eaudiotest.gi
DEPS = ['git-core', 'libasound2-dev', 'libfftw3-dev', 'gcc']
DEFAULT_OPTIONS = ""
RUNSTEPS = ['cd e2eaudiotest; gcc testfreq.c utils_alsa.c -lasound -lfftw3 -o testfreq ; ./e2eaudiotest.sh']
-PATTERN = "^e2eaudiotest:\W+(?P<result>)\W+! Sinewave at 440 detected"
+PATTERN = "^(?P<test_case_id>\w+):\W+(?P<result>\w+)\W+(?P<measurement>\d+)\W+sinewave"
-streaminst = TestInstaller(INSTALLSTEPS, deps=DEPS)
-streamrun = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS)
-streamparser = TestParser(PATTERN,
- appendall={})
-testobj = Test(test_id="e2eaudiotest", installer=streaminst,
- runner=streamrun, parser=streamparser)
+e2einst = TestInstaller(INSTALLSTEPS, deps=DEPS)
+e2erun = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS)
+e2eparser = TestParser(PATTERN,
+ appendall={'units':'Hz'})
+testobj = Test(test_id="e2eaudiotest", installer=e2einst,
+ runner=e2erun, parser=e2eparser)
diff --git a/e2eaudiotest.sh b/e2eaudiotest.sh
index 677a0b0..99c6872 100755
--- a/e2eaudiotest.sh
+++ b/e2eaudiotest.sh
@@ -10,9 +10,7 @@ trap "kill $STPID" TERM INT EXIT
# check the loopback frequency
if ./testfreq ; then
# do the successful LAVA return
- echo "Successful detection of A440 Sine"
- exit 0
+ echo "e2eaudiotest: pass 440 sinewave detected"
else
- echo "Problem detecting the frequency"
- exit 1
+ echo "e2eaudiotest: fail 440 sinewave not detected"
fi
diff --git a/testfreq.c b/testfreq.c
index 28649b3..b11b00e 100644
--- a/testfreq.c
+++ b/testfreq.c
@@ -63,11 +63,11 @@ int main (int argc, char *argv[])
/* Report results */
fprintf(stdout, "Freq: %iHz\n", freq);
if ((freq >= 435) && (freq <= 445)) {
- fprintf(stdout, "e2eaudiotest: pass ! Sinewave at 440 detected\n");
+ fprintf(stdout, "e2eaudiotest has detected a sinewave at 440 Hz\n");
exit (0);
}
- fprintf(stdout, "e2eaudiotest: failed ! Sinewave at 440 was not detected\n");
+ fprintf(stdout, "e2eaudiotest failed to detect a sinewave at 440 Hz\n");
exit (1);
}