Browse code

fate: add support for multithread testing

Add a THREADS variable to fate calls.

Luca Barbato authored on 2011/03/22 08:07:54
Showing 3 changed files
... ...
@@ -290,7 +290,7 @@ fate: $(FATE)
290 290
 
291 291
 $(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
292 292
 	@echo "TEST    $(@:fate-%=%)"
293
-	$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)'
293
+	$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)'
294 294
 
295 295
 fate-list:
296 296
 	@printf '%s\n' $(sort $(FATE))
... ...
@@ -15,6 +15,7 @@ command=$5
15 15
 cmp=${6:-diff}
16 16
 ref=${7:-"${base}/ref/fate/${test}"}
17 17
 fuzz=$8
18
+threads=${9:-1}
18 19
 
19 20
 outdir="tests/data/fate"
20 21
 outfile="${outdir}/${test}"
... ...
@@ -48,7 +49,7 @@ run(){
48 48
 }
49 49
 
50 50
 ffmpeg(){
51
-    run ffmpeg -v 0 "$@"
51
+    run ffmpeg -v 0 -threads $threads "$@"
52 52
 }
53 53
 
54 54
 framecrc(){
... ...
@@ -77,7 +78,7 @@ regtest(){
77 77
     cleanfiles="$cleanfiles $outfile $errfile"
78 78
     outfile=tests/data/regression/$2/$t
79 79
     errfile=tests/data/$t.$2.err
80
-    ${base}/${1}-regression.sh $t $2 $3 "$target_exec" "$target_path"
80
+    ${base}/${1}-regression.sh $t $2 $3 "$target_exec" "$target_path" "$threads"
81 81
 }
82 82
 
83 83
 codectest(){
... ...
@@ -9,6 +9,7 @@ test_ref=$2
9 9
 raw_src_dir=$3
10 10
 target_exec=$4
11 11
 target_path=$5
12
+threads=${6:-1}
12 13
 
13 14
 datadir="./tests/data"
14 15
 target_datadir="${target_path}/${datadir}"
... ...
@@ -52,7 +53,7 @@ echov(){
52 52
 
53 53
 . $(dirname $0)/md5.sh
54 54
 
55
-FFMPEG_OPTS="-v 0 -y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
55
+FFMPEG_OPTS="-v 0 -threads $threads -y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
56 56
 
57 57
 run_ffmpeg()
58 58
 {