Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Algorithms Library Toolkit Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Algorithms Library Toolkit
Algorithms Library Toolkit Core
Commits
f0d15813
Commit
f0d15813
authored
10 years ago
by
Jan Vesely
Browse files
Options
Downloads
Patches
Plain Diff
add test bash script for adeterminize
parent
39ae14b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests.adeterminize.sh
+103
-0
103 additions, 0 deletions
tests.adeterminize.sh
with
103 additions
and
0 deletions
tests.adeterminize.sh
0 → 100644
+
103
−
0
View file @
f0d15813
#!/usr/bin/env bash
# -------------------- Constants --------------------
ADETERMINIZE_EXECUTABLE
=
"adeterminize"
NFSM_TESTS_COUNT
=
"4"
NIDPDA_TESTS_COUNT
=
"3"
# -------------------- Functions --------------------
function
checkAdeterminizeExecutable
{
if
[
!
-f
$ADETERMINIZE_EXECUTABLE
]
;
then
echo
"Make sure
$ADETERMINIZE_EXECUTABLE
, which is necessary for running this test, exists in bin folder."
exit
1
fi
}
function
compareTmpAutomatons
{
TMP
=
$(
./adiff.automaton tmp1.xml tmp2.xml
)
if
[
$?
==
0
]
;
then
((
SUCCESS_COUNT++
))
echo
" Test
$1
: successful"
else
((
FAILED_COUNT++
))
echo
" Test
$1
: FAILED"
fi
rm
tmp1.xml tmp2.xml
}
function
testFsm
{
echo
"FSM:"
for
i
in
$(
seq
1
$NFSM_TESTS_COUNT
)
;
do
NFSM
=
"../examples/automaton/NFSM
$i
.xml"
DFSM
=
"../examples/automaton/NFSM
$i
.DET.xml"
./adeterminize
--type
=
fsm <
$NFSM
>
tmp1.xml
cp
$DFSM
tmp2.xml
compareTmpAutomatons
"NFSM
$i
"
done
}
function
testIdpda
{
echo
"IDPDA:"
for
i
in
$(
seq
1
$NIDPDA_TESTS_COUNT
)
;
do
NIDPDA
=
"../examples/automaton/NIDPDA
$i
.xml"
DIDPDA
=
"../examples/automaton/NIDPDA
$i
.DET.xml"
./adeterminize
--type
=
idpda <
$NIDPDA
>
tmp1.xml
cp
$DIDPDA
tmp2.xml
compareTmpAutomatons
"IDPDA
$i
"
done
}
function
testVpa
{
echo
"VPA:"
echo
" Tests not implemented yet."
}
function
testRhdpda
{
echo
"RHDPDA:"
echo
" Tests not implemented yet."
}
function
printIntroduction
{
echo
"adeterminize tests:"
echo
"-------------------------"
}
function
printResults
{
echo
"-------------------------"
echo
"Results:
$SUCCESS_COUNT
successful,
$FAILED_COUNT
failed"
}
# -------------------- Run test --------------------
SUCCESS_COUNT
=
0
FAILED_COUNT
=
0
cd
bin
printIntroduction
checkAdeterminizeExecutable
testFsm
testIdpda
testVpa
testRhdpda
printResults
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