@@ -8,8 +8,16 @@ Test that targets aren't re-promoted if they are up to date.
88 > (action (with-stdout-to promoted (echo " Hello, world!" ))))
99 > EOF
1010
11- $ dune build promoted --verbose 2 >&1 | grep "Promoting "
12- Promoting "_build /default /promoted " to "promoted "
11+ $ showPromotions () {
12+ > jq '.[] | select(.name == "promote") | .args' trace. json
13+ > }
14+
15+ $ dune build promoted -- trace-file trace . json
16+ $ showPromotions
17+ {
18+ " src" : " _build/default/promoted" ,
19+ " dst" : " promoted"
20+ }
1321 $ cat promoted
1422 Hello, world!
1523
@@ -23,8 +31,12 @@ Dune doesn't promote the file again if it's unchanged.
2331Dune does promotes the file again if it's changed.
2432
2533 $ echo hi > promoted
26- $ dune build promoted --verbose 2 >&1 | grep "Promoting "
27- Promoting "_build /default /promoted " to "promoted "
34+ $ dune build promoted -- trace-file trace . json
35+ $ showPromotions
36+ {
37+ " src" : " _build/default/promoted" ,
38+ " dst" : " promoted"
39+ }
2840 $ cat promoted
2941 Hello, world!
3042
@@ -46,8 +58,14 @@ Now test behaviour for executables, which use artifact substitution.
4658 > | None -> print_endline " Has no version info" )
4759 > EOF
4860
49- $ dune build hello .exe --verbose 2 >&1 | grep "Promoting "
50- Promoting "_build /default /hello .exe " to "hello .exe "
61+ $ dune build hello. exe -- trace-file trace . json
62+
63+ $ showPromotions
64+ {
65+ " src" : " _build/default/hello.exe" ,
66+ " dst" : " hello.exe"
67+ }
68+
5169 $ ./ hello. exe
5270 Hello, World!
5371 Has version info
@@ -56,5 +74,12 @@ Bug: Dune currently re-promotes versioned executables on every restart.
5674
5775# CR-someday amokhov: Fix this.
5876
59- $ dune build hello .exe --verbose 2 >&1 | grep "Promoting "
60- Promoting "_build /default /hello .exe " to "hello .exe "
77+ $ dune build hello. exe -- trace-file trace . json
78+
79+ $ showPromotions
80+ {
81+ " src" : " _build/default/hello.exe" ,
82+ " dst" : " hello.exe"
83+ }
84+
85+ $ jq ' .[] | select(.name == "promote") | .args'
0 commit comments