lundi 12 décembre 2022

How to get gtest results?

How to get the result of EXPECT_EXIT() in gtest?

I want to do something according to the results of EXPECT_EXIT. For example:

for(int i = 0; i < 1000; i++) {
  for(int j = 0; j < 10; j++) {
    auto &result = EXPECT_EXIT(Function(i, inputs[j]));
    if (result) {
      do something;
      break; //jump out of the loop
    }
  }
}

Aucun commentaire:

Enregistrer un commentaire