Added version info when starting the tests, refactored version out of main.c

This commit is contained in:
Snaipe 2015-03-24 00:25:31 +01:00
parent db091dd822
commit 85d47cff98
2 changed files with 8 additions and 2 deletions

View file

@ -30,6 +30,7 @@
#include "criterion/options.h"
#include "criterion/ordered-set.h"
#include "timer.h"
#include "config.h"
#define NORMALIZE(Str) (criterion_options.use_ascii ? "" : Str)
@ -40,6 +41,10 @@
#define FG_BLUE NORMALIZE("\e[0;34m")
#define RESET NORMALIZE("\e[0m")
void normal_log_pre_all(UNUSED struct criterion_test_set *set) {
criterion_info("[%s====%s] Criterion v%s\n", FG_BLUE, RESET, VERSION);
}
void normal_log_pre_init(struct criterion_test *test) {
criterion_info("[%sRUN%s ] %s::%s\n", FG_BLUE, RESET, test->category, test->name);
}
@ -120,6 +125,7 @@ void normal_log_pre_suite(struct criterion_suite_set *set) {
}
struct criterion_output_provider normal_logging = {
.log_pre_all = normal_log_pre_all,
.log_pre_init = normal_log_pre_init,
.log_pre_suite = normal_log_pre_suite,
.log_post_test = normal_log_post_test,

View file

@ -29,9 +29,9 @@
#include <getopt.h>
#include <csptr/smart_ptr.h>
#include "runner.h"
#include "config.h"
# define VERSION "v1.0.0"
# define VERSION_MSG "Tests compiled with Criterion " VERSION "\n"
# define VERSION_MSG "Tests compiled with Criterion v" VERSION "\n"
# define USAGE \
VERSION_MSG "\n" \