First commit
This commit is contained in:
commit
dccc52bd7c
24 files changed
+1702
No files matched your search
@@ -0,0 +1,26 @@
|
||||
#ifndef MICROPASCAL_TESTS_TESTES_H
|
||||
#define MICROPASCAL_TESTS_TESTES_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct ResultadoTeste {
|
||||
int total;
|
||||
int passaram;
|
||||
int falharam;
|
||||
} ResultadoTeste;
|
||||
|
||||
void runLexerTests(ResultadoTeste* resultado_testes);
|
||||
void runParserTests(ResultadoTeste* resultado_testes);
|
||||
|
||||
#define TESTE_ASSERT(resultado_testes, condicao, descricao) \
|
||||
do { \
|
||||
(resultado_testes)->total++; \
|
||||
if (condicao) { \
|
||||
(resultado_testes)->passaram++; \
|
||||
} else { \
|
||||
(resultado_testes)->falharam++; \
|
||||
printf("FALHOU: %s (linha %d)\n", descricao, __LINE__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user