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

@ -3,6 +3,7 @@
#endif
#include <pulsecore/prioq.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#define N 1024
@ -13,6 +14,9 @@ int main(int argc, char *argv[]) {
srand(0);
if (!getenv("MAKE_CHECK"))
pa_log_set_level(PA_LOG_DEBUG);
q = pa_prioq_new(pa_idxset_trivial_compare_func);
/* Fill in 1024 */
@ -22,20 +26,19 @@ int main(int argc, char *argv[]) {
/* Remove half of it again */
for (i = 0; i < N/2; i++){
unsigned u = PA_PTR_TO_UINT(pa_prioq_pop(q));
pa_log("%16u", u);
pa_log_debug("%16u", u);
}
pa_log("Refilling");
pa_log_debug("Refilling");
/* Fill in another 1024 */
for (i = 0; i < N; i++)
pa_prioq_put(q, PA_UINT_TO_PTR((unsigned) rand()));
/* Remove everything */
while (!pa_prioq_isempty(q)) {
unsigned u = PA_PTR_TO_UINT(pa_prioq_pop(q));
pa_log("%16u", u);
pa_log_debug("%16u", u);
}
pa_prioq_free(q, NULL, NULL);