A macro RUN_TEST_CASES_MENU

A macro RUN_TEST_CASES_MENU, pode ser utilizada como alternativa a RUN_ALL_TEST_CASES. A diferença é que RUN_TEST_CASES_MENU mostra um menu para o usuário escolher se deseja mostrar todos os testes ou os testes de uma determinada classe. Já RUN_ALL_TEST_CASES, mostra diretamente todos os testes. Exemplo:

#include <xutest/xutest.h>

TEST_CASE( teste, Testes ) {
    int a = 1;
    int b = 1;
    int c = 2;
    ASSERT_EQUALS( a, b, )
    ASSERT_TRUE( a == b, )
    ASSERT_FALSE( a == c, )
}

int main() {
    RUN_TEST_CASES_MENU();
    return 0;
}

Próxima aula

O próxima aula ensina como integrar o xutest com o foxmake.