1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Allow running individual benchmarks

mirrors and reuses the option from 2f6a9d12f1
This commit is contained in:
sfan5 2023-12-14 11:41:22 +01:00
parent 3c60d359ed
commit e5a6048eec
3 changed files with 12 additions and 7 deletions

View file

@ -23,10 +23,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define CATCH_CONFIG_RUNNER
#include "benchmark_setup.h"
int run_benchmarks()
bool run_benchmarks(const char *arg)
{
int argc = 1;
const char *argv[] = { "MinetestBenchmark", NULL };
const char *const argv[] = {
"MinetestBenchmark", arg, nullptr
};
const int argc = arg ? 2 : 1;
int errCount = Catch::Session().run(argc, argv);
return errCount ? 1 : 0;
return errCount == 0;
}