Skip to content

Instantly share code, notes, and snippets.

@edusantana
Last active January 2, 2016 06:18
Show Gist options
  • Save edusantana/8262177 to your computer and use it in GitHub Desktop.
Save edusantana/8262177 to your computer and use it in GitHub Desktop.
Conteúdo: Arquivos em C, TDD, teste Funcionalidade: Apresentação das regras do Jogo Etapa 1
gcc -Wall -g -std=c1x regras_test.c -o regras_test
regras_test.c: Na função ‘test_regras_apresentacao’:
regras_test.c:4:3: aviso: implicit declaration of function ‘verificaArquivoDasRegrasExiste’ [-Wimplicit-function-declaration]
regras_test.c:6:3: aviso: implicit declaration of function ‘lerRegrasDoArquivo’ [-Wimplicit-function-declaration]
regras_test.c:7:3: aviso: implicit declaration of function ‘apresentaRegras’ [-Wimplicit-function-declaration]
regras_test.c:9:3: aviso: implicit declaration of function ‘certificaRegrasForamLidasDoArquivo’ [-Wimplicit-function-declaration]
regras_test.c:10:3: aviso: implicit declaration of function ‘certificaRegrasForamApresentadasAoUsuario’ [-Wimplicit-function-declaration]
/tmp/ccbqcCHh.o: In function `test_regras_apresentacao':
/home/santana/workspaces/c/c-etapa1/regras_test.c:4: undefined reference to `verificaArquivoDasRegrasExiste'
/home/santana/workspaces/c/c-etapa1/regras_test.c:6: undefined reference to `lerRegrasDoArquivo'
/home/santana/workspaces/c/c-etapa1/regras_test.c:7: undefined reference to `apresentaRegras'
/home/santana/workspaces/c/c-etapa1/regras_test.c:9: undefined reference to `certificaRegrasForamLidasDoArquivo'
/home/santana/workspaces/c/c-etapa1/regras_test.c:10: undefined reference to `certificaRegrasForamApresentadasAoUsuario'
collect2: ld returned 1 exit status
make: ** [regras_test] Erro 1
CC=gcc
CFLAGS=-Wall -g -std=c1x
all: regras_test
regras_test: regras_test.c
$(CC) $(CFLAGS) regras_test.c -o regras_test
test_all:
./regras_test
clean:
rm -rf regras_test
// Arquivo para exibir as regras do jogo
void test_regras_apresentacao(){
verificaArquivoDasRegrasExiste();
lerRegrasDoArquivo();
apresentaRegras();
certificaRegrasForamLidasDoArquivo();
certificaRegrasForamApresentadasAoUsuario();
}
int main(){
test_regras_apresentacao();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment