Commit c4ec0329 authored by Johann's avatar Johann Committed by James Zern

expand gtest cpu extension filter

Look for OPT_ because this style is used to manually shard the intrapred
test and it's speed variant.

Change-Id: Ic294148e76a1d152e65a4df0c024280fe93ab6c6
parent 04401474
......@@ -9,6 +9,8 @@
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#include <string.h>
#include <string>
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
......@@ -30,7 +32,17 @@ static void append_negative_gtest_filter(const char *str) {
std::string filter = ::testing::FLAGS_gtest_filter;
// Negative patterns begin with one '-' followed by a ':' separated list.
if (filter.find('-') == std::string::npos) filter += '-';
filter += str;
// OPT.* matches TEST() functions
// OPT/* matches TEST_P() functions
// OPT_* matches tests which have been manually sharded.
// We do not match OPT* because of SSE/SSE2 collisions.
const char *search_terminators = "./_";
for (size_t pos = 0; pos < strlen(search_terminators); ++pos) {
filter += ":";
filter += str;
filter += search_terminators[pos];
filter += "*";
}
::testing::FLAGS_gtest_filter = filter;
}
#endif // ARCH_X86 || ARCH_X86_64
......@@ -40,16 +52,14 @@ int main(int argc, char **argv) {
#if ARCH_X86 || ARCH_X86_64
const int simd_caps = x86_simd_caps();
if (!(simd_caps & HAS_MMX)) append_negative_gtest_filter(":MMX.*:MMX/*");
if (!(simd_caps & HAS_SSE)) append_negative_gtest_filter(":SSE.*:SSE/*");
if (!(simd_caps & HAS_SSE2)) append_negative_gtest_filter(":SSE2.*:SSE2/*");
if (!(simd_caps & HAS_SSE3)) append_negative_gtest_filter(":SSE3.*:SSE3/*");
if (!(simd_caps & HAS_SSSE3))
append_negative_gtest_filter(":SSSE3.*:SSSE3/*");
if (!(simd_caps & HAS_SSE4_1))
append_negative_gtest_filter(":SSE4_1.*:SSE4_1/*");
if (!(simd_caps & HAS_AVX)) append_negative_gtest_filter(":AVX.*:AVX/*");
if (!(simd_caps & HAS_AVX2)) append_negative_gtest_filter(":AVX2.*:AVX2/*");
if (!(simd_caps & HAS_MMX)) append_negative_gtest_filter("MMX");
if (!(simd_caps & HAS_SSE)) append_negative_gtest_filter("SSE");
if (!(simd_caps & HAS_SSE2)) append_negative_gtest_filter("SSE2");
if (!(simd_caps & HAS_SSE3)) append_negative_gtest_filter("SSE3");
if (!(simd_caps & HAS_SSSE3)) append_negative_gtest_filter("SSSE3");
if (!(simd_caps & HAS_SSE4_1)) append_negative_gtest_filter("SSE4_1");
if (!(simd_caps & HAS_AVX)) append_negative_gtest_filter("AVX");
if (!(simd_caps & HAS_AVX2)) append_negative_gtest_filter("AVX2");
#endif // ARCH_X86 || ARCH_X86_64
#if !CONFIG_SHARED
......
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