Skip to content

Commit

Permalink
Sanitize tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ulysse Gérard <[email protected]>
  • Loading branch information
voodoos committed Oct 21, 2020
1 parent 6516ab6 commit 295fc6c
Showing 1 changed file with 15 additions and 53 deletions.
68 changes: 15 additions & 53 deletions test/blackbox-tests/test-cases/cxx-flags.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,15 @@
> (lang dune 2.8)
> EOF

$ GCCF="-x c++ -lstdc++ -shared-libgcc"
$ ClangF="-x c++"
$ MsvcF="/TP"

Default: add_cxx_flags = false
$ dune rules baz.o | sed -n -e '/(action/,$p' |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
(action
(chdir
_build/default
(run
/usr/bin/cc
-O2
-fno-strict-aliasing
-fwrapv
-g
-I
OPAM_PREFIX/lib/ocaml
-o
baz.o
-c
baz.cpp))))
$ dune rules baz.o | tr -s '\n' ' ' |
> grep -ce "$GCCF\|$ClangF|$MsvcF"
0
[1]


With add_cxx_flags = false
Expand All @@ -28,49 +19,20 @@ With add_cxx_flags = false
> (new_foreign_flags_handling false)
> EOF

$ dune rules baz.o | sed -n -e '/(action/,$p' |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
(action
(chdir
_build/default
(run
/usr/bin/cc
-O2
-fno-strict-aliasing
-fwrapv
-g
-I
OPAM_PREFIX/lib/ocaml
-o
baz.o
-c
baz.cpp))))
$ dune rules baz.o | tr -s '\n' ' ' |
> grep -ce "$GCCF\|$ClangF|$MsvcF"
0
[1]

With add_cxx_flags = true
$ cat >dune-project <<EOF
> (lang dune 2.8)
> (new_foreign_flags_handling true)
> EOF

$ dune rules baz.o | sed -n -e '/(action/,$p' |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
(action
(chdir
_build/default
(run
/usr/bin/cc
-x
c++
-O2
-fno-strict-aliasing
-fwrapv
-g
-I
OPAM_PREFIX/lib/ocaml
-o
baz.o
-c
baz.cpp))))
$ dune rules baz.o | tr -s '\n' ' ' |
> grep -ce "$GCCF\|$ClangF|$MsvcF"
1

$ dune exec ./main.exe
2046

0 comments on commit 295fc6c

Please sign in to comment.