From 80bdd3c96432e4c4140e3e8a9bc41852895ec36e Mon Sep 17 00:00:00 2001 From: Moncef STITI <moncef.stiti@etu.u-pec.fr> Date: Mon, 10 Mar 2025 11:10:47 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20d'un=20test=20int=C3=A9ressant=20d'un?= =?UTF-8?q?=20autre=20groupe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bake/Bakefile | 25 +++++++++++++++++++ .../test-12-GestionDesBouclesFor/bake/main.c | 10 ++++++++ .../bake/utils1.c | 5 ++++ .../bake/utils1.h | 6 +++++ .../bake/utils2.c | 5 ++++ .../bake/utils2.h | 6 +++++ .../make/Makefile | 25 +++++++++++++++++++ .../test-12-GestionDesBouclesFor/make/main.c | 10 ++++++++ .../make/utils1.c | 5 ++++ .../make/utils1.h | 6 +++++ .../make/utils2.c | 5 ++++ .../make/utils2.h | 6 +++++ 12 files changed, 114 insertions(+) create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/Bakefile create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/main.c create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.c create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.h create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.c create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.h create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/Makefile create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/main.c create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.c create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.h create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.c create mode 100644 tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.h diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/Bakefile b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/Bakefile new file mode 100644 index 0000000..fd1ff29 --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/Bakefile @@ -0,0 +1,25 @@ +# Bakefile + +# Define variables +SRC_DIR = . +BUILD_DIR = . + +# Target to create directories +setup: + mkdir -p $(BUILD_DIR) + +# Target to compile the C source files using a loop +compile: setup + for file in $(SRC_DIR)/*.c; do gcc -c $$file -o $(BUILD_DIR)/$(notdir $(basename $$file .c)).o; done + +# Target to link the object files into an executable +link: compile + gcc -o $(BUILD_DIR)/test_program $(BUILD_DIR)/*.o + +# Target to run the compiled program +run: link + $(BUILD_DIR)/test_program + +# Clean target to remove created directories and files +clean: + rm -rf $(BUILD_DIR) diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/main.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/main.c new file mode 100644 index 0000000..16f45cd --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/main.c @@ -0,0 +1,10 @@ +#include <stdio.h> +#include "utils1.h" +#include "utils2.h" + +int main() { + printf("Main program started!\n"); + print_hello_from_utils1(); + print_hello_from_utils2(); + return 0; +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.c new file mode 100644 index 0000000..58bc03d --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.c @@ -0,0 +1,5 @@ +#include <stdio.h> + +void print_hello_from_utils1() { + printf("Hello from Utils1!\n"); +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.h b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.h new file mode 100644 index 0000000..ecdcfbc --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.h @@ -0,0 +1,6 @@ +#ifndef UTILS1_H +#define UTILS1_H + +void print_hello_from_utils1(); + +#endif diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.c new file mode 100644 index 0000000..42e9f62 --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.c @@ -0,0 +1,5 @@ +#include <stdio.h> + +void print_hello_from_utils2() { + printf("Hello from Utils2!\n"); +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.h b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.h new file mode 100644 index 0000000..7da73aa --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.h @@ -0,0 +1,6 @@ +#ifndef UTILS2_H +#define UTILS2_H + +void print_hello_from_utils2(); + +#endif diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/Makefile b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/Makefile new file mode 100644 index 0000000..907589c --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/Makefile @@ -0,0 +1,25 @@ +# Makefile + +# Define variables +SRC_DIR = . +BUILD_DIR = . + +# Target to create directories +setup: + mkdir -p $(BUILD_DIR) + +# Target to compile the C source files using a loop +compile: setup + for file in $(SRC_DIR)/*.c; do gcc -c $$file -o $(BUILD_DIR)/$(notdir $(basename $$file .c)).o; done + +# Target to link the object files into an executable +link: compile + gcc -o $(BUILD_DIR)/test_program $(BUILD_DIR)/*.o + +# Target to run the compiled program +run: link + $(BUILD_DIR)/test_program + +# Clean target to remove created directories and files +clean: + rm -rf $(BUILD_DIR) diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/main.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/main.c new file mode 100644 index 0000000..16f45cd --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/main.c @@ -0,0 +1,10 @@ +#include <stdio.h> +#include "utils1.h" +#include "utils2.h" + +int main() { + printf("Main program started!\n"); + print_hello_from_utils1(); + print_hello_from_utils2(); + return 0; +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.c new file mode 100644 index 0000000..58bc03d --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.c @@ -0,0 +1,5 @@ +#include <stdio.h> + +void print_hello_from_utils1() { + printf("Hello from Utils1!\n"); +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.h b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.h new file mode 100644 index 0000000..ecdcfbc --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.h @@ -0,0 +1,6 @@ +#ifndef UTILS1_H +#define UTILS1_H + +void print_hello_from_utils1(); + +#endif diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.c new file mode 100644 index 0000000..42e9f62 --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.c @@ -0,0 +1,5 @@ +#include <stdio.h> + +void print_hello_from_utils2() { + printf("Hello from Utils2!\n"); +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.h b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.h new file mode 100644 index 0000000..7da73aa --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.h @@ -0,0 +1,6 @@ +#ifndef UTILS2_H +#define UTILS2_H + +void print_hello_from_utils2(); + +#endif