Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F84586116
run_tests.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Sep 23, 18:37
Size
1 KB
Mime Type
text/x-shellscript
Expires
Wed, Sep 25, 18:37 (2 d)
Engine
blob
Format
Raw Data
Handle
21049249
Attached To
rTAMAAS tamaas
run_tests.sh
View Options
#!/bin/bash
#########################################################################
function
test_output
{
name
=
$(
basename -s .verified
$1
)
echo
"Testing $name ouput"
echo
-n
"------------ "
diff
$name
.out
$name
.verified >/dev/null 2>&1
return
$?
}
#########################################################################
function
test_return
{
name
=
$(
basename -s .py
$1
)
echo
"Testing $name.py"
echo
-n
"------------ "
PYTHONPATH
=
../python python
$name
.py 2>/dev/null >
$name
.out
return
$?
}
#########################################################################
tamaas_path
=
$(
PYTHONPATH
=
../python python -c
'import tamaas; print tamaas'
| cut -d
"'"
-f 4
)
echo
"Tamaas test suite"
echo
"================="
echo
""
echo
"importing tamaas from $tamaas_path"
echo
""
n_tests
=
0
passed_tests
=
0
for
test_file in test_*.py;
do
((
n_tests++
))
test_return
$test_file
result
=
$?
if
[
$result
-ne 0
]
;
then
echo
"failure"
else
echo
"success"
((
passed_tests++
))
fi
done
for
test_file in test_*.verified;
do
((
n_tests++
))
test_output
$test_file
result
=
$?
if
[
$result
-ne 0
]
;
then
echo
"failure"
else
echo
"success"
((
passed_tests++
))
fi
done
failed_tests
=
$((
n_tests
-
passed_tests
))
echo
""
echo
"Test results :"
echo
" - passed $passed_tests/$n_tests"
echo
" - failed $failed_tests/$n_tests"
Event Timeline
Log In to Comment