mirror of
https://github.com/NixOS/nix.git
synced 2025-12-23 01:11:07 +01:00
libstore-tests: Split bench-main into a separate file
This makes it easier to add new benchmarks.
This commit is contained in:
parent
b8301b2c25
commit
b2b2f2dc53
3 changed files with 20 additions and 14 deletions
14
src/libstore-tests/bench-main.cc
Normal file
14
src/libstore-tests/bench-main.cc
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include <benchmark/benchmark.h>
|
||||
#include "nix/store/globals.hh"
|
||||
|
||||
// Custom main to initialize Nix before running benchmarks
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
// Initialize libstore
|
||||
nix::initLibStore(false);
|
||||
|
||||
// Initialize and run benchmarks
|
||||
::benchmark::Initialize(&argc, argv);
|
||||
::benchmark::RunSpecifiedBenchmarks();
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue