Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2027 → Rev 2026

/trunk/kernel/generic/src/console/cmd.c
69,10 → 69,6
#include <test.h>
#endif
 
#ifdef CONFIG_BENCH
#include <arch/cycle.h>
#endif
 
/* Data and methods for 'help' command. */
static int cmd_help(cmd_arg_t *argv);
static cmd_info_t help_info = {
862,27 → 858,6
return 1;
}
 
static bool run_test(const test_t * test)
{
printf("%s\t\t%s\n", test->name, test->desc);
#ifdef CONFIG_BENCH
uint64_t t0 = get_cycle();
#endif
char * ret = test->entry();
#ifdef CONFIG_BENCH
uint64_t dt = get_cycle() - t0;
printf("Time: %llu cycles\n", dt);
#endif
if (ret == NULL) {
printf("Test passed\n");
return true;
}
 
printf("%s\n", ret);
return false;
}
 
/** Command for returning kernel tests
*
* @param argv Argument vector.
896,9 → 871,8
if (strcmp(argv->buffer, "*") == 0) {
for (test = tests; test->name != NULL; test++) {
if (test->safe) {
printf("\n");
if (!run_test(test))
break;
printf("\n%s\t\t%s\n\n", test->name, test->desc);
test->entry();
}
}
} else {
907,13 → 881,13
for (test = tests; test->name != NULL; test++) {
if (strcmp(test->name, argv->buffer) == 0) {
fnd = true;
run_test(test);
test->entry();
break;
}
}
if (!fnd)
printf("Unknown test\n");
printf("Unknown test.\n");
}
return 1;