Commit 3703f133 authored by Wan-Teh Chang's avatar Wan-Teh Chang Committed by James Almer

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

Suggested by Diego Biurrun and James Almer.
Signed-off-by: 's avatarWan-Teh Chang <wtc@google.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 89868858
...@@ -190,7 +190,6 @@ TESTPROGS = adler32 \ ...@@ -190,7 +190,6 @@ TESTPROGS = adler32 \
camellia \ camellia \
color_utils \ color_utils \
cpu \ cpu \
cpu_init \
crc \ crc \
des \ des \
dict \ dict \
...@@ -226,6 +225,7 @@ TESTPROGS = adler32 \ ...@@ -226,6 +225,7 @@ TESTPROGS = adler32 \
tea \ tea \
TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo
TESTPROGS-$(HAVE_THREADS) += cpu_init
TOOLS = crypto_bench ffhash ffeval ffescape TOOLS = crypto_bench ffhash ffeval ffescape
......
...@@ -24,12 +24,9 @@ ...@@ -24,12 +24,9 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "config.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/thread.h" #include "libavutil/thread.h"
#if HAVE_PTHREADS
static void *thread_main(void *arg) static void *thread_main(void *arg)
{ {
int *flags = arg; int *flags = arg;
...@@ -37,12 +34,9 @@ static void *thread_main(void *arg) ...@@ -37,12 +34,9 @@ static void *thread_main(void *arg)
*flags = av_get_cpu_flags(); *flags = av_get_cpu_flags();
return NULL; return NULL;
} }
#endif
int main(void) int main(void)
{ {
#if HAVE_PTHREADS
int cpu_flags1; int cpu_flags1;
int cpu_flags2; int cpu_flags2;
int ret; int ret;
...@@ -66,7 +60,6 @@ int main(void) ...@@ -66,7 +60,6 @@ int main(void)
return 2; return 2;
if (cpu_flags1 != cpu_flags2) if (cpu_flags1 != cpu_flags2)
return 3; return 3;
#endif
return 0; return 0;
} }
...@@ -44,7 +44,7 @@ fate-cpu: libavutil/tests/cpu$(EXESUF) ...@@ -44,7 +44,7 @@ fate-cpu: libavutil/tests/cpu$(EXESUF)
fate-cpu: CMD = runecho libavutil/tests/cpu $(CPUFLAGS:%=-c%) $(THREADS:%=-t%) fate-cpu: CMD = runecho libavutil/tests/cpu $(CPUFLAGS:%=-c%) $(THREADS:%=-t%)
fate-cpu: REF = /dev/null 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: libavutil/tests/cpu_init$(EXESUF)
fate-cpu_init: CMD = run libavutil/tests/cpu_init fate-cpu_init: CMD = run libavutil/tests/cpu_init
fate-cpu_init: REF = /dev/null fate-cpu_init: REF = /dev/null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment