Criterion/include/criterion/stats.h

102 lines
2.8 KiB
C
Raw Permalink Normal View History

2015-02-02 13:02:59 +01:00
/*
* The MIT License (MIT)
*
2016-01-01 00:00:00 +01:00
* Copyright © 2015-2016 Franklin "Snaipe" Mathieu <http://snai.pe/>
2015-02-02 13:02:59 +01:00
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/*!
* @file
* @brief Test stats
*****************************************************************************/
#ifndef CRITERION_STATS_H_
#define CRITERION_STATS_H_
2015-02-01 18:14:36 +01:00
#include "types.h"
#include "internal/deprecation.h"
enum criterion_test_status {
CR_STATUS_PASSED = 0,
CR_STATUS_FAILED = 1,
CR_STATUS_SKIPPED = 2,
};
2015-02-01 18:14:36 +01:00
2015-02-05 19:52:41 +01:00
struct criterion_assert_stats {
const char *message;
bool passed;
unsigned line;
const char *file;
2015-02-05 19:52:41 +01:00
struct criterion_assert_stats *next;
};
struct criterion_test_stats {
struct criterion_test *test;
2015-02-05 19:52:41 +01:00
struct criterion_assert_stats *asserts;
bool CR_DEPRECATED_MEMBER(failed);
enum criterion_test_status test_status;
int passed_asserts;
int failed_asserts;
2015-02-06 01:53:58 +01:00
int signal;
int exit_code;
2015-02-07 14:22:08 +01:00
float elapsed_time;
2015-09-11 16:56:40 +02:00
bool timed_out;
bool crashed;
unsigned progress;
const char *file;
const char *message;
2015-02-05 19:52:41 +01:00
struct criterion_test_stats *next;
};
struct criterion_theory_stats {
const char *formatted_args;
struct criterion_test_stats *stats;
};
2015-03-23 18:37:51 +01:00
struct criterion_suite_stats {
struct criterion_suite *suite;
2015-02-05 19:52:41 +01:00
struct criterion_test_stats *tests;
size_t nb_tests;
size_t nb_asserts;
size_t tests_skipped;
2015-02-05 19:52:41 +01:00
size_t tests_failed;
size_t tests_crashed;
size_t tests_passed;
size_t asserts_failed;
size_t asserts_passed;
2015-03-23 18:37:51 +01:00
struct criterion_suite_stats *next;
};
struct criterion_global_stats {
struct criterion_suite_stats *suites;
size_t nb_suites;
size_t nb_tests;
size_t nb_asserts;
size_t tests_skipped;
2015-03-23 18:37:51 +01:00
size_t tests_failed;
size_t tests_crashed;
size_t tests_passed;
size_t asserts_failed;
size_t asserts_passed;
};
#endif /* !CRITERION_STATS_H_ */