[FFmpeg-cvslog] avutil/tests: run the cpu_init.c test conditionally on HAVE_THREADS

Wan-Teh Chang git at videolan.org
Sat Dec 10 23:48:43 EET 2016


ffmpeg | branch: master | Wan-Teh Chang <wtc-at-google.com at ffmpeg.org> | Tue Dec  6 11:00:02 2016 -0800| [3703f13333e24540a5ef132e7b2a9c0ded7e4531] | committer: James Almer

avutil/tests: run the cpu_init.c test conditionally on HAVE_THREADS

Suggested by Diego Biurrun and James Almer.

Signed-off-by: Wan-Teh Chang <wtc at google.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3703f13333e24540a5ef132e7b2a9c0ded7e4531
---

 libavutil/Makefile         | 2 +-
 libavutil/tests/cpu_init.c | 7 -------
 tests/fate/libavutil.mak   | 2 +-
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/libavutil/Makefile b/libavutil/Makefile
index a8c0882..9841645 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -190,7 +190,6 @@ TESTPROGS = adler32                                                     \
             camellia                                                    \
             color_utils                                                 \
             cpu                                                         \
-            cpu_init                                                    \
             crc                                                         \
             des                                                         \
             dict                                                        \
@@ -226,6 +225,7 @@ TESTPROGS = adler32                                                     \
             tea                                                         \
 
 TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo
+TESTPROGS-$(HAVE_THREADS) += cpu_init
 
 TOOLS = crypto_bench ffhash ffeval ffescape
 
diff --git a/libavutil/tests/cpu_init.c b/libavutil/tests/cpu_init.c
index 87c6002..a379e47 100644
--- a/libavutil/tests/cpu_init.c
+++ b/libavutil/tests/cpu_init.c
@@ -24,12 +24,9 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "config.h"
-
 #include "libavutil/cpu.h"
 #include "libavutil/thread.h"
 
-#if HAVE_PTHREADS
 static void *thread_main(void *arg)
 {
     int *flags = arg;
@@ -37,12 +34,9 @@ static void *thread_main(void *arg)
     *flags = av_get_cpu_flags();
     return NULL;
 }
-#endif
-
 
 int main(void)
 {
-#if HAVE_PTHREADS
     int cpu_flags1;
     int cpu_flags2;
     int ret;
@@ -66,7 +60,6 @@ int main(void)
         return 2;
     if (cpu_flags1 != cpu_flags2)
         return 3;
-#endif
 
     return 0;
 }
diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak
index 82fe9a2..06f968c 100644
--- a/tests/fate/libavutil.mak
+++ b/tests/fate/libavutil.mak
@@ -44,7 +44,7 @@ fate-cpu: libavutil/tests/cpu$(EXESUF)
 fate-cpu: CMD = runecho libavutil/tests/cpu $(CPUFLAGS:%=-c%) $(THREADS:%=-t%)
 fate-cpu: REF = /dev/null
 
-FATE_LIBAVUTIL += fate-cpu_init
+FATE_LIBAVUTIL-$(HAVE_THREADS) += fate-cpu_init
 fate-cpu_init: libavutil/tests/cpu_init$(EXESUF)
 fate-cpu_init: CMD = run libavutil/tests/cpu_init
 fate-cpu_init: REF = /dev/null



More information about the ffmpeg-cvslog mailing list