tests: More useful output of make check

Instead of spilling thousands of lines of output, make check now runs the
test-suite in about 100 lines or so.  If running under make check, the output of
tests is reduced. The MAKE_CHECK environment variable is used for this, so that
when running the test manually, the full output is still shown.  Furthermore,
pa_log is used consistently instead of printf, so that all test output goes to
stderr by default.  Colored output from make check goes to stdout.
This commit is contained in:
Maarten Bosmans 2011-10-04 14:01:03 +02:00 committed by Arun Raghavan
parent 6be5515e6a
commit 681aaf7a9a
20 changed files with 144 additions and 115 deletions

View file

@ -24,9 +24,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <pulsecore/time-smoother.h>
#include <pulse/timeval.h>
#include <pulsecore/log.h>
#include <pulsecore/time-smoother.h>
int main(int argc, char*argv[]) {
pa_usec_t x;
unsigned u = 0;
@ -45,7 +47,8 @@ int main(int argc, char*argv[]) {
srand(0);
pa_log_set_level(PA_LOG_DEBUG);
if (!getenv("MAKE_CHECK"))
pa_log_set_level(PA_LOG_DEBUG);
for (m = 0, u = 0; u < PA_ELEMENTSOF(msec); u+= 2) {
@ -67,13 +70,13 @@ int main(int argc, char*argv[]) {
while (u < PA_ELEMENTSOF(msec) && (pa_usec_t) msec[u]*PA_USEC_PER_MSEC < x) {
pa_smoother_put(s, (pa_usec_t) msec[u] * PA_USEC_PER_MSEC, (pa_usec_t) msec[u+1] * PA_USEC_PER_MSEC);
printf("%i\t\t%i\n", msec[u], msec[u+1]);
pa_log_debug("%i\t\t%i", msec[u], msec[u+1]);
u += 2;
pa_smoother_resume(s, (pa_usec_t) msec[u] * PA_USEC_PER_MSEC, TRUE);
}
printf("%llu\t%llu\n", (unsigned long long) (x/PA_USEC_PER_MSEC), (unsigned long long) (pa_smoother_get(s, x)/PA_USEC_PER_MSEC));
pa_log_debug("%llu\t%llu", (unsigned long long) (x/PA_USEC_PER_MSEC), (unsigned long long) (pa_smoother_get(s, x)/PA_USEC_PER_MSEC));
}
pa_smoother_free(s);