File: incremental.ninja

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (42 lines) | stat: -rw-r--r-- 1,331 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Test a trivial incremental build.

# We run the build in a sandbox in the temp directory to ensure we don't
# interact with the source dirs.
#
# RUN: rm -rf %t.build
# RUN: mkdir -p %t.build
# RUN: cp %s %t.build/build.ninja
# RUN: touch %t.build/input-1
# RUN: touch %t.build/input-2
# RUN: %{llbuild} ninja build --jobs 1 --chdir %t.build &> %t1.out
# RUN: %{FileCheck} --check-prefix=CHECK-INITIAL --input-file=%t1.out %s

# We use strict mode here to ensure the update-if-newer behavior works properly
# when timestamps collide.
#
# RUN: echo "mod" >> %t.build/input-1
# RUN: %{llbuild} ninja build --strict --jobs 1 --chdir %t.build &> %t2.out
# RUN: %{FileCheck} --check-prefix=CHECK-AFTER-MOD --input-file=%t2.out %s

# Check the first build.
#
# CHECK-DAG-INITIAL: [{{1|2}}/{{.*}}] "cp input-2 output-2"
# CHECK-DAG-INITIAL: [{{1|2}}/{{.*}}] "cp input-1 output-1"
# CHECK-INITIAL: [3/{{.*}}] "cat output-1 output-2 > output"

# Check the second build.
# CHECK-AFTER-MOD: [1/{{.*}}] "cp input-1 output-1"
# CHECK-AFTER-MOD: [2/{{.*}}] "cat output-1 output-2 > output"

rule CP
     command = cp ${in} ${out}
     description = "${command}"
rule CAT
     command = cat ${in} > ${out}
     description = "${command}"

build output-1: CP input-1
build output-2: CP input-2
build output: CAT output-1 output-2

default output