Запуск модульных тестов, исключая определенный тег в Catch2

Могу ли я запускать тестовые примеры на основе «несоответствия» определенному тегу в Catch2?

TEST_CASE("Check the data validity","[Working]"){
  REQUIRE(true);
}

TEST_CASE("Check the input","[InProgress]"){
  REQUIRE(true);
}
TEST_CASE("Validate the response","[NotWorking]"){
  REQUIRE(false);
}

Я хочу вызывать тестовые случаи, которые не попадают в тег [NotWorking], пока я не закончу реализацию этой функциональности.


person Wander3r    schedule 14.02.2019    source источник


Ответы (1)


Источник: https://github.com/catchorg/Catch2/blob/master/docs/command-line.md#specifying-what-tests-to-run

Примеры тестовых случаев:

thisTestOnly            Matches the test case called, 'thisTestOnly'
"this test only"        Matches the test case called, 'this test only'
these*                  Matches all cases starting with 'these'
exclude:notThis         Matches all tests except, 'notThis'
~notThis                Matches all tests except, 'notThis'
~*private*              Matches all tests except those that contain 'private'
a* ~ab* abc             Matches all tests that start with 'a', except those that
                        start with 'ab', except 'abc', which is included

Итак, в вашем случае добавьте в командную строку:

exclude:NotWorking

or

~NotWorking
person Robert Andrzejuk    schedule 14.02.2019