-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtester.sh
More file actions
executable file
·72 lines (50 loc) · 2.86 KB
/
tester.sh
File metadata and controls
executable file
·72 lines (50 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
PURPLE='\033[0;35m'
RESET='\033[0m'
echo -e "${PURPLE} ---------------------------------------------------------------${RESET}"
echo -e "${PURPLE} TESTING INPUT FILE${RESET}"
echo -e "${PURPLE} ---------------------------------------------------------------\n${RESET}"
echo -e "${RED}--> Missing file${RESET}"
./cub3D
echo -e "${RED}--> Incorrect extension${RESET}"
./cub3D srcs/main.c
echo -e "${RED}--> Inexistent file${RESET}"
./cub3D --leak-check=full --show-leak-kinds=all blabla.cub
echo -e "${RED}--> Directory with .cub ending${RESET}"
mkdir "test.cub" ; ./cub3D --leak-check=full --show-leak-kinds=all "test.cub" ; rm -rf "test.cub"
echo -e "${PURPLE} ---------------------------------------------------------------${RESET}"
echo -e "${PURPLE} TESTING TYPE IDENTIFIERS${RESET}"
echo -e "${PURPLE} ---------------------------------------------------------------\n${RESET}"
echo -e "${RED}--> Missing a type identifier${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/id_missing.cub
echo -e "${RED}--> Has a type identifier multiple times${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/id_multiple.cub
echo -e "${RED}--> A type identifier is not the first element of a line${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/id_not_first.cub
echo -e "${RED}--> A texture is not readable${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/nonvalid_texture.cub
echo -e "${RED}--> Color has an extra comma${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/extra_comma.cub
echo -e "${RED}--> Color has an rgb higher than 255${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/300rgb.cub
echo -e "${GREEN}--> Has spaces befor type identifier${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/map.cub
echo -e "${PURPLE} ---------------------------------------------------------------${RESET}"
echo -e "${PURPLE} TESTING MAP${RESET}"
echo -e "${PURPLE} ---------------------------------------------------------------\n${RESET}"
echo -e "${RED}--> Invalid non-map character${RESET}"
valgrind ./cub3D maps/nonmap_char.cub
echo -e "${RED}--> Two players${RESET}"
valgrind ./cub3D maps/two_players.cub
echo -e "${RED}--> No players${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/no_players.cub
echo -e "${RED}--> Not surrounded by walls${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/not_surrounded.cub
echo -e "${RED}--> has spaces in the middle of the map${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/spaced.cub
echo -e "${GREEN}--> Egypt${RESET}"
valgrind --leak-check=full --show-leak-kinds=all ./cub3D maps/Egypt.cub
echo -e "${GREEN}--> Egypt${RESET}"
./cub3D maps/Maze.cub