Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146087440
D42129.1779191159.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D42129.1779191159.diff
View Options
diff --git a/usr.bin/file/tests/Makefile b/usr.bin/file/tests/Makefile
--- a/usr.bin/file/tests/Makefile
+++ b/usr.bin/file/tests/Makefile
@@ -2,7 +2,7 @@
ATF_TESTS_SH= file_test
SRCDIR= ${SRCTOP}/contrib/file/tests
-_files!= echo ${SRCDIR}/*.testfile ${SRCDIR}/*.result ${SRCDIR}/*.magic
+_files!= echo ${SRCDIR}/*.testfile ${SRCDIR}/*.flags ${SRCDIR}/*.result ${SRCDIR}/*.magic
${PACKAGE}FILES+=${_files}
.include <bsd.test.mk>
diff --git a/usr.bin/file/tests/file_test.sh b/usr.bin/file/tests/file_test.sh
--- a/usr.bin/file/tests/file_test.sh
+++ b/usr.bin/file/tests/file_test.sh
@@ -32,14 +32,26 @@
for testfile in "${srcdir}"/*.testfile; do
test_name="${testfile%.testfile}"
result_file="${test_name}.result"
- magic_file="${test_name}.magic"
file_args=
- if [ -e "${magic_file}" ]; then
- file_args="${file_args} --magic-file ${magic_file}"
+ magic_files=
+ for magic_file in ${test_name}*.magic; do
+ if [ -f "${magic_file}" ]; then
+ if [ -z "${magic_files}" ]; then
+ magic_files="${magic_file}"
+ else
+ magic_files="${magic_files}:${magic_file}"
+ fi
+ fi
+ done
+ if [ -z "${magic_files}" ]; then
+ magic_files=/usr/share/misc/magic
+ fi
+ if [ -f "${test_name}.flags" ]; then
+ file_args="${file_args} -$(cat "${test_name}.flags")"
fi
# The result files were created in UTC.
- TZ=Z atf_check -o save:actual_output file ${file_args} \
- --brief "$testfile"
+ atf_check -o save:actual_output -e ignore env TZ=Z MAGIC="${magic_files}" \
+ file ${file_args} --brief "$testfile"
atf_check cmp actual_output "$result_file"
done
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 19, 11:45 AM (1 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28744006
Default Alt Text
D42129.1779191159.diff (1 KB)
Attached To
Mode
D42129: file: Support testing multiple magic files.
Attached
Detach File
Event Timeline
Log In to Comment