File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
test/blackbox-tests/test-cases/test-build-if Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -13,20 +13,34 @@ the test runs as part of @runtest
13
13
> (enabled_if % {env: ENABLED= false}))
14
14
> EOF
15
15
16
- $ touch t. ml
16
+ $ compiled_flag= " t compiled"
17
+ $ ran_flag= " t ran"
18
+
19
+ $ cat > t. ml << EOF
20
+ > module T : sig
21
+ > val message : string
22
+ > [@@ alert message " $ compiled_flag" ]
23
+ > end = struct
24
+ > let message = " $ ran_flag"
25
+ > end
26
+ >
27
+ > let () =
28
+ > Printf. printf " % s" T. message
29
+ > ;;
30
+ > EOF
17
31
18
32
We test the various combinations:
19
33
20
34
$ test_one () {
21
35
> dune clean
22
- > output= $ ( dune build " $1" -- display short 2 > &1 )
36
+ > output= $ ( dune build " $1" 2 > &1 )
23
37
> echo When building $1 with ENABLED= $ {ENABLED: -unset}:
24
- > if echo $ output | grep -q ocamlopt ; then
38
+ > if echo $ output | grep -q " $ compiled_flag " ; then
25
39
> echo ' build was done: YES'
26
40
> else
27
41
> echo ' build was done: NO'
28
42
> fi
29
- > if echo $ output | grep -q " alias t " ; then
43
+ > if echo $ output | grep -q " $ ran_flag " ; then
30
44
> echo ' test did run: YES'
31
45
> else
32
46
> echo ' test did run: NO'
You can’t perform that action at this time.
0 commit comments