diff --git a/.gitignore b/.gitignore index 3feb5eef315c1ca67ff77d962f9c3558bf310dd9..cbb833c4b0bc8c656676f7bc6165db0e08f57b65 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ main a.out *.in test -tests/tabuleiros.txt +tests/*.txt +tests/tempos.png diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f22fc34200ff4bd43e108846a147a26cb1177a48..2e3ea7f1db52986b2924209218fa58ab7fd6fbab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,8 +10,12 @@ run_tests: stage: test script: - make test + - cd tests + - gnuplot "tempos.plot" artifacts: paths: - tests/tabuleiros.txt + - tests/tempos.txt + - tests/tempos.png tags: - ubuntu diff --git a/tests/runTests.sh b/tests/runTests.sh index 774f9dba36e494bf77bc990e6002ffef300b5404..ce633058fd311ac00a852c2a3d20699348f52e40 100755 --- a/tests/runTests.sh +++ b/tests/runTests.sh @@ -4,7 +4,7 @@ tempo_max=500 # 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 cores=(4 8 16 32 64) @@ -17,6 +17,7 @@ CYAN='\033[0;36m' NC='\033[0m' # Sem cor echo -ne "" > tabuleiros.txt +echo -ne "" > tempos.txt echo "Iniciado testes" for i in ${tams[*]} @@ -61,6 +62,7 @@ do echo -ne "${BLUE}Tempo médio com tamanho ${i}: ${S_medio_total}." printf "%03d" ${M_medio_total} echo -e "s (${T_medio_cor})${NC}\n" + echo -e "${i} \t ${M_medio_total}" >> tempos.txt done fs=$(cat tabuleiros.txt | wc -l) @@ -69,6 +71,6 @@ if [ ${fs} -gt "1" ]; then cat tabuleiros.txt exit 1 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 fi diff --git a/tests/tempos.plot b/tests/tempos.plot new file mode 100644 index 0000000000000000000000000000000000000000..b8500d5ece5296a4ac1bbeea8ec647fb612ca2cd --- /dev/null +++ b/tests/tempos.plot @@ -0,0 +1,9 @@ +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