// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary // source code may only be used and distributed under the Widevine License // Agreement. #include #include #include "gtest/gtest.h" #include "log.h" namespace wvcdm { namespace { void UpdateGtestFilter() { const std::string initial_filter = ::testing::GTEST_FLAG(filter); if (!initial_filter.empty()) { LOGW("Ignoring provided GTEST filter: %s", initial_filter.c_str()); } std::string final_filter("-"); // Sleepy tests. final_filter.append("*VerifyUsageTimes*:*Refresh*:*TimingTest*"); final_filter.append(":*KeyDuration*:*CdmUseCase*"); final_filter.append(":*ExtendedDurationTest*"); // Slow tests. final_filter.append(":*OEMCryptoMemory*:*Huge*:*NonceFlood*"); final_filter.append( ":*TwoHundredEntries*:*ManyUsageEntries*:*UsageTableDefrag*"); final_filter.append( ":*DecryptMax*:*MaxTotalKeys*:*OEMCryptoSessionTestsDecryptTests*"); final_filter.append(":*SharedMutex*:*Parallel*"); // Flacky tests. final_filter.append(":*Repeated/ParallelCdmTest*"); // L1 only tests. final_filter.append(":*Level1Required"); ::testing::GTEST_FLAG(filter) = final_filter; } } // namespace } // namespace wvcdm int main(int argc, char** argv) { LOGI("Running Android CDM tests"); testing::InitGoogleTest(&argc, argv); wvcdm::UpdateGtestFilter(); const int status = RUN_ALL_TESTS(); LOGD("CDM coverage test complete with status %d", status); // Test is for coverage information only, actual test failure // should not change the final result of the test executable. return EXIT_SUCCESS; }