|
|
@@ -39,6 +39,13 @@ class UtestGeProfilingProperties : public testing::Test { |
|
|
|
void TearDown() override {} |
|
|
|
}; |
|
|
|
|
|
|
|
TEST_F(UtestGeProfilingProperties, test_load_profiling) { |
|
|
|
auto &profiling_properties = ge::ProfilingProperties::Instance(); |
|
|
|
profiling_properties.SetLoadProfiling(true); |
|
|
|
auto is_load = profiling_properties.IsLoadProfiling(); |
|
|
|
EXPECT_EQ(is_load, true); |
|
|
|
} |
|
|
|
|
|
|
|
TEST_F(UtestGeProfilingProperties, test_execute_profiling) { |
|
|
|
auto &profiling_properties = ge::ProfilingProperties::Instance(); |
|
|
|
profiling_properties.SetExecuteProfiling(true); |
|
|
@@ -55,8 +62,13 @@ TEST_F(UtestGeProfilingProperties, test_training_trace) { |
|
|
|
|
|
|
|
TEST_F(UtestGeProfilingProperties, test_fpbp_point) { |
|
|
|
auto &profiling_properties = ge::ProfilingProperties::Instance(); |
|
|
|
std::string fp_point = "fp"; |
|
|
|
std::string bp_point = "bp"; |
|
|
|
std::string fp_point = ""; |
|
|
|
std::string bp_point = ""; |
|
|
|
profiling_properties.GetFpBpPoint(fp_point, bp_point); |
|
|
|
EXPECT_EQ(fp_point, ""); |
|
|
|
EXPECT_EQ(bp_point, ""); |
|
|
|
fp_point = "fp"; |
|
|
|
bp_point = "bp"; |
|
|
|
profiling_properties.SetFpBpPoint(fp_point, bp_point); |
|
|
|
profiling_properties.GetFpBpPoint(fp_point, bp_point); |
|
|
|
EXPECT_EQ(fp_point, "fp"); |
|
|
@@ -70,3 +82,23 @@ TEST_F(UtestGeProfilingProperties, test_profiling_on) { |
|
|
|
auto profiling_on = profiling_properties.ProfilingOn(); |
|
|
|
EXPECT_EQ(profiling_on, true); |
|
|
|
} |
|
|
|
|
|
|
|
TEST_F(UtestGeProfilingProperties, test_clear_properties) { |
|
|
|
auto &profiling_properties = ge::ProfilingProperties::Instance(); |
|
|
|
profiling_properties.SetFpBpPoint("fp", "bp"); |
|
|
|
profiling_properties.SetLoadProfiling(true); |
|
|
|
profiling_properties.SetExecuteProfiling(true); |
|
|
|
profiling_properties.SetTrainingTrace(true); |
|
|
|
profiling_properties.ClearProperties(); |
|
|
|
auto is_execute = profiling_properties.IsExecuteProfiling(); |
|
|
|
auto is_load = profiling_properties.IsLoadProfiling(); |
|
|
|
auto is_train_trance = profiling_properties.ProfilingTrainingTraceOn(); |
|
|
|
EXPECT_EQ(is_execute, false); |
|
|
|
EXPECT_EQ(is_load, false); |
|
|
|
EXPECT_EQ(is_train_trance, false); |
|
|
|
std::string fp_point; |
|
|
|
std::string bp_point; |
|
|
|
profiling_properties.GetFpBpPoint(fp_point, bp_point); |
|
|
|
EXPECT_EQ(fp_point, ""); |
|
|
|
EXPECT_EQ(bp_point, ""); |
|
|
|
} |