179 Commits

Author SHA1 Message Date
Johan Holmberg
dc4ab527de test that readonly directory give error
ie. when cmdtest fails to remove the "work"
directory between test methods. Previously
cmdtest relied on FileUtils.rm_rf, but it could
fail silently, leading to weird consequences.
2016-06-04 20:49:59 +02:00
Johan Holmberg
75ea993a54 change FileUtils.rm_rf -> Util.rm_rf
since the one in FileUtils is broken, or at least does not
work like the command "rm -rf". A post condition should be that
the directory does not exist OR an exception is thrown at failure.
2016-06-03 21:03:12 +02:00
Johan Holmberg
43072aecec remove extra ORIG_CWD
just keep Cmdtest::ORIG_CWD
2016-06-03 20:29:02 +02:00
Johan Holmberg
3ea3d852aa chdir to ORIG_CWD after each test method
so current directory is outside the temporary tree
when it is cleaned between test methods.
2016-06-03 20:02:08 +02:00
Johan Holmberg
9117bc2e60 sort methods/files
for more deterministic behaviour
2016-06-03 11:17:18 +02:00
Johan Holmberg
122d2b3326 update copyright year -> 2016 2016-04-14 20:25:21 +02:00
Johan Holmberg
0ad8daec68 update HTML User Guide 2016-04-14 20:10:04 +02:00
Johan Holmberg
bbf4b92b1d introduce 'import_directory' 2016-04-14 19:56:38 +02:00
Johan Holmberg
393a92ae33 require file argument to 'import_file' + test 2016-04-14 19:54:50 +02:00
Johan Holmberg
3baa2c5133 minimal test of 'cmdtest.py' used as module 2016-01-07 19:22:28 +01:00
Johan Holmberg
a343141f30 set __file__ in CMDTEST_*.py files 2016-01-07 19:19:43 +01:00
Johan Holmberg
cdd38dd5a3 add rake file with 'test' task 2016-01-06 20:58:47 +01:00
Johan Holmberg
a65f019e51 add tests of 'cmdtest.py' in t/ subdir 2016-01-06 20:55:53 +01:00
Johan Holmberg
f0e6f5c281 add --quiet option
to make writing unit tests of 'cmdtest.py' itself easier
2016-01-06 20:54:53 +01:00
Johan Holmberg
2d37244714 add 'always_ignore_file' 2016-01-06 20:47:40 +01:00
Johan Holmberg
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
Johan Holmberg
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
Johan Holmberg
07ac9b72ee flatten list argument to 'create_file' 2016-01-06 20:26:30 +01:00
Johan Holmberg
73d53c1f20 add .gitignore 2016-01-05 19:10:02 +01:00
Johan Holmberg
e9ff28c74a add idea for yaml based version of cmdtest 2016-01-05 19:10:02 +01:00
Johan Holmberg
71a74c00ef add CMDTEST file verifying doc example 2016-01-05 19:10:02 +01:00
Johan Holmberg
4cbba1cba1 add file used in tests of 'cmdtest' 2016-01-05 19:10:02 +01:00
Johan Holmberg
3ddfd85791 first attempt writing a Ruby "gemspec" 2016-01-05 19:10:02 +01:00
Johan Holmberg
d8379148e7 simple test usage of 'argumentparser.rb' 2016-01-05 19:10:02 +01:00
Johan Holmberg
c241d760a4 Merged in hth313/cmdtest (pull request #1)
Additions to Python version
2016-01-05 19:03:33 +01:00
Håkan Thörngren
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
Håkan Thörngren
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
Håkan Thörngren
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
Håkan Thörngren
f4754a10fd Corrected name of program and spelling. 2015-11-19 14:52:26 -08:00
Johan Holmberg
53b4869de9 update documenation 2015-08-26 22:11:20 +02:00
Johan Holmberg
c025d22a14 move code to Runner subclasses 2015-08-17 23:53:49 +02:00
Johan Holmberg
2bb93b9536 add test with no errors; test exit code too 2015-08-17 23:37:50 +02:00
Johan Holmberg
5021972318 first version using parallel(1)
to implement -jN option to cmdtest.
may need some cleanup/refactoring.
2015-08-17 23:03:42 +02:00
Johan Holmberg
225983f813 refactor: remove 'run' methods
instead loop over test-files/classes/methods outside
of the "administrative" classes. In preparation for
a new way of implementing --parallel support with
the external command GNU Parallel.
2015-08-08 23:43:06 +02:00
Johan Holmberg
1ee1533ab2 fix "ruby -w" warnings 2015-08-08 23:42:14 +02:00
Johan Holmberg
b82c90232c refactor, 'tmp_dir',... -> Runner class
the methods 'tmp_dir', 'tmp_work_dir' and 'tmp_cmdtest_dir'
are needed in 'cmdtest.rb' too, so moving them to the
Runner class.
2015-08-08 00:26:17 +02:00
Johan Holmberg
c03de8c577 make --test work again
need to convert Symbol -> String before compare
2015-08-06 22:39:08 +02:00
Johan Holmberg
13b284ef8c use new "argumentparser.rb"
modelled after "argparse" in Python
2015-08-06 22:33:48 +02:00
Johan Holmberg
b9c716a80e basic tests of 'cmdtest' command line options 2015-08-04 23:32:20 +02:00
Johan Holmberg
2e58c4a76a ignore_file can be a Regexp, forgotten in d5f29a8
this caused a regression in d5f29a8,
that should be fixed by the current commit.
2015-08-04 10:46:23 +02:00
Johan Holmberg
651b613ba0 remove parallel-, revive incremental-support 2015-08-04 10:29:25 +02:00
Johan Holmberg
1765eda504 add 'cmd_cmdtest_verbose' in 'SelftestUtils' 2015-07-29 13:38:12 +02:00
Johan Holmberg
df78fc17d6 test of summary line 2015-07-29 13:38:12 +02:00
Johan Holmberg
d5f29a821c ignore_file accepts shell glob (*, **)
+ test of this new behaviour
2015-07-29 13:32:04 +02:00
Johan Holmberg
d3d884a2f1 minimal 'files_equal'
the reporting at error should be improved
2015-07-01 08:34:52 +02:00
Johan Holmberg
15c06bab11 add 'transcode_file' helper method 2015-06-17 22:32:07 +02:00
Johan Holmberg
ce6fed5947 add statistics and exit code 2015-06-17 00:48:34 +02:00
Johan Holmberg
dcf4ce246b wait file mtime delta before new cmd
to make it possible ot detect written files
2015-06-17 00:16:07 +02:00
Johan Holmberg
96b8f3a42f minimal ARGV parsing, similar to Ruby-version 2015-06-16 19:56:20 +02:00
Johan Holmberg
6faf657da0 use os.pathsep instead of ':' 2015-06-16 19:33:46 +02:00