improve test for the -compat-32 flag#1161
Conversation
dra27
left a comment
There was a problem hiding this comment.
Thanks for this - it does indeed sort out the Windows failure.
I'd prefer using $(OCAMLC) -config | tr -d '\r' | grep "^word_size:" | sed -e "s/.*: //" to having to build a program to test the output (unfortunately you can't search for ARCH_SIXTYFOUR in m.h without first pre-processing it). At some point, I will make $(OCAMLC) -config word_size a thing!
| run: | ||
| @printf " ... testing -compat-32" | ||
| @$(OCAMLC) -compat-32 -c a.ml 2>&1 | xargs echo ${} > test.result | ||
| @$(OCAMLC) -compat-32 -c a.ml > test.result 2>&1 | true |
There was a problem hiding this comment.
|| true, rather than a pipe (and two more cases below)
| @@ -1,2 +1,2 @@ | |||
| let () = | |||
| if Sys.word_size = 64 then exit 0 else exit 1 | |||
| if Sys.int_size >= 63 then exit 0 else exit 1 | |||
There was a problem hiding this comment.
This change isn't necessary - the removal of the xargs call is sufficient for Windows. Personally the original is fine, but if it's going to be an inequality, shouldn't it be > 32?
However, I also think this is a bit too heavyweight - could you just grep the output of $(OCAMLC) -config?
There was a problem hiding this comment.
I didn't know word_size and int_size were displayed during -config - updated.
clean test for -compat-32, CR
Co-authored-by: cuihtlauac <cuihtlauac@users.noreply.github.com>
No description provided.