<commit_before>#!/bin/sh

manifest="XCTestManifests.swift"
testspath="${PROJECT_DIR}/../Tests"

testdirs="AtomicsTests CAtomicsTests"

for testdir in ${testdirs}
do
  manifestpath="${testspath}/${testdir}/${manifest}"
  if /bin/test ! -s "${manifestpath}"
  then
    # echo "$manifestpath does not exist"
    generate="yes"
  elif /bin/test `/usr/bin/find "${testspath}/${testdir}" -newer "${manifestpath}"`
  then
    # echo "newer files than $manifestpath"
    generate="yes"
  fi
done

if /bin/test ${generate}
then
  /usr/bin/find "${testspath}" -name ${manifest} -exec rm -f {} \;
  echo "Regenerating test manifests"
  /usr/bin/swift test --generate-linuxmain
fi<commit_msg>improved script to auto-generate LinuxMain.swift and test manifests<commit_after>#!/bin/sh

manifest="XCTestManifests.swift"
testspath="${PROJECT_DIR}/../Tests"

testdirs="AtomicsTests CAtomicsTests"

for testdir in ${testdirs}
do
  manifestpath="${testspath}/${testdir}/${manifest}"
  if /bin/test ! -s "${manifestpath}"
  then
    # echo "$manifestpath does not exist"
    generate="yes"
  else
    newer=`/usr/bin/find "${testspath}/${testdir}" -newer "${manifestpath}"`
    if /bin/test "${newer}"
    then
      # echo "newer files than $manifestpath"
      generate="yes"
    fi
  fi
done

if /bin/test "${generate}"
then
  /usr/bin/find "${testspath}" -name "${manifest}" -exec rm -f {} \;
  echo "Regenerating test manifests"
  /usr/bin/swift test --generate-linuxmain
fi
{'fraction_non_alphanumeric': 0.16860863605209048, 'fraction_numerical': 0.0, 'mean_word_length': 3.9491525423728815, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '101376', 'n_tokens_mistral': 531, 'n_tokens_neox': 501, 'n_words': 121}