File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed
test/blackbox-tests/test-cases/promote Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ Tests for promoting directory targets
2+ ------------------------------------ -
3+
4+ $ cat > dune-project << EOF
5+ > (lang dune 3.0 )
6+ > (using directory-targets 0.1 )
7+ > EOF
8+
9+ $ cat > dune << EOF
10+ > (rule
11+ > (deps
12+ > (source_tree deep ))
13+ > (targets
14+ > (dir deep_copied))
15+ > (mode promote)
16+ > (action
17+ > (run cp -r deep deep_copied)))
18+ > EOF
19+
20+ Let's create the directory structure we are going to promote (as a copy on
21+ another dir):
22+
23+ $ mkdir -p deep /a /
24+ $ touch deep /a /deep_file
25+ $ touch deep /base_file
26+
27+ Let's try this :
28+
29+ $ dune build deep_copied
30+
31+ This one works . Now , let's add a layer between base_file and deep_file :
32+
33+ $ rm -rf deep
34+ $ mkdir -p deep /a /b /
35+ $ touch deep /a /b /deep_file
36+ $ touch deep /base_file
37+
38+ $ dune build deep_copied
39+ File "dune ", lines 1-8 , characters 0-123 :
40+ 1 | (rule
41+ 2 | (deps
42+ 3 | (source_tree deep ))
43+ 4 | (targets
44+ 5 | (dir deep_copied))
45+ 6 | (mode promote)
46+ 7 | (action
47+ 8 | (run cp -r deep deep_copied)))
48+ Error : Cannot promote files to "deep_copied /a /b ".
49+ Reason : opendir (deep_copied/ a/ b): No such file or directory
50+ - > required by _build /default /deep_copied
51+ [1 ]
52+
53+ It does not work ! Note that the `base_file ` is required . For instance , move it
54+ to `a /`, or remove it , and it works :
55+
56+ $ mv deep /base_file deep /a /
57+ $ dune build deep_copied
58+
59+ $ rm deep /a /base_file
60+ $ dune build deep_copied
You can’t perform that action at this time.
0 commit comments