-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·102 lines (101 loc) · 2.57 KB
/
run.sh
File metadata and controls
executable file
·102 lines (101 loc) · 2.57 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/sh
function title_tmp()
{
for ((i = 1 ; i <= $1 ; i++))
do
echo "\033["$4";"$i"H "
done
for ((i = $2 ; i <= $3 ; i++))
do
echo "\033["$4";"$i"H "
done
}
function title()
{
clear
cols=$(tput cols)
start=$(((cols / 2) - 15))
end=$(((cols / 2) + 15))
echo "\033[31;44m"
title_tmp $start $end $cols 1
title_tmp $start $end $cols 2
title_tmp $start $end $cols 3
title_tmp $start $end $cols 4
title_tmp $start $end $cols 5
title_tmp $start $end $cols 6
echo "\033[1;"$start"H _ _ "
echo "\033[2;"$start"H /\/\ __ _| | | ___ ___ "
echo "\033[3;"$start"H / \ / _\` | | |/ _ \ / __|"
echo "\033[4;"$start"H / /\/\ \ (_| | | | (_) | (__ "
echo "\033[5;"$start"H \/ \/\__,_|_|_|\___/ \___|"
echo "\033[6;"$start"H © made by moi"
echo "\033[0m"
start=$(((cols / 2) - 22))
echo "\033[1m\033[8;"$start"HAppuyer sur Enter pour faire défiler les test\033[0m"
}
export DYLD_LIBRARY_PATH=.
export DYLD_INSERT_LIBRARIES="libft_malloc.so"
export DYLD_FORCE_FLAT_NAMESPACE=1
if [ $1 = "all" ]
then
title
tput civis
read -s tmp
echo ""
echo "\033[1;4;44;32mTest 0:\033[0m"
/usr/bin/time -l ./test0 2> /tmp/tmp
unset DYLD_FORCE_FLAT_NAMESPACE
cat /tmp/tmp
VAL1=$(cat /tmp/tmp | grep "page reclaims" | cut -d 'p' -f 1 | bc)
export DYLD_FORCE_FLAT_NAMESPACE=1
read -s tmp
echo ""
echo "\033[1;4;44;32mTest 1:\033[0m"
/usr/bin/time -l ./test1 2> /tmp/tmp
unset DYLD_FORCE_FLAT_NAMESPACE
cat /tmp/tmp
VAL2=$(cat /tmp/tmp | grep "page reclaims" | cut -d 'p' -f 1 | bc)
export DYLD_FORCE_FLAT_NAMESPACE=1
read -s tmp
echo ""
echo "\033[1;4;44;32mTest 2:\033[0m"
/usr/bin/time -l ./test2 2> /tmp/tmp
unset DYLD_FORCE_FLAT_NAMESPACE
cat /tmp/tmp
VAL3=$(cat /tmp/tmp | grep "page reclaims" | cut -d 'p' -f 1 | bc)
export DYLD_FORCE_FLAT_NAMESPACE=1
read -s tmp
echo ""
echo "\033[1;4;44;32mBILAN Test0, Test1, Test2:\033[0m"
echo "-> Différence entre le nombre de page reclaims entre Test0 et Test1"
unset DYLD_FORCE_FLAT_NAMESPACE
VAL4=$(echo $VAL2 "-" $VAL1 | bc)
echo "\t" $VAL4
echo "-> Différence entre le nombre de page reclaims entre Test0 et Test2"
VAL4=$(echo $VAL3 "-" $VAL1 | bc)
echo "\t" $VAL4
export DYLD_FORCE_FLAT_NAMESPACE=1
read -s tmp
title
echo ""
echo "\033[1;4;44;32mTest 3:\033[0m"
./test3
read -s tmp
echo ""
echo "\033[1;4;44;32mTest 3bis:\033[0m"
./test3bis
read -s tmp
echo ""
echo "\033[1;4;44;32mTest 4:\033[0m"
./test4
read -s tmp
unset DYLD_FORCE_FLAT_NAMESPACE
title
echo ""
echo "\033[1;4;44;32mTest 5:\033[0m"
./test5
read -s tmp
tput cnorm
else
$@
fi