Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Enchente
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vytor Calixto
Enchente
Commits
0eda2967
There was a problem fetching the pipeline summary.
Commit
0eda2967
authored
8 years ago
by
Vytor Calixto
Browse files
Options
Downloads
Patches
Plain Diff
Muda os testes (de novo)
parent
27fe2f75
No related branches found
No related tags found
1 merge request
!2
Altura
Pipeline
#
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+70
-3
70 additions, 3 deletions
.gitlab-ci.yml
Makefile
+0
-6
0 additions, 6 deletions
Makefile
tests/runTests.sh
+28
-30
28 additions, 30 deletions
tests/runTests.sh
with
98 additions
and
39 deletions
.gitlab-ci.yml
+
70
−
3
View file @
0eda2967
...
...
@@ -6,11 +6,78 @@ before_script:
-
apt-get -y install build-essential make autoconf gcc gnuplot
-
make
test
:
h1
:
stage
:
test
script
:
-
make test
-
cd tests
-
gcc -std=c99 -o test geraMapa.c
-
chmod +x runTests.sh
-
./runTests.sh -h "./floodit_h1"
-
gnuplot "tempos.plot"
-
gnuplot "medias.plot"
-
gnuplot "piores.plot"
artifacts
:
paths
:
-
tests/tabuleiros.txt
-
tests/tempos.txt
-
tests/medias.txt
-
tests/piores.txt
-
tests/tempos.png
-
tests/medias.png
-
tests/piores.png
tags
:
-
ubuntu
h2
:
stage
:
test
script
:
-
cd tests
-
gcc -std=c99 -o test geraMapa.c
-
chmod +x runTests.sh
-
./runTests.sh -h "./floodit_h2"
-
gnuplot "tempos.plot"
-
gnuplot "medias.plot"
-
gnuplot "piores.plot"
artifacts
:
paths
:
-
tests/tabuleiros.txt
-
tests/tempos.txt
-
tests/medias.txt
-
tests/piores.txt
-
tests/tempos.png
-
tests/medias.png
-
tests/piores.png
tags
:
-
ubuntu
h4
:
stage
:
test
script
:
-
cd tests
-
gcc -std=c99 -o test geraMapa.c
-
chmod +x runTests.sh
-
./runTests.sh -h "./floodit_h4"
-
gnuplot "tempos.plot"
-
gnuplot "medias.plot"
-
gnuplot "piores.plot"
artifacts
:
paths
:
-
tests/tabuleiros.txt
-
tests/tempos.txt
-
tests/medias.txt
-
tests/piores.txt
-
tests/tempos.png
-
tests/medias.png
-
tests/piores.png
tags
:
-
ubuntu
h6
:
stage
:
test
script
:
-
cd tests
-
gcc -std=c99 -o test geraMapa.c
-
chmod +x runTests.sh
-
./runTests.sh -h "./floodit_h6"
-
gnuplot "tempos.plot"
-
gnuplot "medias.plot"
-
gnuplot "piores.plot"
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
0
−
6
View file @
0eda2967
...
...
@@ -4,12 +4,6 @@ CFLAGS = -std=c99 -O2 -W -Wall -g
all
:
main
test
:
main
cd
tests
;
\
$(
CC
)
-std
=
c99
-o
test
geraMapa.c
;
\
chmod
+x runTests.sh
;
\
./runTests.sh
main
:
main.c libs/jogador.o libs/tabuleiro.o libs/grafo.o libs/vertice.o libs/filha.o libs/lista.o libs/no.o
$(
CC
)
$(
CFLAGS
)
-o
$@
$^
-lm
...
...
This diff is collapsed.
Click to expand it.
tests/runTests.sh
+
28
−
30
View file @
0eda2967
#!/bin/bash
OPTIND
=
1
MAIN
=
"../main"
HEUR
=
"./floodit_h6"
while
getopts
":m:h:"
opt
;
do
case
"
$opt
"
in
m
)
MAIN
=
$OPTARG
;;
h
)
HEUR
=
$OPTARG
;;
esac
done
shift
$((
OPTIND-1
))
[
"
$1
"
=
"--"
]
&&
shift
echo
$MAIN
echo
$HEUR
# tempo máximo para executar, em milisegundos
tempo_max
=
120000
#120s
# tamanhos do tabuleiro
tams
=(
3 4 8 16
32 64 100
)
tams
=(
32 64 100
)
# lista de cores
cores
=(
2 3 4 6 8 10
)
...
...
@@ -41,34 +60,16 @@ do
# echo "Usando semente: ${semente}"
./test
$i
$i
$cor
$semente
T_inicial
=
$(
date
+%s%N
)
../main
<
"/tmp/
${
semente
}
.in"
>
/tmp/resp.out
eval
$MAIN
<
"/tmp/
${
semente
}
.in"
>
/tmp/resp.out
T_gasto
=
$((
$(
date
+%s%N
)
-
$T_inicial
))
T_soma_cor
=
$((
$T_gasto
+
$T_soma_cor
))
T_soma_total
=
$((
$T_gasto
+
$T_soma_total
))
./floodit_h1 <
"/tmp/
${
semente
}
.in"
>
/tmp/h1.out
./floodit_h2 <
"/tmp/
${
semente
}
.in"
>
/tmp/h2.out
./floodit_h4 <
"/tmp/
${
semente
}
.in"
>
/tmp/h4.out
./floodit_h6 <
"/tmp/
${
semente
}
.in"
>
/tmp/h6.out
RESP
=
$(
cat
/tmp/resp.out |
head
-n1
)
H1
=
$(
cat
/tmp/h1.out |
tail
-n2
|
head
-n1
)
H2
=
$(
cat
/tmp/h2.out |
tail
-n2
|
head
-n1
)
H4
=
$(
cat
/tmp/h4.out |
tail
-n2
|
head
-n1
)
H6
=
$(
cat
/tmp/h6.out |
tail
-n2
|
head
-n1
)
if
[
$RESP
-gt
$H1
]
;
then
echo
-ne
"
${
RED
}
Heurística h1 fez tabuleiro
${
i
}
${
i
}
${
cor
}
${
semente
}
em
${
H1
}
e nós em
${
RESP
}${
NC
}
\n
"
echo
"
${
i
}
${
i
}
${
cor
}
${
semente
}
(h1:
${
H1
}
)"
>>
tabuleiros.txt
fi
if
[
$RESP
-gt
$H2
]
;
then
echo
-ne
"
${
RED
}
Heurística h2 fez tabuleiro
${
i
}
${
i
}
${
cor
}
${
semente
}
em
${
H2
}
e nós em
${
RESP
}${
NC
}
\n
"
echo
"
${
i
}
${
i
}
${
cor
}
${
semente
}
(h2:
${
H2
}
)"
>>
tabuleiros.txt
fi
if
[
$RESP
-gt
$H4
]
;
then
echo
-ne
"
${
RED
}
Heurística h4 fez tabuleiro
${
i
}
${
i
}
${
cor
}
${
semente
}
em
${
H4
}
e nós em
${
RESP
}${
NC
}
\n
"
echo
"
${
i
}
${
i
}
${
cor
}
${
semente
}
(h4:
${
H4
}
)"
>>
tabuleiros.txt
fi
if
[
$RESP
-gt
$H6
]
;
then
echo
-ne
"
${
RED
}
Heurística h6 fez tabuleiro
${
i
}
${
i
}
${
cor
}
${
semente
}
em
${
H6
}
e nós em
${
RESP
}${
NC
}
\n
"
echo
"
${
i
}
${
i
}
${
cor
}
${
semente
}
(h6:
${
H6
}
)"
>>
tabuleiros.txt
eval
$HEUR
<
"/tmp/
${
semente
}
.in"
>
/tmp/heur.out
RESP
=
$(
cat
/tmp/resp.out |
tail
-n2
|
head
-n1
)
HRESP
=
$(
cat
/tmp/heur.out |
tail
-n2
|
head
-n1
)
if
[
$RESP
-gt
$HRESP
]
;
then
echo
-ne
"
${
RED
}
Heurística
${
HEUR
}
fez tabuleiro
${
i
}
${
i
}
${
cor
}
${
semente
}
em
${
HRESP
}
e nós em
${
RESP
}${
NC
}
\n
"
echo
"
${
i
}
${
i
}
${
cor
}
${
semente
}
(
${
H1
}
)"
>>
tabuleiros.txt
fi
# tempo em segundos
S
=
$((
$T_gasto
/
1000000000
))
...
...
@@ -84,10 +85,7 @@ do
# fi
rm
"/tmp/
${
semente
}
.in"
rm
"/tmp/resp.out"
rm
"/tmp/h1.out"
rm
"/tmp/h2.out"
rm
"/tmp/h4.out"
rm
"/tmp/h6.out"
rm
"/tmp/heur.out"
done
T_medio_cor
=
$((
$T_soma_cor
/
${
N_TESTES
}))
S_medio_cor
=
$((
$T_medio_cor
/
1000000000
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment