1 // Copyright 2018 The Fuchsia Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #pragma once 6 7 #include <fbl/vector.h> 8 #include <perftest/perftest.h> 9 10 namespace perftest { 11 namespace internal { 12 13 // Definitions used by the perf test runner. These are in a header file so 14 // that the perf test runner can be tested by unit tests. 15 16 struct NamedTest { 17 fbl::String name; 18 fbl::Function<TestFunc> test_func; 19 }; 20 21 typedef fbl::Vector<NamedTest> TestList; 22 23 bool RunTests(const char* test_suite, TestList* test_list, 24 uint32_t run_count, const char* regex_string, 25 FILE* log_stream, ResultsSet* results_set); 26 27 struct CommandArgs { 28 const char* output_filename = nullptr; 29 // Note that this default matches any string. 30 const char* filter_regex = ""; 31 uint32_t run_count = 1000; 32 bool enable_tracing = false; 33 double startup_delay_seconds = 0; 34 }; 35 36 void ParseCommandArgs(int argc, char** argv, CommandArgs* dest); 37 38 } // namespace internal 39 } // namespace perftest 40