Skip to content

Commit d11e2cf

Browse files
committed
revise test scripts, regenerate .ref files of expected test output
1 parent ee52dd4 commit d11e2cf

File tree

13 files changed

+175
-447
lines changed

13 files changed

+175
-447
lines changed

samples/PowerSwitch/fsmpy/PowerSwitchExclude.py

-30
This file was deleted.

samples/Socket/fsmpy/msgsizesFSM.py

-125
This file was deleted.

samples/Socket/fsmpy/msgsizesFSM.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
msgsizesFSM.py is not included in the distribution because it is so large -
2+
more than 11 MB. You can easily regenerate it by running test_analyze_msgsize.

samples/Timeout/test.ref

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sleep(5,)
33
sleep(10,)
44
0. Success at step 3, no more actions enabled, reached accepting state
55
Traceback (most recent call last):
6-
File "/Users/jon/PyModel/pymodel/pmt.py", line 117, in RunTest
6+
File "/Users/jon/PyModel/pymodel/pmt.py", line 124, in RunTest
77
result = stepper.TestAction(aname, args, modelResult)
88
File "/Users/jon/PyModel/samples/Timeout/Stepper.py", line 10, in TestAction
99
time.sleep(seconds)

samples/WebApplication/test_e_testsuite.ref

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
13 states, 11 transitions, 2 accepting states, 0 unsafe states
2-
pma.py --maxTransitions 100 TestIntTwoRuns
3-
pmg.py --transitionLabels action TestIntTwoRunsFSM
2+
pma --maxTransitions 100 TestIntTwoRuns
3+
pmg --transitionLabels action TestIntTwoRunsFSM
44
dot -Tsvg -o TestIntTwoRunsFSM.svg TestIntTwoRunsFSM.dot
55
9 states, 7 transitions, 2 accepting states, 0 unsafe states
6-
pma.py --exclude Logout --maxTransitions 100 --output TestIntTwoRuns_NoLogout TestIntTwoRuns
7-
pmg.py --transitionLabels action TestIntTwoRuns_NoLogout
6+
pma --exclude Logout --maxTransitions 100 --output TestIntTwoRuns_NoLogout TestIntTwoRuns
7+
pmg --transitionLabels action TestIntTwoRuns_NoLogout
88
dot -Tsvg -o TestIntTwoRuns_NoLogout.svg TestIntTwoRuns_NoLogout.dot
99
8 states, 6 transitions, 2 accepting states, 0 unsafe states
10-
pma.py --action Initialize --action Login --action UpdateInt --maxTransitions 100 --output TestIntTwoRuns_Add TestIntTwoRuns
11-
pmg.py --transitionLabels action TestIntTwoRuns_Add
10+
pma --action Initialize --action Login --action UpdateInt --maxTransitions 100 --output TestIntTwoRuns_Add TestIntTwoRuns
11+
pmg --transitionLabels action TestIntTwoRuns_Add
1212
dot -Tsvg -o TestIntTwoRuns_Add.svg TestIntTwoRuns_Add.dot
1313
Test suite with two runs:
1414

samples/WebApplication/test_ls.ref

-240
This file was deleted.

samples/WebApplication/test_offline.ref

+58-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,64 @@ UpdateInt('VinniPuhh', 2)
3636
Logout('VinniPuhh',)
3737
2. Finished at step 11, reached accepting state
3838
Test finished, completed 3 runs
39-
sh: line 0: type: WebModelTest_n10_c3_s3_r3.py: not found
40-
Generate a test suite with three runs
39+
40+
# pmt -n 10 -c 3 -s 3 -r 3 WebModel -o WebModelTest_n10_c3_s3_r3
41+
42+
# actions here are just labels, but must be symbols with __name__ attribute
43+
44+
def Initialize(): pass
45+
def ReadInt(): pass
46+
def Login(): pass
47+
def Logout(): pass
48+
def UpdateInt(): pass
49+
50+
# action symbols
51+
actions = (Initialize, ReadInt, Login, Logout, UpdateInt)
52+
53+
testSuite = [
54+
[
55+
(Initialize, ()),
56+
(Login, ('OleBrumm', 'Correct'), 'Success'),
57+
(Login, ('VinniPuhh', 'Incorrect'), 'Failure'),
58+
(Logout, ('OleBrumm',)),
59+
(Login, ('OleBrumm', 'Correct'), 'Success'),
60+
(UpdateInt, ('OleBrumm', 1)),
61+
(UpdateInt, ('OleBrumm', 1)),
62+
(UpdateInt, ('OleBrumm', 2)),
63+
(Login, ('VinniPuhh', 'Correct'), 'Success'),
64+
(UpdateInt, ('OleBrumm', 1)),
65+
(Logout, ('OleBrumm',)),
66+
(Logout, ('VinniPuhh',)),
67+
],
68+
#
69+
[
70+
(Initialize, ()),
71+
(Login, ('VinniPuhh', 'Incorrect'), 'Failure'),
72+
(Login, ('OleBrumm', 'Correct'), 'Success'),
73+
(UpdateInt, ('OleBrumm', 1)),
74+
(ReadInt, ('OleBrumm',), 1),
75+
(UpdateInt, ('OleBrumm', 2)),
76+
(Login, ('VinniPuhh', 'Incorrect'), 'Failure'),
77+
(Logout, ('OleBrumm',)),
78+
(Login, ('OleBrumm', 'Correct'), 'Success'),
79+
(UpdateInt, ('OleBrumm', 1)),
80+
(Logout, ('OleBrumm',)),
81+
],
82+
#
83+
[
84+
(Initialize, ()),
85+
(Login, ('VinniPuhh', 'Incorrect'), 'Failure'),
86+
(Login, ('OleBrumm', 'Incorrect'), 'Failure'),
87+
(Login, ('VinniPuhh', 'Correct'), 'Success'),
88+
(ReadInt, ('VinniPuhh',), 0),
89+
(Login, ('OleBrumm', 'Incorrect'), 'Failure'),
90+
(UpdateInt, ('VinniPuhh', 1)),
91+
(Login, ('OleBrumm', 'Incorrect'), 'Failure'),
92+
(UpdateInt, ('VinniPuhh', 1)),
93+
(UpdateInt, ('VinniPuhh', 2)),
94+
(Logout, ('VinniPuhh',)),
95+
],
96+
]Generate a test suite with three runs
4197

4298
Show the generated test suite
4399

0 commit comments

Comments
 (0)