<commit_before># Test for handling of removed implicit header dependencies.

# RUN: rm -rf %t.build
# RUN: mkdir -p %t.build
# RUN: ln -s %s %t.build/build.ninja
# RUN: touch -r / %t.build/header-1 %t.build/input-1
# RUN: %{llbuild} ninja build --no-parallel --chdir %t.build &> %t1.out
# RUN: %{FileCheck} --check-prefix=CHECK-INITIAL --input-file=%t1.out %s

# Check the first build.
#
# CHECK-INITIAL: CC output-1
# CHECK-INITIAL: cat output-1 > output

# Check a build that removes the header.
#
# RUN: rm %t.build/header-1
# RUN: %{llbuild} ninja build --strict --no-parallel --chdir %t.build &> %t2.out
# RUN: %{FileCheck} --check-prefix=CHECK-AFTER-REMOVAL --input-file=%t2.out %s
#
# CHECK-AFTER-REMOVAL-NOT: missing input 'header-1'
# CHECK-AFTER-REMOVAL: CC output-1
# CHECK-AFTER-REMOVAL-NOT: missing input 'header-1'
# CHECK-AFTER-REMOVAL: cat output-1 > output

rule CC
     deps = gcc
     depfile = ${out}.d
     command = $
       if [ -f header-1 ]; then $
         echo "${out}: ${in} header-1" > ${depfile}; $
         cat ${in} header-1 > ${out}; $
       else $
         echo "${out}:" > ${depfile}; $
       fi
     description = CC ${out}

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

build output-1: CC input-1
build output: CAT output-1

default output<commit_msg>[tests] Fix a non-deterministic test failure due to timestamp collision.<commit_after># Test for handling of removed implicit header dependencies.

# RUN: rm -rf %t.build
# RUN: mkdir -p %t.build
# RUN: ln -s %s %t.build/build.ninja
# RUN: echo "header-1" > %t.build/header-1
# RUN: echo "input-1" > %t.build/input-1
# RUN: %{llbuild} ninja build --no-parallel --chdir %t.build &> %t1.out
# RUN: %{FileCheck} --check-prefix=CHECK-INITIAL --input-file=%t1.out %s

# Check the first build.
#
# CHECK-INITIAL: CC output-1
# CHECK-INITIAL: cat output-1 > output

# Check a build that removes the header.
#
# RUN: rm %t.build/header-1
# RUN: %{llbuild} ninja build --strict --no-parallel --chdir %t.build &> %t2.out
# RUN: %{FileCheck} --check-prefix=CHECK-AFTER-REMOVAL --input-file=%t2.out %s
#
# CHECK-AFTER-REMOVAL-NOT: missing input 'header-1'
# CHECK-AFTER-REMOVAL: CC output-1
# CHECK-AFTER-REMOVAL-NOT: missing input 'header-1'
# CHECK-AFTER-REMOVAL: cat output-1 > output

rule CC
     deps = gcc
     depfile = ${out}.d
     command = $
       if [ -f header-1 ]; then $
         echo "${out}: ${in} header-1" > ${depfile}; $
         cat ${in} header-1 > ${out}; $
       else $
         echo "${out}:" > ${depfile}; $
         cat ${in} > ${out}; $
       fi
     description = CC ${out}

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

build output-1: CC input-1
build output: CAT output-1

default output
{'fraction_non_alphanumeric': 0.1722887196227784, 'fraction_numerical': 0.014508523757707652, 'mean_word_length': 2.835883171070932, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6124497', 'n_tokens_mistral': 1043, 'n_tokens_neox': 1001, 'n_words': 286}