Ajout des tests pour les dépendances circulaires avec les fichiers source.
This commit is contained in:
parent
98e84fcdf9
commit
d8cd0c785b
3
TODO.md
3
TODO.md
@ -1,4 +1,5 @@
|
||||
# Liste des choses à faire plus tard :
|
||||
|
||||
- [ ] Améliorer les `README.md` des tests
|
||||
- [ ] Ajouter le fichier compiler dans `test-02-exite-deja`
|
||||
- [ ] Ajouter le fichier compiler dans `test-02-exite-deja`
|
||||
- [ ] Vérifier les commentaires -> si ça fait des erreurs (commentaire en plein milieu etc..)
|
14
tests/test-03-circulaire/Bakefile
Normal file
14
tests/test-03-circulaire/Bakefile
Normal file
@ -0,0 +1,14 @@
|
||||
main: a.o b.o c.o
|
||||
gcc a.o b.o c.o -o main
|
||||
|
||||
a.o: a.c a.h b.h
|
||||
gcc -Wall -Werror -Wextra -c a.c -o a.o
|
||||
|
||||
b.o: b.c b.h c.h
|
||||
gcc -Wall -Werror -Wextra -c b.c -o b.o
|
||||
|
||||
c.o: c.c c.h a.h
|
||||
gcc -Wall -Werror -Wextra -c c.c -o c.o
|
||||
|
||||
clean:
|
||||
rm -f a.o b.o c.o main
|
3
tests/test-03-circulaire/README.md
Normal file
3
tests/test-03-circulaire/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Test 3 : Dépendances circulaire
|
||||
|
||||
|
12
tests/test-03-circulaire/a.c
Normal file
12
tests/test-03-circulaire/a.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include "b.h"
|
||||
|
||||
void functionA() {
|
||||
printf("Function A called\n");
|
||||
functionB(); // Appelle une fonction de b.c
|
||||
}
|
||||
|
||||
int main() {
|
||||
functionA();
|
||||
return 0;
|
||||
}
|
6
tests/test-03-circulaire/a.h
Normal file
6
tests/test-03-circulaire/a.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef A_H
|
||||
#define A_H
|
||||
|
||||
void functionA();
|
||||
|
||||
#endif
|
7
tests/test-03-circulaire/b.c
Normal file
7
tests/test-03-circulaire/b.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include "c.h"
|
||||
|
||||
void functionB() {
|
||||
printf("Function B called\n");
|
||||
functionC(); // Appelle une fonction de c.c
|
||||
}
|
6
tests/test-03-circulaire/b.h
Normal file
6
tests/test-03-circulaire/b.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef B_H
|
||||
#define B_H
|
||||
|
||||
void functionB();
|
||||
|
||||
#endif
|
7
tests/test-03-circulaire/c.c
Normal file
7
tests/test-03-circulaire/c.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include "a.h"
|
||||
|
||||
void functionC() {
|
||||
printf("Function C called\n");
|
||||
functionA(); // Appelle une fonction de a.c -> dépendance circulaire
|
||||
}
|
6
tests/test-03-circulaire/c.h
Normal file
6
tests/test-03-circulaire/c.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef C_H
|
||||
#define C_H
|
||||
|
||||
void functionC();
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user