Modification des tests (Création de répertoire make et bake)
This commit is contained in:
15
tests/C/test-03-circular/make/README.md
Normal file
15
tests/C/test-03-circular/make/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Test 3 : Gestion des dépendances circulaires
|
||||
|
||||
## Description
|
||||
Ce test vérifie que le système de compilation peut détecter et gérer correctement les dépendances circulaires. Il simule un projet où plusieurs fichiers `.c` et `.h` s'incluent mutuellement, créant ainsi une boucle dans les dépendances.
|
||||
|
||||
## Fichiers utilisés
|
||||
- `a.c` : Implémente functionA qui appelle functionB.
|
||||
- `b.c` : Implémente functionB qui appelle functionC.
|
||||
- `c.c` : Implémente functionC et inclut a.h, créant une boucle indirecte.
|
||||
- `a.h`, `b.h`, `c.h` : Fichiers d'en-tête correspondant.
|
||||
- `Bakefile` : Contient les règles de compilation et les dépendances.
|
||||
- `bakefile.jar` : Version compilée de notre système de build.
|
||||
|
||||
## Résultat attendu
|
||||
Si le système de build détecte une dépendance circulaire, il doit la gérer automatiquement en évitant la boucle infinie et en compilant correctement les fichiers.
|
12
tests/C/test-03-circular/make/a.c
Normal file
12
tests/C/test-03-circular/make/a.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include "b.h"
|
||||
|
||||
void functionA(void) {
|
||||
printf("Fonction A appelée\n");
|
||||
functionB();
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
functionA();
|
||||
return 0;
|
||||
}
|
6
tests/C/test-03-circular/make/a.h
Normal file
6
tests/C/test-03-circular/make/a.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef A_H
|
||||
#define A_H
|
||||
|
||||
void functionA(void);
|
||||
|
||||
#endif
|
7
tests/C/test-03-circular/make/b.c
Normal file
7
tests/C/test-03-circular/make/b.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include "c.h"
|
||||
|
||||
void functionB(void) {
|
||||
printf("Fonction B appelée\n");
|
||||
functionC();
|
||||
}
|
6
tests/C/test-03-circular/make/b.h
Normal file
6
tests/C/test-03-circular/make/b.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef B_H
|
||||
#define B_H
|
||||
|
||||
void functionB(void);
|
||||
|
||||
#endif
|
8
tests/C/test-03-circular/make/c.c
Normal file
8
tests/C/test-03-circular/make/c.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "a.h"
|
||||
|
||||
void functionC(void) {
|
||||
printf("Fonction C appelée\n");
|
||||
return;
|
||||
}
|
6
tests/C/test-03-circular/make/c.h
Normal file
6
tests/C/test-03-circular/make/c.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef C_H
|
||||
#define C_H
|
||||
|
||||
void functionC(void);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user