Skip to content
Snippets Groups Projects
Commit 9db03628 authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Add gnuplot script

parent 74bd1a17
No related branches found
No related tags found
1 merge request!1Develop
Pipeline #
...@@ -4,4 +4,5 @@ main ...@@ -4,4 +4,5 @@ main
a.out a.out
*.in *.in
test test
tests/tabuleiros.txt tests/*.txt
tests/tempos.png
...@@ -10,8 +10,12 @@ run_tests: ...@@ -10,8 +10,12 @@ run_tests:
stage: test stage: test
script: script:
- make test - make test
- cd tests
- gnuplot "tempos.plot"
artifacts: artifacts:
paths: paths:
- tests/tabuleiros.txt - tests/tabuleiros.txt
- tests/tempos.txt
- tests/tempos.png
tags: tags:
- ubuntu - ubuntu
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
tempo_max=500 tempo_max=500
# tamanhos do tabuleiro # tamanhos do tabuleiro
tams=(8 16 32 64 128 256 512 1024) tams=(8 16 32 64 128 512 1024 2048 4096)
# lista de cores # lista de cores
cores=(4 8 16 32 64) cores=(4 8 16 32 64)
...@@ -17,6 +17,7 @@ CYAN='\033[0;36m' ...@@ -17,6 +17,7 @@ CYAN='\033[0;36m'
NC='\033[0m' # Sem cor NC='\033[0m' # Sem cor
echo -ne "" > tabuleiros.txt echo -ne "" > tabuleiros.txt
echo -ne "" > tempos.txt
echo "Iniciado testes" echo "Iniciado testes"
for i in ${tams[*]} for i in ${tams[*]}
...@@ -61,6 +62,7 @@ do ...@@ -61,6 +62,7 @@ do
echo -ne "${BLUE}Tempo médio com tamanho ${i}: ${S_medio_total}." echo -ne "${BLUE}Tempo médio com tamanho ${i}: ${S_medio_total}."
printf "%03d" ${M_medio_total} printf "%03d" ${M_medio_total}
echo -e "s (${T_medio_cor})${NC}\n" echo -e "s (${T_medio_cor})${NC}\n"
echo -e "${i} \t ${M_medio_total}" >> tempos.txt
done done
fs=$(cat tabuleiros.txt | wc -l) fs=$(cat tabuleiros.txt | wc -l)
...@@ -69,6 +71,6 @@ if [ ${fs} -gt "1" ]; then ...@@ -69,6 +71,6 @@ if [ ${fs} -gt "1" ]; then
cat tabuleiros.txt cat tabuleiros.txt
exit 1 exit 1
else else
echo -e "${GREEN}Nenhum tabuleiro passou do tempo limite${NC}" echo -e "${GREEN}Nenhum tabuleiro passou do tempo limite de ${tempo_max} milisegundos${NC}"
exit 0 exit 0
fi fi
set terminal png
set output "tempos.png"
set xlabel "Tamanho"
set ylabel "Tempo (milisegundos)"
set title "Tempo médio para execução considerando tamanho do tabuleiro e tempo"
set grid
set style data lines
set key
plot "tempos.txt" using 1:2 with lines lc rgb "#602b7d" lw 2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment