-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite re2c tests runner in Python #360
Conversation
Yes you are right. This is exactly what I decided at the very beginning. However, this doesn't work for some reason: Right now I tried: diff --git a/run_tests.py b/run_tests.py
index 9c93e4a9..2551e9ee 100644
--- a/run_tests.py
+++ b/run_tests.py
@@ -539,7 +539,8 @@ def init_process(base_path, skeleton=False, keep_temp_files=False,
# abshere('@top_srcdir@', 'include')
# vs
# abshere('..', '@top_srcdir@', 'include')
- _ctx.incpaths.append(f"-I {abshere(base_path, 'include')}")
+ _ctx.incpaths.append("-I /Users/egrep/work/re2c/include")
+ _ctx.incpaths.append("-I ../include")
# Set tools paths
_ctx.diff = which('diff')[0] And output is still the same: $ python run_tests.py --keep-temp-files
-----------------
All: 1615
Ran: 1615
Passed: 1611
Soft errors: 0
Hard errors: 4
-----------------
FAILED |
@skvadrik Can you please commit your patch with the fix of the two tests? I may be missing something |
Thanks a lot for working on this! One thing off the top of my head is that skeleton test failures can be deceptive: if re2c fails with an error, it is counted as a "soft error" because we have some tests that deliberately fail. Currently I see 222 soft failures in run_tests.py and 221 for run_tests.sh. The one extra error will likely go away after fixing non-skeleton tests, but the whole "soft error" concept is very weak and I added it as a temporary hack to monitor how many tests actually run and how many fail before that. |
I think I know what it is, it should be two separate arguments |
Yeah, I saw this yesterday, but for now I decided to focus on non-skeleton tests. |
Yay! I spent about 8 hours on this! You're Chuck Norris :) |
I'm used to spending 8h a day on things like this (most of my working day really), so no wonder I could spot it. :D |
Yay! diff --git a/run_tests.py b/run_tests.py
index 8b84fa3d..ecd8ae57 100644
--- a/run_tests.py
+++ b/run_tests.py
@@ -532,7 +532,8 @@ def init_process(base_path, skeleton=False, keep_temp_files=False,
# Set include paths, relative to build directory
cwd = os.getcwd()
os.chdir(_ctx.base_path)
- _ctx.incpaths = [f'-I {d}' for d in Path('.').rglob('*') if os.path.isdir(d)]
+ paths = Path('.').rglob('*')
+ _ctx.incpaths = sum([['-I', str(d)] for d in paths if os.path.isdir(d)], [])
os.chdir(cwd)
# TODO: Fix this to sort out with absolute and relative paths + @top_srcdir@ -----------------
All: 1615
Ran: 1615
Passed: 1615
Soft errors: 0
Hard errors: 0
----------------- Explanation list1 = ['111', '222', '333']
sum([['-I', item] for item in list1], [])
# Out: ['-I', '111', '-I', '222', '-I', '333'] |
@skvadrik I updated the description of the PR. All tests are passed now. |
\o/ |
981ed52
to
57f7faf
Compare
ca802e9
to
3421d53
Compare
It is ready to review |
Awesome, thanks! I may be unable to review it today, but I'll do it at the first opportunity. |
34949a4
to
3421d53
Compare
There are some issues with external tools on Windows. I'll try to sort out in next PRs to not mix changes in this one |
801f248
to
d045ef2
Compare
Some good (or bad) news: I managed to run tests runner under Windows. And I see half of the tests are failed. On the one hand, this is bad news, but on the other hand, we did not have the opportunity to run native compilation (not Mingw) and tests under WIndows until this moment. So now we see the real picture |
Can you start a new bug and post detail how the tests failed? E.g. upload the temporary test directory as an archive. |
Sure. Let me some time to sort out with unstable test runner under the Windows (some regex compilation issues under the loops) |
I fixed tests runner to run under the Windows. There were some funny bugs like Windows directory separator
I'll open a new PR with all necessary changes and show you all the remaining issues. But lets do it after this one will be merged so that I can rebase onto the proper branch and open a PR. |
9962628
to
cd433e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for doing this work! I don't know python very well, and to me the code looks nice and clean (much better than bash!). There is a couple of things to fix, but largely it just works. \o/
By the way, the new script is already ~2x faster than the old one (maybe more). :) |
fcf8e13
to
62733a6
Compare
This pull request introduces a completely rewritten test runner in Python. The main goals of this change: - Provide a OS-independent way to run tests (at least using CMake) - Getting rid of dependence on Unix utilities in tests (grep, cat, tr, etc.) - Flexibility - Ease of maintenance
62733a6
to
7600c33
Compare
@skvadrik It is ready to merge now. |
Great, I have just merged it! \o/ |
Yay! I'm glad this finally happened :) |
This pull request introduces a completely rewritten test runner in Python.
The main goals of this change: