file/tests/file-tests/reference.sh
Vincent Mihalkovic 2dd88dfd9f tests: port tests to tmt
In this commit we:

1. Use `tmt tests import` to gather all related
   metadata from tests/Support-local-additions-to-magic-files
   and tests/command-line-options directories and
   convert them into tmt format.
2. Add missing requirement for bzip2 in
   tests/command-line-options/{Makefile,main.fmf}
   files.
3. Replace an obsolescent `egrep` with a `grep -E`
   command in the tests/command-line-options/runtest.sh
   file.
4. Create new tests/file-tests/Makefile file.
5. Use `tmt tests import` to convert the
   tests/file-tests and all related
   metadata into tmt format.
6. Simplify and update tests/file-tests/{prepare.sh,
   runtest.sh,reference.sh,readfile.py} scripts.
   Thank you lzaoral!
7. Update and create new "references" (file-5.42.4 outputs)
   in the file-tests/reference.
8. Rename the file-tests/blacklist.txt to
   file-tests/blocklist.txt.
9. Replace the tests/tests.yml file with
   the plans/file-CI-plan.fmf file.
2023-01-17 13:59:28 +01:00

15 lines
264 B
Bash
Executable File

#!/bin/bash -ex
rm -rf reference
mkdir reference
cd db
for d in * ; do
mkdir "../reference/$d"
for f in "$d"/* ; do
if [[ ${f: -11} != ".source.txt" ]]; then
file "$f" | sed "s|$f: ||" > "../reference/$f.ref"
fi
done
done