-
Notifications
You must be signed in to change notification settings - Fork 410
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
Compile flags #3679
Compile flags #3679
Changes from all commits
be1c448
e4fb2a8
a066c48
ab0e7e2
ddb5b1e
403dd19
897a8fa
5e204ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(library | ||
(name compile_flags_test) | ||
(inline_tests | ||
(backend foo) | ||
(compile_flags -bar))) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(lang dune 2.7) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
open Printf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this should be part of the PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true, it should not be part of it @shonfeder, am not so certain why such git history reflects in here, I have done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd either rebase just the relevant changes onto master or create a fresh branch off of master and just cherry pick in the relevant commits from here. |
||
open List | ||
|
||
let process_line = | ||
let path_re = Str.regexp {|^\([SB]\) /.+/lib/\(.+\)$|} in | ||
|
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.
I'm not %100 sure what the best way to test this will be, but I think something like the following might work:
inline_tests
directory called something like/compiler-flags.t/run.t
Do you have any thoughts for a more elegant test set up @jeremiedimino?
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.
That seems about right. You could also pass a flag that you are sure the compiler doesn't accept and observe the compilation failure.
BTW, the above test is using the
OCAMLPATH
trick to test that inline test backends work even when installed on the system. But since we already tested that, we don't need to use this method again and we can instead use a locally defined backend. So the shell command could just be:dune runtest dune-file-compile-flags
.