#!/bin/bash -e
# tidy-tests performs various cleanups on the test suite.


: "Remove dot-files"
find ATS -name ".*" | xargs rm -rfv

: "Fix permissions"
find ATS -type f | xargs chmod 664
find ATS -type d | xargs chmod 775

: "Warn about unknown file types"
find ATS -type f ! -name "*.xml" -a ! -name "*.xsd" -a ! -name "*.ttcn" -a -name "*.json" -a -name "NOTES"

: "TTCN-3: Convert Windows line endings to Unix"
find ATS -type f -name \*.ttcn | xargs dos2unix -q

: "TTCN-3: Remove trailing whitespace"
find ATS -type f -name \*.ttcn | xargs sed -i 's/[[:space:]]*$//'


