Skip to content

Commit 1143d92

Browse files
committed
Reformat the tests systemt
1 parent 173a223 commit 1143d92

File tree

65 files changed

+84
-1389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+84
-1389
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@
1616
*.html
1717
*.out
1818
*.err
19-
00_sample
19+
00_sample
20+
21+
superlib.a

Makefile

+48-46
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,48 @@
1-
##
2-
## EPITECH POOL CHALLENGE, 2023
3-
## general makefile
4-
##
5-
6-
SRC = $(shell find . -name "*.c" ! -path "*test*.c")
7-
OBJ = $(SRC:.c=.o)
8-
COV = ./*.gcda ./*.gcno
9-
10-
NAME = superlib.a
11-
12-
TESTNAME= SUPERtest.bin
13-
TESTFILE= supertests.c
14-
CRITOPATH= ../../criterion/
15-
16-
all: $(NAME)
17-
18-
$(NAME): $(OBJ)
19-
@gcc -c $(SRC) -g3
20-
@echo "Library compiled successfully"
21-
22-
clean:
23-
@rm -f $(OBJ)
24-
@echo "Cleaned .o"
25-
26-
fclean: clean
27-
@rm -f $(NAME)
28-
@echo "Cleaned '$(NAME)'"
29-
@rm -f $(TESTNAME) $(COV)
30-
@echo "Cleaned '$(TESTNAME)' binary & residual files"
31-
32-
re: fclean all
33-
34-
test:
35-
@gcc -fprofile-arcs -ftest-coverage -o $(TESTNAME) $(TESTFILE) $(SRC) -g3 -I$(CRITOPATH)include -L$(CRITOPATH)lib -lcriterion -lm
36-
37-
run: fclean test
38-
@./$(TESTNAME) --verbose
39-
40-
runc: test
41-
@gcovr --exclude */tests.c --exclude-unreachable-branches --sort-percentage --print-summary
42-
43-
norm:
44-
@./csc.sh exercises .
45-
46-
.PHONY: all clean fclean re test run runc norm
1+
##
2+
## EPITECH POOL CHALLENGE, 2023
3+
## general makefile
4+
##
5+
6+
SRC = $(shell find exercises -name "*.c")
7+
TEST_SRC = $(shell find tests -name "*.c")
8+
OBJ = $(SRC:.c=.o)
9+
TEST_OBJ = $(TEST_SRC:.c=.o)
10+
COV = ./*.gcda ./*.gcno
11+
12+
NAME = superlib.a
13+
TEST_FILE_NAME =tests.out
14+
15+
all: $(NAME)
16+
17+
$(NAME): $(OBJ)
18+
ar rc $(NAME) $(OBJ)
19+
echo "Library compiled successfully"
20+
21+
clean:
22+
rm -f $(OBJ)
23+
echo "Cleaned .o"
24+
25+
fclean: clean
26+
rm -f $(NAME)
27+
echo "Cleaned '$(NAME)'"
28+
rm -f $(TEST_FILE_NAME)
29+
rm -f $(TEST_OBJ)
30+
rm -rf *.gcno *.gcda
31+
echo "Cleaned '$(TEST_FILE_NAME)' binary & residual files"
32+
33+
re: fclean all
34+
35+
test: $(TEST_OBJ)
36+
gcc -fprofile-arcs -ftest-coverage -o $(TEST_FILE_NAME) $(TEST_OBJ) $(SRC) -lcriterion
37+
38+
run: fclean test
39+
./$(TEST_FILE_NAME) --verbose
40+
41+
runc: test
42+
gcovr -e tests
43+
gcovr -e tests -bu
44+
45+
norm:
46+
./csc.sh exercises .
47+
48+
.PHONY: all clean fclean re test run runc norm

exercises/01_putchar/Makefile

-43
This file was deleted.

exercises/01_putchar/putchar.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
2-
** EPITECH POOL CHALLENGE, 2023
3-
** putchar
2+
** EPITECH PROJECT, 2021
3+
** some name
4+
** File description:
5+
** some desc
46
*/
57

68
/* ALLOWED FUNCTIONS: write */
@@ -17,4 +19,4 @@
1719
int my_putchar(char c)
1820
{
1921
return 0;
20-
}
22+
}

exercises/02_isneg/Makefile

-44
This file was deleted.

exercises/03_put_nbr/Makefile

-44
This file was deleted.

exercises/04_swap/Makefile

-43
This file was deleted.

exercises/05_putstr/Makefile

-44
This file was deleted.

exercises/06_strlen/Makefile

-43
This file was deleted.

0 commit comments

Comments
 (0)