2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
12 #include "third_party/googletest/src/include/gtest/gtest.h"
14 #include "./vpx_config.h"
15 #if VPX_ARCH_X86 || VPX_ARCH_X86_64
16 #include "vpx_ports/x86.h"
20 extern void vp8_rtcd();
23 extern void vp9_rtcd();
25 extern void vpx_dsp_rtcd();
26 extern void vpx_scale_rtcd();
29 #if VPX_ARCH_X86 || VPX_ARCH_X86_64
30 static void append_negative_gtest_filter(const char *str) {
31 std::string filter = ::testing::FLAGS_gtest_filter;
32 // Negative patterns begin with one '-' followed by a ':' separated list.
33 if (filter.find('-') == std::string::npos) filter += '-';
35 ::testing::FLAGS_gtest_filter = filter;
37 #endif // VPX_ARCH_X86 || VPX_ARCH_X86_64
39 int main(int argc, char **argv) {
40 ::testing::InitGoogleTest(&argc, argv);
42 #if VPX_ARCH_X86 || VPX_ARCH_X86_64
43 const int simd_caps = x86_simd_caps();
44 if (!(simd_caps & HAS_MMX)) append_negative_gtest_filter(":MMX.*:MMX/*");
45 if (!(simd_caps & HAS_SSE)) append_negative_gtest_filter(":SSE.*:SSE/*");
46 if (!(simd_caps & HAS_SSE2)) append_negative_gtest_filter(":SSE2.*:SSE2/*");
47 if (!(simd_caps & HAS_SSE3)) append_negative_gtest_filter(":SSE3.*:SSE3/*");
48 if (!(simd_caps & HAS_SSSE3)) {
49 append_negative_gtest_filter(":SSSE3.*:SSSE3/*");
51 if (!(simd_caps & HAS_SSE4_1)) {
52 append_negative_gtest_filter(":SSE4_1.*:SSE4_1/*");
54 if (!(simd_caps & HAS_AVX)) append_negative_gtest_filter(":AVX.*:AVX/*");
55 if (!(simd_caps & HAS_AVX2)) append_negative_gtest_filter(":AVX2.*:AVX2/*");
56 if (!(simd_caps & HAS_AVX512)) {
57 append_negative_gtest_filter(":AVX512.*:AVX512/*");
59 #endif // VPX_ARCH_X86 || VPX_ARCH_X86_64
62 // Shared library builds don't support whitebox tests
63 // that exercise internal symbols.
72 #endif // !CONFIG_SHARED
74 return RUN_ALL_TESTS();