PR #25642 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25642
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25642.patch


>From 36f8d529cc403cf701d8927b20c0559649937305 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Fri, 30 Oct 2026 21:42:37 +0100
Subject: [PATCH 1/2] tests/fate/source-check: check header guards in one awk
 pass

The check ran sed, tr and git grep for each of the roughly 1700 headers,
which took 7 seconds on a fast machine, making fate-source one of the
longest FATE tests. One awk invocation computing the guard macro and
reading each header does the same in 0.2 seconds. Output is unchanged.
---
 tests/fate/source-check.sh | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
index 1da5b560376..075fe629209 100755
--- a/tests/fate/source-check.sh
+++ b/tests/fate/source-check.sh
@@ -18,18 +18,23 @@ git grep -L -E "This file is part of FFmpeg|This file is 
part of libswresample|"
 "This file is placed in the public domain" | grep -E '\.c$|\.h$|\.S$|\.asm$' | 
grep -v tests/checkasm/ext/
 
 echo Headers without standard inclusion guards:
-for f in `git ls-files | grep '\.h$' | grep -v tests/checkasm/ext/` ; do
-    macro="`echo $f | sed \
-        -e 's/^lib//' \
-        -e 's/[^A-Za-z0-9]\{1,\}/_/g' \
-        -e 's/_af_/_/' \
-        -e 's/_vf_/_/' \
-        -e 's/_avf_/_/' \
-        -e 's/_vaf_/_/' \
-    | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`"
-
-    git grep -L "^#define $macro$" $f
-done
+git ls-files | grep '\.h$' | grep -v tests/checkasm/ext/ | awk '
+{
+    macro = $0
+    sub(/^lib/, "", macro)
+    gsub(/[^A-Za-z0-9]+/, "_", macro)
+    sub(/_af_/, "_", macro)
+    sub(/_vf_/, "_", macro)
+    sub(/_avf_/, "_", macro)
+    sub(/_vaf_/, "_", macro)
+    macro = toupper(macro)
+    guard = 0
+    while (!guard && (getline line < $0) > 0)
+        guard = line == "#define " macro
+    close($0)
+    if (!guard)
+        print
+}'
 
 echo "Use of av_clip() where av_clip_uintp2() could be used:"
 git grep -E 'av_clip *\(.*, *0 *, 
*(3|7|15|31|63|127|255|511|1023|2047|4095|8191|'\
-- 
2.54.0


>From debad6b54996bc05d95d4df9626bece45baf6846 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Sat, 31 Oct 2026 00:21:10 +0100
Subject: [PATCH 2/2] tests/Makefile: start the longest tests first

---
 tests/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/Makefile b/tests/Makefile
index 7d1597bdf76..d8580d1a5e4 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -329,7 +329,11 @@ TOOL = ffmpeg
 
 $(addprefix fate-, $(IGNORE_TESTS)): REPORT=ignore
 
-fate:: $(FATE)
+# The longest tests start first so that a parallel run does not end with them
+FATE_SLOW = fate-random_seed fate-sws-% fate-filter-pixfmts-% 
fate-vsynth%-cinepak    \
+            fate-vsynth%-jpeg2000 fate-vsynth%-jpeg2000-97 
fate-vsynth%-jpeg2000-gbrp12 \
+            fate-vsynth%-jpeg2000-yuva444p16 fate-wavpack-cuesheet 
fate-vvc-conformance-CROP_B_4
+fate:: $(filter $(FATE_SLOW), $(FATE)) $(filter-out $(FATE_SLOW), $(FATE))
 
 # Tests requiring hardware support are not included in a default fate run.
 fate-hw: $(FATE_HW-yes)
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to