Skip to content
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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/testsuite.src/used_binaries.at
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,16 @@ AT_DATA([prog.cob], [
EXIT PROGRAM.
])

AT_CHECK([TMPDIR="" TMP="notthere" TEMP="" $COMPILE prog.cob], [0], [],
ddeclerck marked this conversation as resolved.
Show resolved Hide resolved
# Note: on Windows, GCC/MinGW randomly fails when it can't access the temporary directory,
# so we only perform the COBOL-to-C translation. This is sufficient since the error we want
# to check is a compile-time error. Note that we nevertheless perform a full compilation
# afterwards, without tweaking the temporary, so that we can test the actual execution.
AT_CHECK([TMPDIR="" TMP="notthere" TEMP="" $COMPILE_ONLY prog.cob], [0], [],
[libcob: warning: Temporary directory TMP is invalid, adjust TMPDIR!
])
AT_CHECK([$COMPILE prog.cob], [0], [], [])
AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [OK], [])
Comment on lines +406 to 407
Copy link
Collaborator

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).

AT_CHECK([TMPDIR="" TMP="" TEMP="./prog.cob" $COMPILE prog.cob], [0], [],
AT_CHECK([TMPDIR="" TMP="" TEMP="./prog.cob" $COMPILE_ONLY prog.cob], [0], [],
[libcob: warning: Temporary directory TEMP is invalid, adjust TMPDIR!
])
# TMPDIR is only checked when actually needed which is currently only the case
Expand Down
Loading