zircon/system/ulib/fs-test-utils/perftest.cc
// Runs all tests in the given testcase.
Runs all tests in the given testcase.
Runs all tests in the given testcase .
void RunTestCase(const FixtureOptions& fixture_options,
                 const PerformanceTestOptions& performance_test_options,
                 const TestCaseInfo& test_case, perftest::ResultsSet* result_set,
                 TestStats* global_stats, FILE* out) {
  Fixture fixture(fixture_options);
  zx::ticks start = zx::ticks::now();
  PrintTestCaseStart(test_case.name, test_case.tests.size(), out);
  bool skip_tests = (fixture.SetUpTestCase() != ZX_OK);
  bool setUp = true;
  for (auto& test : test_case.tests) {
    skip_tests = !HasEnoughSpace(fixture.GetFsBlockDevice(), test.required_disk_space);
    if (skip_tests) {
      LOG_ERROR(ZX_ERR_NO_SPACE, "Not enough space on disk to run test.\n");
    } else if (setUp) {
      skip_tests = (fixture.SetUp() != ZX_OK);
      setUp = false;
    }
    uint32_t actual_sample_count = test_case.sample_count;
    if (actual_sample_count == 0 || performance_test_options.is_unittest) {
      actual_sample_count = performance_test_options.sample_count;
    }
    RunTest(test, actual_sample_count, skip_tests, &fixture, result_set, global_stats, out);
    if (test_case.teardown) {
      fixture.TearDown();
      setUp = true;
    }
  }
  if (!test_case.teardown) {
    fixture.TearDown();
  }
  fixture.TearDownTestCase();
  PrintTestCaseEnd(test_case.name, test_case.tests.size(), start, out);
}
void RunTestCase ( const FixtureOptions & fixture_options , const PerformanceTestOptions & performance_test_options , const TestCaseInfo & test_case , perftest :: ResultsSet * result_set , TestStats * global_stats , FILE * out ) { Fixture fixture ( fixture_options ) ; zx :: ticks start = zx :: ticks :: now ( ) ; PrintTestCaseStart ( test_case . name , test_case . tests . size ( ) , out ) ; bool skip_tests = ( fixture . SetUpTestCase ( ) != ZX_OK ) ; bool setUp = true ; for ( auto & test : test_case . tests ) { skip_tests = ! HasEnoughSpace ( fixture . GetFsBlockDevice ( ) , test . required_disk_space ) ; if ( skip_tests ) { LOG_ERROR ( ZX_ERR_NO_SPACE , " \n " ) ; } else if ( setUp ) { skip_tests = ( fixture . SetUp ( ) != ZX_OK ) ; setUp = false ; } uint32_t actual_sample_count = test_case . sample_count ; if ( actual_sample_count == 0 || performance_test_options . is_unittest ) { actual_sample_count = performance_test_options . sample_count ; } RunTest ( test , actual_sample_count , skip_tests , & fixture , result_set , global_stats , out ) ; if ( test_case . teardown ) { fixture . TearDown ( ) ; setUp = true ; } } if ( ! test_case . teardown ) { fixture . TearDown ( ) ; } fixture . TearDownTestCase ( ) ; PrintTestCaseEnd ( test_case . name , test_case . tests . size ( ) , start , out ) ; }
Runs all tests in the given testcase.
Runs all tests in the given testcase .
// Verify that the disk has enough space to run the test. This is set up by the user // since the actual may change depending on the test input.