Skip to content

Commit d25dbef

Browse files
committed
bring several README and notes files up-to-date
README.md in bin and pymodel directories, several .txt files in notes directory bring them up to date with recently separated pymodel and bin directories
1 parent cca7349 commit d25dbef

File tree

5 files changed

+75
-66
lines changed

5 files changed

+75
-66
lines changed

bin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This directory contains the commands for PyModel.
66

77
To use PyModel, this directory must be on your execution *PATH*.
88
Or, its contents must be installed in some directory that is on your
9-
execution *PATH*.
9+
execution *PATH*. See *pymodel_paths* in this directory.
1010

1111
There are two versions of some commands. The version without a file
1212
type is a *bash* script for Unix/Linux/Mac; the version with *.bat* is

notes/commands.txt

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,72 @@
11

22
PyModel Commands
33

4-
PyModel provides three main programs:
4+
PyModel provides three main commands:
55

6-
pma.py, PyModel analyzer: generates a finite state machine (FSM)
6+
pma, PyModel analyzer: generates a finite state machine (FSM)
77
and computes properties by exploring a model program, FSM, test suite,
88
or a product of these.
99

10-
pmg.py, PyModel graphics: generates a file of graphic commands from an FSM,
10+
pmg, PyModel graphics: generates a file of graphic commands from an FSM,
1111
that can be processed by the Graphviz dot command to produce graphics
1212
files in various formats including .svg, .pdf, and .ps
1313

14-
pmt.py, PyModel tester: displays traces, generates tests offline,
14+
pmt, PyModel tester: displays traces, generates tests offline,
1515
executes offline tests, or generates and executes tests on-the-fly.
1616

1717
There is also a fourth program:
1818

19-
pmv.py, PyModel viewer: invokes pma, pmg, and the Graphiz dot command
19+
pmv, PyModel viewer: invokes pma, pmg, and the Graphiz dot command
2020
(to display the graphics generated by pmg). The pmv program
2121
provides brevity and convenience, so analysis and display can be
2222
accomplished by a single command.
2323

24+
For more about each of these programs, type the command to display its
25+
built-in help, for example: pma --help, or pma -h, or just pma (with
26+
no arguments). This will print a brief description of the program and
27+
a list of its command line options. (For convenience, this built-in
28+
help output appears in this directory in pma.txt etc.)
29+
2430
Use pma, pmg, and dot (or pmv) to visualize and preview the behavior
2531
of pmt. Every path through the graph created by pma (and drawn by
2632
pmg) is a trace (test run) that may be generated by pmt, when pma and
2733
pmt are invoked with the same arguments.
2834

2935
PyModel also provides these programs and scripts:
3036

31-
dotsvg: converts dot file output from pmg.py to SVG file that can be displaye
37+
dotsvg: converts dot file output from pmg to SVG file that can be displaye
3238
in a browser.
3339

34-
dotps: converts dot file output from pmg.py to PostScript file that can be
40+
dotps: converts dot file output from pmg to PostScript file that can be
3541
printed or displayed in PostScript viewer.
3642

37-
dotpdf: converts dot file output from pmg.py to PDF file that can be
43+
dotpdf: converts dot file output from pmg to PDF file that can be
3844
printed or displayed in a PDF viewer.
3945

4046
(The pmv command invokes one of these dot commands)
4147

42-
wsgirunner.py: runs WSGI-compliant web applications (for example
48+
wsgirunner: runs WSGI-compliant web applications (for example
4349
webapp.py in the WebApplication sample) on localhost
4450

45-
trun.py: runs sample demonstrations and scripts that test PyModel itself.
51+
trun: runs sample demonstrations and scripts that test PyModel itself.
4652

47-
clogdiff: works with trun.py to execute and check regression tests on PyModel.
53+
clogdiff: works with trun to execute and check regression tests on PyModel.
4854

49-
You can invoke the four PyModel programs on the command line or in
50-
scripts by name, without using the .py extension (pmt not pmt.py).
51-
You can also include the .py extension; many of the test scripts
52-
included in the distribution use this form.
55+
To prepare to use the programs, put the PyModel/bin directory on your
56+
execution path. Put the Pymodel/pymodel directory and the the current
57+
directory on the Python path. To achieve all this, execute the
58+
PyModel/bin/pymodel_paths command, or put the commands it contains
59+
in your .profile or .bashrc. (If you install PyModel so the commands
60+
and modules are put in some standard place, this may not be necessary.)
5361

54-
To prepare to use the programs, put the pymodel directory on your
55-
execution path. Put the current directory (whatever it is) on the
56-
PYTHONPATH by executing the tpath command ("source tpath" in bash,
57-
systems, just "tpath" in Windows).
62+
Invoke the four PyModel programs on the command line or in scripts by
63+
name, without using the .py extension (pmt not pmt.py). You can also
64+
include the .py extension (pmt.py not just pmt); some older scripts you
65+
may still have used this form. BUT to use this form, you must put
66+
PyModel/pymodel on your execution path (not just your Python path).
5867

5968
For usage examples with many combinations of options and arguments,
6069
see the test*.py test script modules in the samples directories.
6170

62-
For more about each program, type the command to display its built-in
63-
help, for example: pma --help, or pma -h, or just pma (with no
64-
arguments). This will print a brief description of the program and a
65-
list of its command line options. (For convenience, this built-in help
66-
output appears here in pma.txt etc.)
67-
6871

6972
Revised Apr 2013

notes/samples.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@ in the samples directory and in each sample subdirectory.
88

99
Each sample subdirectory contains some test script modules: test.py,
1010
test_graphics.py etc. These scripts demonstrate the samples, as well
11-
as testing PyModel itself. The file test.txt provides detailed
12-
instructions for running the scripts.
11+
as testing PyModel itself.
12+
13+
To execute test.py (etc.), type the command
14+
15+
trun test
16+
17+
For this to work, the PyModel/pymodel directory must be on your Python
18+
path, the current directory must be on your Python path, and the
19+
PyModel/bin directory must be on your execution path. To achieve all
20+
this, you can run the PyModel/pymodel/pymodel_paths command.
21+
Alternatively, if you have installed PyModel, these preliminaries may
22+
not be necessary. Just type: trun test
1323

1424
Each test script contains commented command lines that demonstrate
1525
combinations of arguments and options. Running each test script

notes/test.txt

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ using the unittest module from the Python standard library.
2626

2727
These directions apply to both Windows and Unix-like systems
2828
(including Linux and Mac OS X). The directions assume that Python is
29-
already installed and your environment is configured so you can run
30-
it (if not, see http://docs.python.org/2/using/). It also assumes
31-
that PyModel is installed and its pymodel directory (containing trun.py,
32-
pmt.py etc.) is on your execution path.
29+
already installed and your environment is configured so you can run it
30+
(if not, see http://docs.python.org/2/using/). It also assumes that
31+
PyModel is present on your system, the contents of its PyModel/pymodel
32+
directory are on your Python path, the current directory is on your
33+
Pyton path, and the contents of its PyModel/bin directory are on your
34+
execution path. You can achieve this by executing
35+
PyModel/bin/pymodel_paths, or the commands therein.
3336

3437
Quick Start
3538
Summary
@@ -41,17 +44,18 @@ Using other unit testing frameworks
4144

4245
Quick Start
4346

44-
In each subdirectory of samples, put the current directory
45-
(whatever it is) on the PYTHONPATH by executing the tpath command
46-
("source tpath" in bash, just "tpath" in Windows). Then, type:
47+
In each subdirectory of samples, type:
4748

4849
clogdiff trun test
4950

5051
if there are more test*.py files besides test.py, you can run them too:
5152

5253
clogdiff trun test_scenarios
5354

54-
etc. If messages indicate differences were found, there may be a problem.
55+
etc. If messages indicate differences were found, there may be a
56+
problem. Or maybe not (see below). If messages indicate there is no
57+
.ref file, that means the test scripts are not deterministic and this
58+
test is not meaningful.
5559

5660
Notice that we only show the command you type, we do not show the
5761
command prompt, for example usually ...> for the Windows cmd prompt
@@ -99,12 +103,11 @@ more easily coded with particular system-dependent commands (for
99103
example: setting the execution path, checking differences between
100104
files).
101105

102-
These Python programs are typically used as commands: pma.py pmg.py pmt.py
103-
pmv.py trun.py and wsgirunner.py. When used as commands, the .py
104-
suffix can be omitted. For example you can type pmt -n 10 PowerSwitch
105-
instead of pmt.py ... or trun test_graphics instead of trun.py ...
106-
Both forms work (in Windows as well as Unix-like systems), and both appear in
107-
test scripts.
106+
Invoke the four PyModel programs on the command line or in scripts by
107+
name, without using the .py extension (pmt not pmt.py). You can also
108+
include the .py extension (pmt.py not just pmt); some older scripts you
109+
may still have used this form. BUT to use this form, you must put
110+
PyModel/pymodel on your execution path (not just your Python path).
108111

109112

110113
Test scripts
@@ -122,18 +125,12 @@ Here are the contents of the script in samples/WebApplication/Model/test.py:
122125

123126
cases = [
124127
('Test: -a option includes only Initialize Action',
125-
'pmt.py -n 10 -a Initialize WebModel'),
128+
'pmt -n 10 -a Initialize WebModel'),
126129

127130
('Test: -e option excludes all Login, Logout actions',
128-
'pmt.py -n 10 -e Login_Start -e Login_Finish -e Logout WebModel'),
131+
'pmt -n 10 -e Login_Start -e Login_Finish -e Logout WebModel'),
129132
]
130133

131-
The PyModel commands in test scripts often include the .py suffix, as
132-
in pmt.py ... here. The suffix is not required, recent test scripts
133-
often use pmt ... etc. (On Unix-like systems, you must execute
134-
the symlinks command in the pymodel directory *once* after you install
135-
PyModel to enabled this).
136-
137134
The trun module takes one argument, the module name of the script (NOT
138135
the file name, there is no path prefix or .py suffix). The trun
139136
module imports the script, then iterates over the cases list, printing
@@ -144,14 +141,13 @@ contains modules to test. This command executes it:
144141

145142
trun test
146143

147-
For this command to work, the pymodel directory must be on the
148-
execution PATH. The current directory must be on the PYTHONPATH.
149-
This is necessary to enable PyModel tools (such as pmt) in the pymodel
150-
directory to import modules in the current directory. The tpath
151-
command in the pymodel directory assigns the current directory to the
152-
PYTHONPATH (use 'source tpath' in bash). It is NOT necessary to
153-
repeat the tpath command after a change directory command (cd)
154-
(checked on Mac OS X - this may differ under Windows).
144+
For this command to work, the pymodel directory must be on the Python
145+
path, and the current directory must be on the Python path. This is
146+
necessary to enable PyModel tools (such as pmt) in the pymodel
147+
directory to import modules in the current directory. The
148+
PyModel/bin/pymodel_paths command assigns these paths. It is NOT
149+
necessary to repeat the tpath command after a change directory command
150+
(cd) (checked on Mac OS X - this may differ under Windows).
155151

156152
Checking test script output
157153

@@ -230,12 +226,12 @@ in Windows like Unix >& to redirect error output also.
230226

231227
Output files
232228

233-
The PyModel pmt.py program only writes to the terminal (to stdout and
234-
stderr), but other PyModel programs write output files: pma.py writes
235-
another module (.py file) that contains the generated FSM, pmg.py
229+
The PyModel pmt command only writes to the terminal (to stdout and
230+
stderr), but other PyModel commands write output files: pma writes
231+
another module (.py file) that contains the generated FSM, pmg
236232
writes a .dot file with commands for the Graphviz dot program, and the
237233
various dot commands (dotsvg etc.) write graphics files: .svg, .pdf,
238-
.ps etc. The pmv.py program invokes all of these programs causes all
234+
.ps etc. The pmv program invokes all of these programs causes all
239235
of these files to be written.
240236

241237
The PyModel programs write all of these output files in the current
@@ -245,7 +241,7 @@ overwitten). In the PyModel distribution, we provide copies of some
245241
of the output files we made (on our development system) so you can
246242
compare them to yours (that you generate when you repeat the tests on
247243
your system). In some samples directories, there may be an fsmpy
248-
directory which contains FSM modules written by pma.py, and there may
244+
directory which contains FSM modules written by pma, and there may
249245
be an svg or pdf directory which contains .svg files written by pma +
250246
pmg + dot (or pmv). You may wish to copy output files that you
251247
generate into these directories, so you can compare them to output
@@ -272,8 +268,8 @@ The popular unit test frameworks are not so well-suited for this kind
272268
of test. However, you can use one of the popular frameworks if you
273269
prefer, as an alterative to our trun command and our test scripts.
274270
There is an example in the samples/populations directory. The module
275-
test_populations.py there works with unittest to run the same tests
276-
as in tests.py. That is, instead of
271+
test_populations there works with unittest to run the same tests
272+
as in tests. That is, instead of
277273

278274
trun tests # test with our homemade framework
279275

pymodel/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This directory contains the Python modules for PyModel.
77
To use PyModel, this directory must be on your Python path.
88
The usual way to achieve this is to add it to your *PYTHONPATH*. Or, its
99
contents must be installed in some directory that is on your Python
10-
path.
10+
path. See *pymodel_paths* in the *bin* directory.
1111

1212
This directory does not need not be on your execution *PATH*, because
1313
its modules are usually invoked through the commands in the PyModel

0 commit comments

Comments
 (0)