-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix testsuite 8 on Windows/MSYS2 #128
Conversation
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.
Thank you for tackling this.
Adjusting a "known format" is reasonable here (but at least above the first one: please add a note about the MSYS behavior of calling with full-path, which we need to remove here.
The replacement with [[^[:cntrl:]]]
needs an adjustment, that won't work on AIX or Solaris outside of gsed.
You suggested two solutions :
Which one do you like most ? |
I don't mind. If we do use awk for that in the testsuite then this may be better (note: I haven't checked the portability of that and if it works!), otherwise I'd opt for the "more simple sed". |
f232f15
to
e506ac9
Compare
I went for the simpler |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## gcos4gnucobol-3.x #128 +/- ##
=====================================================
- Coverage 65.86% 65.86% -0.01%
=====================================================
Files 32 32
Lines 59481 59481
Branches 15708 15708
=====================================================
- Hits 39178 39176 -2
- Misses 14282 14284 +2
Partials 6021 6021 ☔ View full report in Codecov by Sentry. |
There are two generated Makefiles added in this PR, those should be dropped. The changes in run_misc.at are ready for svn, not sure about the other as we explicit adjust variables to let the C compiler work fine, and this call is dropped by |
Indeed, I guess I committed too quickly.
Well, GCC seems to expect TMPDIR to point to some valid location. Under those circumstances, shouldn't an invalid TMPDIR be considered as an error instead of a mere warning ? |
At least with my installation setting |
Using GCC 13.2 under MSYS2/UCRT, seems it in fact only considers the |
If I'm OK in general to adjust GnuCOBOL's behavior but a broken TMPDIR, but I'm not sure if aborting in common.c would be good... Note that the real issue is that the changed variable is not correctly exported, this can break a bunch of things for other tests (in the future), too. Ideally we can tell the runtime environment (which seems to be some MSYS here) to correctly export this variable (and in the future: others). |
I'm not sure to understand. To you suggest this is a bug in the MSYS shell ? |
"Not a bug but a feature" - several environment variables are converted between Windows and Posix path, some are just not taken over (and it seems that some variables will have the values which they had when the MSYS process was started). Environment variables are also related C runtime used; when it "switches" you may see "old" values; though this is mostly an issue within a single process, calling a new one normally provides a "clear start". Given that - I'm not sure how this should be tackled - as noted an error may be fine, but in this case cobc would have to pass the instruction "abort on error" (maybe a separate entry function?) when getting the path by libcob (or duplicate that code into cobc and adjust it there). |
e506ac9
to
3327e68
Compare
@GitMensch Should I merge into svn the fixes for tests 808/809 ( |
If that's not too much to ask: yes, please do, this should get the false positives down to one.
Thank you!
|
Done ! |
Can you please rebase and adjust the title? |
3327e68
to
b951376
Compare
That's been done. |
AT_CHECK([$COMPILE prog.cob], [0], [], []) | ||
AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [OK], []) |
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.
The only point of testing the execution was to verify that this does work - without the recompile, because we adjust the broken environment before calling the C compiler.
The goal is good, but if we don't find a way to ensure that cobc's setenv
reaches the program envrionment of the called C compiler, I'd rather let this fail "from time to time" instead of globally accepting a failure here.
I'd suggest to move this to a draft until someone finds the way to tweak this "correctly" (I guess that means setting some environment variable; it would likely be reasonable to ask the MSYS2 folks (possibly by creating an issue in their tracker - if this happens under MSYS2).
EDIT: fixes for 808 and 809 already merged
This fixes tests number 8, 808 and 809 on Windows with MSYS2.
Test 8 fails randomly during the call to gcc, as it tries to access the temporary directory.
Since the objective of this test is to check the compilation behavior when tweaking TMP/TEMP/TMPDIR, I resorted to a workaround: I simply replaced $COMPILE by $COMPILE_ONLY.
As for tests 808 and 809, they fail because of differences in the way paths are shown on Windows VS Unix. Since the expected output uses relative Unix-style paths, I used sed to pre-process the output to remove any absolue Windows-style prefix and replace them with ./.
The only remaining failing test, 771, is a bit more tricky ; it will be handled separately.