Skip to content

Commit a0da67c

Browse files
committed
add commands tdiff and tclean
tdiff is the new name for clogdiff (which is retained but now deprecated) trun is revised, add tdiff and tclean to MANIFEST.in and bin/README.md too revisions still needed in notes/test.txt etc.
1 parent 88c3353 commit a0da67c

File tree

8 files changed

+23
-39
lines changed

8 files changed

+23
-39
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ recursive-include notes *.txt *.rst *.md
33
recursive-include talks *.txt *.rst *.md *.pdf
44
recursive-include www *.txt *.rst *.md *.html
55
recursive-include pymodel *.txt *.rst *.md *.py
6-
recursive-include bin *.txt *.rst *.md *.bat clogdiff dotpdf dotps dotsvg pma pmg pmt pmv pymodel_paths tpath trun wsgirunner
6+
recursive-include bin *.txt *.rst *.md *.bat clogdiff tdiff tclean dotpdf dotps dotsvg pma pmg pmt pmv pymodel_paths tpath trun wsgirunner
77
recursive-include samples *.txt *.rst *.md *.bat *.py *.ref *.svg *.pdf
88

bin/README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ The commands are:
2727
- *trun*: runs test scripts, including sample demonstrations. See
2828
*test.txt* in the *notes* directory.
2929

30-
- *clogdiff*: works with *trun* to execute and check
30+
- *tdiff*: works with *trun* to execute and check
3131
regression tests. See *test.txt* in the *notes* directory.
3232

33+
- *tclean*: remove files created by running test scripts. See
34+
*test.txt* in the *notes* directory.
35+
36+
- *clogdiff*: same as *tdiff*, used in versions before 1.0,
37+
deprecated, retained for backward compatibility
38+
3339
- *wsgirunner*: runs WSGI-compliant web applications on *localhost*,
3440
such as *webapp* in the *WebApplication* sample, or *wsgidemo* here.
3541

bin/tclean

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# remove files created by running pymodel test scripts
2+
rm *FSM.py *FSM?.py *.dot *.svg *.pyc *.log

bin/tclean.bat

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rem remove files created by running pymodel test scripts
2+
rm *FSM.py *FSM?.py *.dot *.svg *.pyc *.log

bin/tdiff

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
$1 $2 >& $2.log
3+
diff -b $2.log $2.ref

bin/tdiff.bat

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
rem Run command %1 with arg %2, save output in log, compare to reference log
3+
%1 %2 > %2.log
4+
fc %2.log %2.ref

bin/trun

+4-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
#!/usr/bin/env python
2+
"""
3+
This is trun command in bin directory, runs trun.py module in pymodel directory
4+
"""
25

3-
import sys
4-
import os
5-
6-
# argv[1] is name of module containing test cases
7-
# dir containing this module must be on PYTHONPATH
8-
9-
test = __import__(sys.argv[1])
10-
11-
# Test cases are in 'cases', a list of pairs of strings, descrip. and commmand:
12-
# cases = [
13-
# ('Test PowerOn, PowerOff alternate due to enabling conditions',
14-
# 'pct.py -n 10 PowerSwitch'),
15-
# ... ]
16-
17-
for (description, cmd) in test.cases:
18-
print description
19-
os.system(cmd)
20-
print
6+
import trun # find and execute trun.py anywhere on Python path

samples/WebApplication/aaareadme.txt

-19
This file was deleted.

0 commit comments

Comments
 (0)