Skip to content
Snippets Groups Projects
Select Git revision
  • v0.1
  • master default protected
  • last_replay
  • last_replay
4 results

insane

  • Clone with SSH
  • Clone with HTTPS
  • Common Benchmark Code

    Overview

    Code common to:

    • detector_benchmarks
    • reconstruction_benchmarks
    • physics_benchmarks

    Usage

    Bookkeeping of test data to store data of one or more tests in a json file to facilitate future accounting.

    Usage Example 1 (single test):

    define our test

    common_bench::Test test1{
      {{"name", "example_test"},
        {"title", "Example Test"},
        {"description", "This is an example of a test definition"},
        {"quantity", "efficiency"},
        {"target", "1"}}};

    set pass/fail/error status and return value (in this case .99)

    test1.pass(0.99)

    write our test data to a json file

    common_bench::write_test(test1, "test1.json");

    Usage Example 2 (multiple tests):

    Define our tests

    common_bench::Test test1{{
      {"name", "example_test"},
      {"title", "Example Test"},
      {"description", "This is an example of a test definition"},
      {"quantity", "efficiency"},
      {"target", "1"}}};
    common_bench::Test test2{{
      {"name", "another_test"},
      {"title", "Another example Test"},
      {"description", "This is a second example of a test definition"},
      {"quantity", "resolution"},
      {"target", "3."}}};

    set pass/fail/error status and return value (in this case .99)

    test1.fail(10)

    write our test data to a json file

    common_bench::write_test({test1, test2}, "test.json");