Ajout du test n°14 pour vérifier la suppression d'un fichier source et la recompilation avec Bake et Make
This commit is contained in:
parent
547086887d
commit
b2ebd69808
63
tests/C/test-14-remove-source-and-rebuild/README.md
Normal file
63
tests/C/test-14-remove-source-and-rebuild/README.md
Normal file
@ -0,0 +1,63 @@
|
||||
# Test n°14 - Suppression d'un fichier source et recompilation
|
||||
|
||||
## Objectif
|
||||
Ce test a pour but de vérifier comment **Bake** et **Make** réagissent lorsque le fichier source `.c` est supprimé après la première compilation et qu'une recompilation est demandée.
|
||||
|
||||
## Structure du projet
|
||||
Le test est organisé en deux répertoires :
|
||||
|
||||
```
|
||||
.
|
||||
├── bake
|
||||
│ ├── Bakefile # Fichier de build pour Bake
|
||||
│ ├── bakefile.jar # Fichier Bake pré-compilé
|
||||
│ └── test.c # Fichier source C
|
||||
├── bakefile.jar # Copie du fichier Bake
|
||||
└── make
|
||||
├── Makefile # Fichier de build pour Make
|
||||
└── test.c # Fichier source C
|
||||
```
|
||||
|
||||
## Étapes du test
|
||||
|
||||
### 1. Compilation initiale
|
||||
#### **Avec Bake**
|
||||
Exécutez les commandes suivantes :
|
||||
```sh
|
||||
cd bake
|
||||
java -cp bakefile.jar fr.monlouyan.bakefile.Main
|
||||
```
|
||||
Vous devriez voir la compilation de `test.c` en `test.o`.
|
||||
|
||||
#### **Avec Make**
|
||||
Exécutez les commandes suivantes :
|
||||
```sh
|
||||
cd ../make
|
||||
make
|
||||
```
|
||||
Cela devrait également compiler `test.c` en `test.o`.
|
||||
|
||||
### 2. Suppression du fichier source
|
||||
Dans chaque répertoire (`bake/` et `make/`), supprimez `test.c` :
|
||||
```sh
|
||||
rm test.c
|
||||
```
|
||||
|
||||
### 3. Recompilation
|
||||
#### **Avec Bake**
|
||||
```sh
|
||||
java -cp bakefile.jar fr.monlouyan.bakefile.Main
|
||||
```
|
||||
#### **Avec Make**
|
||||
```sh
|
||||
make
|
||||
```
|
||||
|
||||
## Résultats attendus
|
||||
Si `Bake` fonctionne comme `Make`, nous devrions observer une erreur de compilation, car `test.c` est manquant.
|
||||
|
||||
Exemple de sortie attendue :
|
||||
```
|
||||
make: *** No rule to make target `test.c', needed by `test.o'. Stop.
|
||||
```
|
||||
|
5
tests/C/test-14-remove-source-and-rebuild/bake/Bakefile
Normal file
5
tests/C/test-14-remove-source-and-rebuild/bake/Bakefile
Normal file
@ -0,0 +1,5 @@
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -c
|
||||
|
||||
test.o: test.c
|
||||
$(CC) $(CFLAGS) -o test.o test.c
|
6
tests/C/test-14-remove-source-and-rebuild/bake/test.c
Normal file
6
tests/C/test-14-remove-source-and-rebuild/bake/test.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf("Hello, Bake!\n");
|
||||
return 0;
|
||||
}
|
5
tests/C/test-14-remove-source-and-rebuild/make/Makefile
Normal file
5
tests/C/test-14-remove-source-and-rebuild/make/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -c
|
||||
|
||||
test.o: test.c
|
||||
$(CC) $(CFLAGS) -o test.o test.c
|
6
tests/C/test-14-remove-source-and-rebuild/make/test.c
Normal file
6
tests/C/test-14-remove-source-and-rebuild/make/test.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf("Hello, Bake!\n");
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user