2015-03-09 20:16:50 +01:00
|
|
|
/*
|
|
|
|
* The MIT License (MIT)
|
|
|
|
*
|
|
|
|
* Copyright © 2015 Franklin "Snaipe" Mathieu <http://snai.pe/>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2015-03-09 20:15:00 +01:00
|
|
|
#ifndef CRITERION_OPTIONS_H_
|
|
|
|
# define CRITERION_OPTIONS_H_
|
|
|
|
|
2015-03-17 00:56:33 +01:00
|
|
|
# include <stdbool.h>
|
2015-03-09 20:15:00 +01:00
|
|
|
# include "logging.h"
|
|
|
|
|
|
|
|
struct criterion_options {
|
2015-12-08 00:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The current logging threshold.
|
|
|
|
*
|
|
|
|
* default: 1
|
|
|
|
*/
|
2015-03-09 20:15:00 +01:00
|
|
|
enum criterion_logging_level logging_threshold;
|
2015-12-08 00:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The logger that will be used during the execution of the runner.
|
|
|
|
*
|
|
|
|
* default: normal logger
|
|
|
|
*/
|
2015-11-04 20:18:47 +01:00
|
|
|
struct criterion_logger *logger;
|
2015-12-08 00:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Don't exit the child immediately after finishing to run the test
|
|
|
|
* function, and perform a full cleanup.
|
|
|
|
*
|
|
|
|
* Useful when tracking memory leaks, and is immediately implied when
|
|
|
|
* running the process under valgrind.
|
|
|
|
*
|
|
|
|
* default: false
|
|
|
|
*/
|
2015-03-09 20:15:00 +01:00
|
|
|
bool no_early_exit;
|
2015-12-08 00:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Always return a success from criterion_run_all_tests.
|
|
|
|
*
|
|
|
|
* default: false
|
|
|
|
*/
|
2015-03-09 20:15:00 +01:00
|
|
|
bool always_succeed;
|
2015-12-08 00:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Disable unicode and ansi coloring from the logging system.
|
|
|
|
*
|
|
|
|
* default: false
|
|
|
|
*/
|
2015-03-22 21:23:14 +01:00
|
|
|
bool use_ascii;
|
2015-12-08 00:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Exit immediately after the first test failure.
|
|
|
|
*
|
|
|
|
* default: false
|
|
|
|
*/
|
2015-03-22 21:32:44 +01:00
|
|
|
bool fail_fast;
|
2015-12-08 00:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Disable all tests not matching this extglob pattern.
|
|
|
|
* if NULL, don't filter tests.
|
|
|
|
*
|
|
|
|
* default: NULL
|
|
|
|
*/
|
2015-03-22 23:16:09 +01:00
|
|
|
const char *pattern;
|
2015-12-08 00:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Only print the base file name compound of the source file containing
|
|
|
|
* the tests during reporting.
|
|
|
|
*
|
|
|
|
* default: false
|
|
|
|
*/
|
2015-08-20 07:58:38 +02:00
|
|
|
bool short_filename;
|
2015-12-08 00:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The maximum number of parallel jobs that the test runner will spawn.
|
|
|
|
* 0 means that this number shall be the number of cores on your system.
|
|
|
|
*
|
|
|
|
* default: 0
|
|
|
|
*/
|
2015-09-22 23:21:51 +02:00
|
|
|
size_t jobs;
|
2015-12-08 00:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Measure and report times.
|
|
|
|
*
|
|
|
|
* default: true
|
|
|
|
*/
|
2015-10-06 15:44:09 +02:00
|
|
|
bool measure_time;
|
2015-03-09 20:15:00 +01:00
|
|
|
};
|
|
|
|
|
2015-09-07 01:15:31 +02:00
|
|
|
CR_BEGIN_C_API
|
|
|
|
|
2015-12-08 00:34:02 +01:00
|
|
|
/**
|
|
|
|
* The runtime options for the test runner.
|
|
|
|
*/
|
2015-03-09 20:15:00 +01:00
|
|
|
extern struct criterion_options criterion_options;
|
|
|
|
|
2015-09-07 01:15:31 +02:00
|
|
|
CR_END_C_API
|
|
|
|
|
2015-03-09 20:15:00 +01:00
|
|
|
#endif /*!CRITERION_OPTIONS_H_ */
|