summary_metrics_test.cpp File Reference

Classes

struct  run_summary_tests
 
struct  summary_logic
 
class  run_summary_generator< Gen, SummaryLogic >
 
class  summary_write_read_generator
 
class  regression_test_summary_generator< Logic >
 

Macros

#define INTEROP_EXPECT_STAT_NEAR(EXPECTED, ACTUAL, TOL)   EXPECT_TRUE(AreStatsNear(EXPECTED, ACTUAL, TOL))
 
#define INTEROP_EXPECT_CYCLE_EQ(ACTUAL, EXPECTED)   EXPECT_TRUE(AreCycleStatesNear(EXPECTED, ACTUAL))
 

Functions

::testing::AssertionResult AreStatsNear (const metric_stat &expected, const metric_stat &actual, const float tol)
 
::testing::AssertionResult AreCycleStatesNear (const model::run::cycle_range &expected, const model::run::cycle_range &actual)
 
 TEST_P (run_summary_tests, run_summary)
 
 TEST_P (run_summary_tests, read_summary)
 
 TEST_P (run_summary_tests, lane_summary)
 
 TEST_P (run_summary_tests, surface_summary)
 
 TEST (summary_metrics_test, cycle_35_cycle_34_tile)
 
 TEST (summary_metrics_test, clear_run_metrics)
 
 TEST (summary_metrics_test, empty_run_metrics)
 
 INSTANTIATE_TEST_CASE_P (run_summary_unit_test, run_summary_tests,::testing::ValuesIn(run_summary_unit_test_generators))
 
 INSTANTIATE_TEST_CASE_P (run_summary_regression_test, run_summary_tests, ProxyValuesIn(run_summary_regression_gen, regression_test_data::instance().files()))
 

Variables

run_summary_tests::generator_type run_summary_unit_test_generators []
 
regression_test_summary_generator< summary_logicrun_summary_regression_gen ("summary")
 

Detailed Description

Unit tests for the summary metrics

Date
3/11/16
Version
1.0

Macro Definition Documentation

#define INTEROP_EXPECT_CYCLE_EQ (   ACTUAL,
  EXPECTED 
)    EXPECT_TRUE(AreCycleStatesNear(EXPECTED, ACTUAL))
#define INTEROP_EXPECT_STAT_NEAR (   EXPECTED,
  ACTUAL,
  TOL 
)    EXPECT_TRUE(AreStatsNear(EXPECTED, ACTUAL, TOL))

Function Documentation

::testing::AssertionResult AreCycleStatesNear ( const model::run::cycle_range expected,
const model::run::cycle_range actual 
)

Check if two cycle states are the same.

Parameters
expectedexpected cycle state
actualactual cycle state
Returns
true if both are equal
::testing::AssertionResult AreStatsNear ( const metric_stat expected,
const metric_stat actual,
const float  tol 
)

Check if two stats are nearly the same. If both are NaN, then this check succeeds

Parameters
expectedexpected stat
actualactual stat
toltolerance
Returns
true if both numbers hold the same value, or their difference is less than tolerance
INSTANTIATE_TEST_CASE_P ( run_summary_unit_test  ,
run_summary_tests  ,
::testing::  ValuesInrun_summary_unit_test_generators 
)
INSTANTIATE_TEST_CASE_P ( run_summary_regression_test  ,
run_summary_tests  ,
ProxyValuesIn(run_summary_regression_gen, regression_test_data::instance().files())   
)
TEST ( summary_metrics_test  ,
cycle_35_cycle_34_tile   
)
TEST ( summary_metrics_test  ,
clear_run_metrics   
)
TEST ( summary_metrics_test  ,
empty_run_metrics   
)
TEST_P ( run_summary_tests  ,
run_summary   
)

Test if calculated run summary matches actual run summary

TEST_P ( run_summary_tests  ,
read_summary   
)

Test if calculated read summary matches actual read summary

TEST_P ( run_summary_tests  ,
lane_summary   
)

Test if calculated lane summary matches actual lane summary

TEST_P ( run_summary_tests  ,
surface_summary   
)

Test if calculated lane summary matches actual lane summary

Variable Documentation

regression_test_summary_generator<summary_logic> run_summary_regression_gen("summary")