@@ -8,56 +8,54 @@ if [ -z "$NASM1" ]; then
88 echo ' Please install a reference nasm ...' 1>&2
99 exit 1
1010fi
11+
1112NASM2=" $1 "
1213[ -z " $NASM2 " ] && NASM2=../nasm
1314NASM2=$( which " $NASM2 " 2> /dev/null)
14-
1515if [ -z " $NASM2 " ]; then
1616 echo ' Test nasm not found' 1>&2
1717 exit 1
1818fi
1919
20+ PROJ=" $2 "
21+ PROJ_GET_BUILD=" get_build_${PROJ} .sh"
22+ if ! [ -f ${PROJ_GET_BUILD} ]; then
23+ echo ' No knowledge in building the project' 1>&2
24+ exit 1
25+ fi
26+
27+ export PATH=${PWD} :$PATH
28+
2029set -x
2130
22- mkdir -p " ${there} /ffmpegtest "
23- cd " ${there} /ffmpegtest "
31+ mkdir -p " ${there} /${PROJ} "
32+ cd " ${there} /${PROJ} "
2433here=" $( pwd) "
2534
2635logfile=" $here /test.log"
2736filelist=" $here /file.list"
2837rm -f " $logfile "
29- export ffmpegnasm_logfile=" $logfile "
30- export ffmpegnasm_filelist=" $filelist "
31- export ffmpegnasm_nasm1=" $NASM1 "
32- export ffmpegnasm_nasm2=" $NASM2 "
33-
34- ffmpegnasm=" $( realpath " $there /ffmpegnasm.sh" ) "
35-
36- : >> " $filelist "
38+ export projnasm_logfile=" $logfile "
39+ export projnasm_filelist=" $filelist "
40+ export projnasm_nasm1=" $NASM1 "
41+ export projnasm_nasm2=" $NASM2 "
3742
38- if [ -d ffmpeg/.git ]; then
39- cd ffmpeg
40- git reset --hard
41- xargs -r rm -f < " $filelist "
42- else
43- git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
44- cd ffmpeg
45- fi
46- : > " $filelist "
47- ./configure --disable-stripping --x86asmexe=" $ffmpegnasm "
48- ncpus=$( ls -1 /sys/bus/cpu/devices | wc -l)
49- make -j${ncpus}
43+ source ../${PROJ_GET_BUILD}
5044rev=$?
51- if [ " $? " -ne " 0" ]; then
52- echo ffmpeg compiling failed ...
45+ if [ " $rev " -ne " 0" ]; then
46+ echo ${PROJ} compiling failed ...
5347 exit $rev
5448fi
5549
5650set +x
5751
5852{
59- for x in $( grep -o -P " \-o .*\.o" $logfile | sed -e ' s/-o //' | grep -v " /ffconf " )
53+ for x in $( grep -o -P " \-o .*\.o" $logfile | sed -e ' s/-o //' )
6054do
55+ if ! [ -f $x ]; then
56+ # probably it's a temporary assembly being tested
57+ continue
58+ fi
6159 if ! [ -f ${x} .1 ]; then
6260 echo file ${x} .1 does not exist
6361 fi
7876done
7977} | tee " $here /results"
8078
81- rev=$( grep -e " does not exist" -e " \[differs\]" $here /results > /dev/null)
79+ rev=$( ! grep -e " does not exist" -e " \[differs\]" $here /results > /dev/null)
8280
8381exit $rev
0 commit comments