skvadrik/re2c

Tests runner does not work with '--keep-temp-file' option

Closed this issue · 8 comments

Hello,

I recently started working on tests runner in Python (see #331 (comment)). Today I wanted to check that I handle --keep-temp-file option correctly. So I ran the original run_tests.sh script to see how it works. Unfortunately I found it was not working:

$ ./run_tests.sh --keep-temp-file
Running in 8 thread(s)
cp: illegal option -- -
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
find: *: No such file or directory
find: test_210615102401: No such file or directory
-----------------
All:         0
Ran:         0
Passed:      0
Soft errors: 0
Hard errors: 0
-----------------
PASSED

Everything works like a charm without --keep-temp-file option. Here is some info about my environment:

$ bash --version
GNU bash, version 5.1.8(1)-release (aarch64-apple-darwin20.4.0)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ cp --version
cp (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering.

I used to branch this commit: 4a89dc2 and I have not changed run_tests.sh file on my branch. Let me know if I can provide more info or step by step steps to reproduce .

I recently started working on tests runner in Python (see #331 (comment)).

\o/

I removed --keep-tmp-files option some time ago (in ec9eecd) because it was never used in practice, but I forgot to remove its description. Done now: f710983.

I removed --keep-tmp-files option some time ago (in ec9eecd) because it was never used in practice, but I forgot to remove its description.

Oh, right now I needed it to catch the bug :D Ok, at least I don't have to implement this in Python. Thank you for the quick fix.

If it's useful, you can restore it by all means. :) Just revert those two commits.

I said it's not useful because when a test fails, it automatically keeps temporary files. And keeping files for tests that passed is normally not required.

But it's useful for debugging test runner itself :)

Yes, sure! Let's restore it.

Here it is (restored): 5de6ae6.

Thank you!