Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
cbafeaa8
Commit
cbafeaa8
authored
Jun 27, 2014
by
Maxime Perrotin
Browse files
Merge branch 'master' of
https://github.com/dbrabera/opengeode
parents
58a3f8f5
f6b486b8
Changes
16
Show whitespace changes
Inline
Side-by-side
Makefile
View file @
cbafeaa8
all
:
compile-all
regression
:
make
-C
tests/regression all
test-parse
:
@
python tests/test.py test-parse
test-ada
:
@
python tests/test.py test-ada
flake8
:
@
echo
Generating flake8_report file
...
...
tests/regression/Makefile
View file @
cbafeaa8
EXAMPLES
=
test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12 test13
all
:
for
v
in
$(EXAMPLES)
;
do
make
-C
$$
v clean all
||
exit
1
;
done
parse
:
for
v
in
$(EXAMPLES)
;
do
make
-C
$$
v parse
||
exit
1
;
done
coverage
:
for
v
in
$(EXAMPLES)
;
do
make
-C
$$
v coverage
&&
mv
$$
v/.coverage
*
.
||
exit
1
;
done
;
coverage combine
...
...
tests/regression/test1/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
og.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py og.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
og.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
og.adb
&&
echo
'All OK!'
parse
:
../../../opengeode.py og.pr system_structure.pr
--check
gnatmake
-c
og.adb
coverage
:
coverage run
-p
../../../opengeode.py og.pr system_structure.pr
--toAda
...
...
tests/regression/test10/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
challenge.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py challenge.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
challenge.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
*
.adb
gcc
-c
test.c
gnatbind
-n
challenge.ali
gnatlink
-o
testcase test.o challenge.ali
-lgnat
-lm
./testcase
>
result
diff result expected
&&
echo
'All OK!'
parse
:
../../../opengeode.py challenge.pr system_structure.pr
--check
./testcase | diff expected -
coverage
:
coverage run
-p
../../../opengeode.py challenge.pr system_structure.pr
--toAda
clean
:
rm
-rf
*
.adb
*
.ads
*
.pyc runSpark.sh spark.idx
*
.o
*
.ali gnat.cfg examiner bin
*
.wrn
*
.gpr
test
rm
-rf
*
.adb
*
.ads
*
.pyc runSpark.sh spark.idx
*
.o
*
.ali gnat.cfg examiner bin
*
.wrn
*
.gpr test
case
tests/regression/test11/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
og.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py og.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
og.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
*
.adb
gcc
-c
test.c
gnatbind
-n
og.ali
gnatlink
-o
testcase test.o og.ali
-lgnat
./testcase
>
result
diff result expected
&&
echo
'All OK!'
parse
:
../../../opengeode.py og.pr system_structure.pr
--check
./testcase | diff expected -
coverage
:
coverage run
-p
../../../opengeode.py og.pr system_structure.pr
--toAda
clean
:
rm
-rf
result
*
.adb
*
.ads
*
.pyc runSpark.sh spark.idx
*
.o
*
.ali gnat.cfg examiner bin
*
.wrn
*
.gpr
rm
-rf
result
*
.adb
*
.ads
*
.pyc runSpark.sh spark.idx
*
.o
*
.ali gnat.cfg examiner bin
*
.wrn
*
.gpr
testcase
tests/regression/test12/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
trafficlight.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py trafficlight.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
trafficlight.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
*
.adb
&&
echo
'All OK!'
gnatmake
-c
*
.adb
#gcc -c test.c
#gnatbind -n trafficlight.ali
#gnatlink -o testcase test.o trafficlight.ali -lgnat -lm
parse
:
../../../opengeode.py trafficlight.pr system_structure.pr
--check
coverage
:
coverage run
-p
../../../opengeode.py trafficlight.pr system_structure.pr
--toAda
...
...
tests/regression/test13/Makefile
View file @
cbafeaa8
all
:
test
all
:
test
-ada
parse
:
test-
parse
:
../../../opengeode.py basic.pr system_structure.pr
--check
generate-ada
:
@
../../../opengeode.py basic.pr system_structure.pr
--check
--toAda
compile-ada
:
generate-ada
@
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
@
gnatmake
-c
*
.adb
run-ada
:
compile-ada
@
gcc
-c
test_ada.c
@
gnatbind
-n
basic.ali
@
gnatlink test_ada.o basic.ali
-lgnat
-lm
-o
testcase
@
./testcase | diff expected -
test
:
run-ada
echo
"ALL OK!"
test-ada
:
../../../opengeode.py basic.pr system_structure.pr
--check
--toAda
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
*
.adb
gcc
-c
test_ada.c
gnatbind
-n
basic.ali
gnatlink test_ada.o basic.ali
-lgnat
-lm
-o
testcase
./testcase | diff expected -
clean
:
@
rm
-rf
*
.adb
*
.ads
*
.pyc runSpark.sh spark.idx
*
.o
*
.ali gnat.cfg examiner bin
*
.wrn
*
.gpr testcase
rm
-rf
*
.adb
*
.ads
*
.pyc runSpark.sh spark.idx
*
.o
*
.ali gnat.cfg examiner bin
*
.wrn
*
.gpr testcase
tests/regression/test2/Makefile
View file @
cbafeaa8
all
:
compile
all
:
test-ada
generate-cod
e
:
../../../opengeode.py
--toAda
orchestrator.pr system_structure.pr
test-pars
e
:
../../../opengeode.py orchestrator.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
orchestrator.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
orchestrator.adb
&&
echo
'All OK!'
parse
:
../../../opengeode.py orchestrator.pr system_structure.pr
--check
gnatmake
-c
orchestrator.adb
coverage
:
coverage run
-p
../../../opengeode.py orchestrator.pr system_structure.pr
--toAda
...
...
tests/regression/test3/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
fce.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py fce.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
fce.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
fce.adb
&&
echo
'All OK!'
parse
:
../../../opengeode.py fce.pr system_structure.pr
--check
gnatmake
-c
fce.adb
coverage
:
coverage run
-p
../../../opengeode.py fce.pr system_structure.pr
--toAda
...
...
tests/regression/test4/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
orchestrator.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py orchestrator.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
orchestrator.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
orchestrator.adb
&&
echo
'All OK!'
parse
:
../../../opengeode.py orchestrator.pr system_structure.pr
--check
gnatmake
-c
orchestrator.adb
coverage
:
coverage run
-p
../../../opengeode.py orchestrator.pr system_structure.pr
--toAda
...
...
tests/regression/test5/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
function0.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py function0.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
function0.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
function0.adb
&&
echo
'All OK!'
parse
:
../../../opengeode.py function0.pr system_structure.pr
--check
gnatmake
-c
function0.adb
coverage
:
coverage run
-p
../../../opengeode.py function0.pr system_structure.pr
--toAda
...
...
tests/regression/test6/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
myfunction.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py myfunction.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
myfunction.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
myfunction.adb
&&
echo
'All OK!'
parse
:
../../../opengeode.py myfunction.pr system_structure.pr
--check
gnatmake
-c
myfunction.adb
coverage
:
coverage run
-p
../../../opengeode.py myfunction.pr system_structure.pr
--toAda
...
...
tests/regression/test7/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
orchestrator.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py orchestrator.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
orchestrator.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
orchestrator.adb
&&
echo
'All OK!'
parse
:
../../../opengeode.py orchestrator.pr system_structure.pr
--check
gnatmake
-c
orchestrator.adb
coverage
:
coverage run
-p
../../../opengeode.py orchestrator.pr system_structure.pr
--toAda
clean
:
rm
-rf
*
.adb
*
.ads
*
.pyc runSpark.sh spark.idx
*
.o
*
.ali gnat.cfg examiner bin
*
.wrn
*
.gpr
tests/regression/test8/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
orchestrator.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py
--check
orchestrator.pr system_structure.pr
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
orchestrator.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
orchestrator.adb
&&
echo
'All OK!'
parse
:
../../../opengeode.py
--check
orchestrator.pr system_structure.pr
gnatmake
-c
orchestrator.adb
coverage
:
coverage run
-p
../../../opengeode.py orchestrator.pr system_structure.pr
--toAda
...
...
tests/regression/test9/Makefile
View file @
cbafeaa8
all
:
compile
generate-code
:
../../../opengeode.py
--toAda
challenge.pr system_structure.pr
all
:
test-ada
test-parse
:
../../../opengeode.py challenge.pr system_structure.pr
--check
compile
:
generate-code
test-ada
:
../../../opengeode.py
--toAda
challenge.pr system_structure.pr
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
challenge.adb
&&
echo
'All OK!'
parse
:
../../../opengeode.py challenge.pr system_structure.pr
--check
gnatmake
-c
challenge.adb
coverage
:
coverage run
-p
../../../opengeode.py challenge.pr system_structure.pr
--toAda
...
...
tests/test.py
0 → 100644
View file @
cbafeaa8
import
os
import
subprocess
import
sys
import
time
tests_folder
=
os
.
path
.
dirname
(
__file__
)
paths
=
[
'regression/test1'
,
'regression/test2'
,
'regression/test3'
,
'regression/test4'
,
'regression/test5'
,
'regression/test6'
,
'regression/test7'
,
'regression/test8'
,
'regression/test9'
,
'regression/test10'
,
'regression/test11'
,
'regression/test12'
,
'regression/test13'
,
]
def
main
():
start
=
time
.
time
()
results
=
[]
for
rule
in
sys
.
argv
[
1
:]:
for
path
in
paths
:
full_path
=
os
.
path
.
join
(
tests_folder
,
path
)
result
=
make
(
full_path
,
rule
)
make
(
full_path
,
'clean'
)
results
.
append
(
result
)
sys
.
stdout
.
write
(
'.'
if
result
[
0
]
==
0
else
'F'
)
sys
.
stdout
.
flush
()
sys
.
stdout
.
write
(
'
\n
'
)
elapsed
=
time
.
time
()
-
start
sys
.
exit
(
summarize
(
results
,
elapsed
))
def
make
(
path
,
rule
):
proc
=
subprocess
.
Popen
(
[
'make'
,
'-C'
,
path
,
rule
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdout
,
stderr
=
proc
.
communicate
()
errcode
=
proc
.
wait
()
return
(
errcode
,
stdout
,
stderr
,
path
,
rule
)
def
summarize
(
results
,
elapsed
):
failed
=
0
for
errcode
,
stdout
,
stderr
,
path
,
rule
in
results
:
if
errcode
==
0
:
continue
failed
+=
1
print
"======================================================================"
print
"ERROR: %s %s"
%
(
path
,
rule
)
if
stdout
:
print
"- stdout -------------------------------------------------------------"
print
stdout
if
stderr
:
print
"- stderr -------------------------------------------------------------"
print
stderr
print
"----------------------------------------------------------------------"
print
"Finished in %.3fs"
%
elapsed
print
"%s tests, %s errors"
%
(
len
(
results
),
failed
)
return
0
if
not
failed
else
1
if
__name__
==
'__main__'
:
main
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment