@@ -9,8 +9,8 @@ distribution, including the tests of all the samples. These scripts
99demonstrate the samples, as well as testing PyModel itself.
1010
1111These notes describe our unit tests, along with our little homemade
12- unit testing commands: trun, tdiff, and tclean. These commands are
13- independent of the rest of PyModel (they could be used to test any
12+ unit testing commands: tpath, trun, tdiff, and tclean. These commands
13+ are independent of the rest of PyModel (they could be used to test any
1414program that writes to stdout). We use these (instead of a
1515conventional unit test framework like unittest or nose) because:
1616
@@ -24,25 +24,34 @@ conventional unit test framework like unittest or nose) because:
2424The last section (below) explains how to script tests similar to ours
2525using the unittest module from the Python standard library.
2626
27- These directions apply to both Windows and Unix-like systems
28- (including Linux and Mac OS X). The directions assume that Python is
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.
36-
37- Quick Start
38- Summary
27+ Prerequisites
28+ Running tests
29+ Command summary
3930Commands and modules
4031Test scripts
4132Checking test script output
4233Output files
4334Using other unit testing frameworks
4435
45- Quick Start
36+
37+ Prerequisites
38+
39+ These directions apply to both Windows and Unix-like systems
40+ (including Linux and Mac OS X). The directions assume that Python is
41+ already installed and your environment is configured so you can run it
42+ (if not, see http://docs.python.org/2/using/). It also assumes that
43+ the upacked PyModel directories are present on your system, the
44+ contents of its PyModel/pymodel directory are on your Python path, the
45+ contents of its PyModel/bin directory are on your execution path, and
46+ your current directory is on your Python path. You can achieve this
47+ by executing PyModel/bin/pymodel_paths, or the commands therein.
48+ Alternatively, you can install the contents of PyModel/pymodel and
49+ PyModel/bin into system directories (see INSTALL.txt) but then you may
50+ need to execute the command "source tpath" in each session (terminal
51+ window) before you execute any PyModel commands.
52+
53+
54+ Running tests
4655
4756In each subdirectory of samples, type:
4857
@@ -59,11 +68,13 @@ script is not deterministic and the tdiff command is not meaningful
5968-- instead just run trun test (or whatever).
6069
6170
62- Summary
71+ Command Summary
6372
6473commands in bin directory
65- trun - execute test script module
66- tdiff - execute test script, compare output to reference
74+ tpath - put current directory on PYTHONPATH, needed by trun
75+ tpath.bat - ditto, batch script for Windows
76+ trun - execute test script module named in argument
77+ tdiff - execute command (usually trun ...), compare output to reference
6778 tdiff.bat - ditto, batch script for Windows
6879 tclean - remove output files created by running test scripts
6980 tclean.bat - ditto, batch script for Windows
@@ -76,6 +87,7 @@ Programs and scripts in the pymodel directory
7687 trun.py - executes test script module given as argument
7788
7889In each model directory: samples/PowerSwitch, samples/WebApplication/Model,...
90+
7991 test.py - test script module, executed by trun
8092 test.log - most recent output from test.py, including stdout and stderr,
8193 saved by tdiff
@@ -89,6 +101,7 @@ In each model directory: samples/PowerSwitch, samples/WebApplication/Model,...
89101 dot scripts (maybe via pmv.py), moved here by hand
90102 pdf/ - ditto, .pdf (not many of these), moved here by hand
91103
104+
92105Programs, Modules, and Commands
93106
94107In these notes, "the foo module" or "the foo program" means the Python
@@ -222,6 +235,7 @@ If a test case crashes (raises an unhandled exception) on Windows, the
222235traceback goes to the screen, not the log file. I can't find anything
223236in Windows like Unix >& to redirect error output also.
224237
238+
225239Output files
226240
227241The PyModel pmt command only writes to the terminal (to stdout and
0 commit comments