Commit 623f072b authored by Philippe Gerum's avatar Philippe Gerum

lib/smokey, testsuite/smokey: issue terminating newline on note/warning

parent 8d5ae69e
......@@ -102,7 +102,7 @@ struct smokey_test {
int __ret = (__expr); \
if (__ret < 0) { \
__ret = -errno; \
smokey_warning(__FILE__, __LINE__, "%s: %s\n", \
smokey_warning(__FILE__, __LINE__, "%s: %s", \
#__expr, strerror(errno)); \
} \
__ret; \
......@@ -113,7 +113,7 @@ struct smokey_test {
int __ret = (__expr); \
if (!__ret) \
smokey_warning(__FILE__, __LINE__, \
"assertion failed: %s\n", #__expr); \
"assertion failed: %s", #__expr); \
__ret; \
})
......
......@@ -124,8 +124,10 @@ void smokey_note(const char *fmt, ...)
va_start(ap, fmt);
if (smokey_verbose_mode)
if (smokey_verbose_mode) {
__RT(vfprintf(stdout, fmt, ap));
__RT(fprintf(stdout, "\n"));
}
va_end(ap);
}
......@@ -140,6 +142,7 @@ void smokey_warning(const char *file, int lineno,
if (smokey_verbose_mode) {
__RT(fprintf(stderr, "%s:%d, ", basename(file), lineno));
__RT(vfprintf(stderr, fmt, ap));
__RT(fprintf(stdout, "\n"));
}
va_end(ap);
......
......@@ -203,7 +203,8 @@
*
* The printf-like @a smokey_note() routine is available for issuing
* progress messages to the output device (currently stdout), unless
* --silent was detected on the command line.
* --silent was detected on the command line. smokey_note() outputs
* a terminating newline character.
*
* Therefore, a possible implementation of a test driver could be as
* basic as:
......@@ -228,7 +229,7 @@
* continue;
* error(1, -ret, "test %s failed", t->name);
* }
* smokey_note("%s OK\n", t->name);
* smokey_note("%s OK", t->name);
* }
*
* return 0;
......
......@@ -10,7 +10,7 @@ wrappers = $(XENO_POSIX_WRAPPERS)
SUBDIRS = \
arith \
bufp \
clock \
posix-clock \
cond-torture \
fork-exec \
iddp \
......@@ -50,7 +50,7 @@ smokey_LDADD = \
DIST_SUBDIRS = \
arith \
bufp \
clock \
posix-clock \
cond-torture \
fork-exec \
iddp \
......
......@@ -83,7 +83,7 @@ static void *server(void *arg)
errno = -EINVAL;
fail("recvfrom");
}
smokey_note("%s: received %d bytes, %ld from port %d\n",
smokey_note("%s: received %d bytes, %ld from port %d",
__FUNCTION__, ret, data, claddr.sipc_port);
}
......@@ -123,7 +123,7 @@ static void *client(void *arg)
close(s);
fail("sendto");
}
smokey_note("%s: sent %d bytes, %ld\n", __FUNCTION__, ret, data);
smokey_note("%s: sent %d bytes, %ld", __FUNCTION__, ret, data);
ts.tv_sec = 0;
ts.tv_nsec = 100000000; /* 100 ms */
clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL);
......
......@@ -83,7 +83,7 @@ static void *server(void *arg)
errno = -EINVAL;
fail("recvfrom");
}
smokey_note("%s: received %d bytes, %ld from port %d\n",
smokey_note("%s: received %d bytes, %ld from port %d",
__FUNCTION__, ret, data, claddr.sipc_port);
}
......@@ -127,7 +127,7 @@ static void *client(void *arg)
close(s);
fail("sendto");
}
smokey_note("%s: sent %d bytes, %ld\n", __FUNCTION__, ret, data);
smokey_note("%s: sent %d bytes, %ld", __FUNCTION__, ret, data);
ts.tv_sec = 0;
ts.tv_nsec = 100000000; /* 100 ms */
clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL);
......
......@@ -31,7 +31,7 @@ int main(int argc, char *const argv[])
ret = t->run(t, argc, argv);
if (ret) {
if (ret == -ENOSYS) {
smokey_note("%s skipped (no kernel support)\n",
smokey_note("%s skipped (no kernel support)",
t->name);
continue;
}
......@@ -41,7 +41,7 @@ int main(int argc, char *const argv[])
if (smokey_verbose_mode)
error(1, -ret, "test %s failed", t->name);
}
smokey_note("%s OK\n", t->name);
smokey_note("%s OK", t->name);
}
return fails != 0;
......
......@@ -96,12 +96,12 @@ static void *rt_thread_body(void *cookie)
err = pthread_setmode_np(0, PTHREAD_WARNSW, NULL);
check_no_error("pthread_setmode_np", err);
smokey_note("syscall\n");
smokey_note("syscall");
setup_checkdebug(SIGDEBUG_MIGRATE_SYSCALL);
syscall(__NR_gettid);
check_sigdebug_received("SIGDEBUG_MIGRATE_SYSCALL");
smokey_note("signal\n");
smokey_note("signal");
setup_checkdebug(SIGDEBUG_MIGRATE_SIGNAL);
err = sem_post(&send_signal);
check_no_error("sem_post", err);
......@@ -109,13 +109,13 @@ static void *rt_thread_body(void *cookie)
check_no_error("clock_nanosleep", err);
check_sigdebug_received("SIGDEBUG_MIGRATE_SIGNAL");
smokey_note("relaxed mutex owner\n");
smokey_note("relaxed mutex owner");
setup_checkdebug(SIGDEBUG_MIGRATE_PRIOINV);
err = pthread_mutex_lock(&prio_invert);
check_no_error("pthread_mutex_lock", err);
check_sigdebug_received("SIGDEBUG_MIGRATE_PRIOINV");
smokey_note("page fault\n");
smokey_note("page fault");
setup_checkdebug(SIGDEBUG_MIGRATE_FAULT);
delay.tv_nsec = 0;
err = clock_nanosleep(CLOCK_MONOTONIC, 0, &delay, NULL);
......@@ -124,7 +124,7 @@ static void *rt_thread_body(void *cookie)
check_sigdebug_received("SIGDEBUG_MIGRATE_FAULT");
if (wd) {
smokey_note("watchdog\n");
smokey_note("watchdog");
rt_print_flush_buffers();
setup_checkdebug(SIGDEBUG_WATCHDOG);
clock_gettime(CLOCK_MONOTONIC, &now);
......@@ -137,9 +137,9 @@ static void *rt_thread_body(void *cookie)
!sigdebug_received);
check_sigdebug_received("SIGDEBUG_WATCHDOG");
} else
smokey_note("watchdog not tested\n");
smokey_note("watchdog not tested");
smokey_note("lock break\n");
smokey_note("lock break");
setup_checkdebug(SIGDEBUG_LOCK_BREAK);
err = pthread_setmode_np(0, PTHREAD_LOCK_SCHED |
PTHREAD_DISABLE_LOCKBREAK, NULL);
......@@ -251,7 +251,7 @@ static int run_sigdebug(struct smokey_test *t, int argc, char *const argv[])
err = pthread_attr_setschedparam(&attr, &params);
check_no_error("pthread_attr_setschedparam", err);
smokey_note("mlockall\n");
smokey_note("mlockall");
munlockall();
setup_checkdebug(SIGDEBUG_NOMLOCK);
err = pthread_create(&rt_thread, &attr, rt_thread_body, NULL);
......
......@@ -87,7 +87,7 @@ static void *realtime_thread1(void *arg)
fail("recvfrom");
}
smokey_note("%s: %ld relayed by peer\n", __FUNCTION__, data);
smokey_note("%s: %ld relayed by peer", __FUNCTION__, data);
}
return NULL;
......@@ -150,7 +150,7 @@ static void *realtime_thread2(void *arg)
if (ret || addrlen != sizeof(saddr))
fail("getpeername");
smokey_note("%s: NRT peer is reading from /dev/rtp%d\n",
smokey_note("%s: NRT peer is reading from /dev/rtp%d",
__FUNCTION__, saddr.sipc_port);
FD_ZERO(&set);
......@@ -173,7 +173,7 @@ static void *realtime_thread2(void *arg)
if (ret != sizeof(data))
fail("sendto");
smokey_note("%s: sent %d bytes, %ld\n", __FUNCTION__, ret, data);
smokey_note("%s: sent %d bytes, %ld", __FUNCTION__, ret, data);
ts.tv_sec = 0;
ts.tv_nsec = 100000000; /* 100 ms */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment