Commit Graph

31 Commits

Author SHA1 Message Date
fe5dbe704e Allow specifying tests with 'cmdtest_in_dir'
The entry point 'cmdtest_in_dir' now accepts and passes on arguments
that optionally specifies which tests to be run. This can be done on file
level, class level and method level.

As the list of optional named arguments is quite long, they are now
keyword arguments.
2016-12-13 09:45:53 -08:00
991db268b2 Use keyword-only argument 2016-10-13 12:52:22 -07:00
d1c5da0b21 Merge holmberg556/cmdtest into master 2016-10-13 11:35:37 -07:00
d8121b1d5e Allow timeout on test cases
Certain commands are likely to fail to terminate in case something goes
wrong. Having the ability to force such commands to terminate after a
certain time is useful.
2016-10-13 11:20:32 -07:00
3baa2c5133 minimal test of 'cmdtest.py' used as module 2016-01-07 19:22:28 +01:00
a343141f30 set __file__ in CMDTEST_*.py files 2016-01-07 19:19:43 +01:00
cdd38dd5a3 add rake file with 'test' task 2016-01-06 20:58:47 +01:00
a65f019e51 add tests of 'cmdtest.py' in t/ subdir 2016-01-06 20:55:53 +01:00
f0e6f5c281 add --quiet option
to make writing unit tests of 'cmdtest.py' itself easier
2016-01-06 20:54:53 +01:00
2d37244714 add 'always_ignore_file' 2016-01-06 20:47:40 +01:00
dad35dd311 accept directory command line argument
then all CMDTEST_*.py files in the directory will be added
2016-01-06 20:33:08 +01:00
633b184c6a modify sys.path during exec() call
so a CMDTEST_*.py file can import files from the same directory
2016-01-06 20:29:43 +01:00
07ac9b72ee flatten list argument to 'create_file' 2016-01-06 20:26:30 +01:00
5075c7b38b Combine class and method name when saving work dir
In the Python version when saving the work directory for a failed test
case, create a path based on both the class and method name.
2016-01-03 19:53:00 -08:00
af28746648 Preserve files for failed tests.
In the Python version, preserve the work directory in
work-save/class_name to make it possible to examine it
afterwards. Before running tests, remove the entire old work-save
directory hierarchy to ensure we only leave those behind that actually
are relevant.
2016-01-02 20:14:27 -08:00
f486a15f66 Allow Python cmdtest to be used as a library.
Added cmdtest_in_dir(path) to allow Python cmdtest to be used as part of
another Python script. Factored out most of the functionality from
main() to the common function test_files().
2015-12-09 20:49:13 -08:00
f4754a10fd Corrected name of program and spelling. 2015-11-19 14:52:26 -08:00
d3d884a2f1 minimal 'files_equal'
the reporting at error should be improved
2015-07-01 08:34:52 +02:00
15c06bab11 add 'transcode_file' helper method 2015-06-17 22:32:07 +02:00
ce6fed5947 add statistics and exit code 2015-06-17 00:48:34 +02:00
dcf4ce246b wait file mtime delta before new cmd
to make it possible ot detect written files
2015-06-17 00:16:07 +02:00
96b8f3a42f minimal ARGV parsing, similar to Ruby-version 2015-06-16 19:56:20 +02:00
6faf657da0 use os.pathsep instead of ':' 2015-06-16 19:33:46 +02:00
e1bdc5b403 try to use 'win_unicode_console' on Windows 2015-06-15 23:28:21 +02:00
a72025c385 'file_match' now handles multi line patterns 2015-06-15 23:15:23 +02:00
58260c5a21 add 'file_equal' and 'file_match' 2015-06-15 22:35:06 +02:00
4d1fdabb55 improve handling of newline on Windows 2015-06-15 22:17:55 +02:00
35c6425a44 implement 'stderr_match' like 'stdout_match' 2015-06-15 22:17:55 +02:00
79be5a3a87 change relative paths in example code 2015-06-15 22:17:40 +02:00
4805d50e05 use 'utf-8' reading 'CMDTEST_*.py' 2015-06-15 21:48:52 +02:00
82d49d40b9 finally add 'cmdtest.py'
even if it is unfinished, and not as functional
as the Ruby version.
2015-06-15 00:54:03 +02:00