Skip to content

Commit

Permalink
print version
Browse files Browse the repository at this point in the history
  • Loading branch information
qgymib committed Mar 6, 2023
1 parent 86e7701 commit 326c8fe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/cutest.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ extern "C" {
/**
* @brief Development version.
*/
#define CUTEST_VERSION_PREREL 1
#define CUTEST_VERSION_PREREL 2

/**
* @brief Ensure the api is exposed as C function.
Expand Down
21 changes: 14 additions & 7 deletions src/cutest.c
Original file line number Diff line number Diff line change
Expand Up @@ -3157,20 +3157,27 @@ static void _cutest_cleanup(void)

static void _cutest_show_information(void)
{
#if CUTEST_VERSION_PREREL
cutest_porting_fprintf(g_test_ctx.out,
"[ $PARAM ] --test_shuffle=%d\n", (int)g_test_ctx.mask.shuffle);
"[ $VERSION ] %d.%d.%d-dev%d\n", CUTEST_VERSION_MAJOR, CUTEST_VERSION_MINOR, CUTEST_VERSION_PATCH, CUTEST_VERSION_PREREL);
#else
cutest_porting_fprintf(g_test_ctx.out,
"[ $VERSION ] %d.%d.%d\n", CUTEST_VERSION_MAJOR, CUTEST_VERSION_MINOR, CUTEST_VERSION_PATCH);
#endif
cutest_porting_fprintf(g_test_ctx.out,
"[ $PARAME. ] --test_shuffle=%d\n", (int)g_test_ctx.mask.shuffle);
cutest_porting_fprintf(g_test_ctx.out,
"[ $PARAM ] --test_random_seed=%lu\n", g_test_ctx.shuffle_seed);
"[ $PARAME. ] --test_random_seed=%lu\n", g_test_ctx.shuffle_seed);
cutest_porting_fprintf(g_test_ctx.out,
"[ $PARAM ] --test_also_run_disabled_tests=%d\n", (int)g_test_ctx.mask.also_run_disabled_tests);
"[ $PARAME. ] --test_also_run_disabled_tests=%d\n", (int)g_test_ctx.mask.also_run_disabled_tests);
cutest_porting_fprintf(g_test_ctx.out,
"[ $PARAM ] --test_filter=%s\n", g_test_ctx.filter.pattern.ptr != NULL ? g_test_ctx.filter.pattern.ptr : "");
"[ $PARAME. ] --test_filter=%s\n", g_test_ctx.filter.pattern.ptr != NULL ? g_test_ctx.filter.pattern.ptr : "");
cutest_porting_fprintf(g_test_ctx.out,
"[ $PARAM ] --test_repeat=%lu\n", g_test_ctx.counter.repeat.repeat);
"[ $PARAME. ] --test_repeat=%lu\n", g_test_ctx.counter.repeat.repeat);
cutest_porting_fprintf(g_test_ctx.out,
"[ $PARAM ] --test_break_on_failure=%d\n", (int)g_test_ctx.mask.break_on_failure);
"[ $PARAME. ] --test_break_on_failure=%d\n", (int)g_test_ctx.mask.break_on_failure);
cutest_porting_fprintf(g_test_ctx.out,
"[ $PARAM ] --test_print_time=%d\n", (int)!g_test_ctx.mask.no_print_time);
"[ $PARAME. ] --test_print_time=%d\n", (int)!g_test_ctx.mask.no_print_time);
cutest_porting_fprintf(g_test_ctx.out,
"[==========] total %u test%s registered.\n",
(unsigned)g_test_nature.case_table.size,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/case/feature_failure_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DEFINE_TEST(failure_print, c_string)
{
string_matrix_t* matrix = string_matrix_create_from_file(_TEST.out, "\n");

const char* ret = string_matrix_access(matrix, 12, 0);
const char* ret = string_matrix_access(matrix, 13, 0);
TEST_PORTING_ASSERT(strcmp(ret, "0 is not 1") == 0);

string_matrix_destroy(matrix);
Expand Down

0 comments on commit 326c8fe

Please sign in to comment.