Added skip test flags to test_base

Flags are to be used in new tests when creating tests that potentially
take a long time to run.  Certain test suites are intended to be quick
and may skip certain long running tests.

New slow tests should check these flags and skip using GTEST_SKIP().

Bug: 311273599
Test: ./build.py x86-64 --debug
Change-Id: I4fc5a026f23f489bf2ad8b8a11dc467f550f0c5e
This commit is contained in:
Alex Dale
2023-11-16 15:27:10 -08:00
committed by Robert Shih
parent 151a0e1a76
commit 8429693866
2 changed files with 112 additions and 4 deletions

View File

@@ -48,6 +48,20 @@ class WvCdmTestBase : public ::testing::Test {
// Calls Provision() if not already provisioned.
virtual void EnsureProvisioned();
virtual bool skip_sleepy_tests() const { return skip_sleepy_tests_; }
virtual bool skip_decryption_stress_tests() const {
return skip_decryption_stress_tests_;
}
virtual bool skip_request_flood_tests() const {
return skip_request_flood_tests_;
}
virtual bool skip_multi_thread_stress_tests() const {
return skip_multi_thread_stress_tests_;
}
virtual bool skip_usage_table_stress_tests() const {
return skip_usage_table_stress_tests_;
}
// Fill a buffer with some nonconstant data of the given size. The first byte
// will be set to <init> to help you find the buffer when debugging.
static void StripeBuffer(std::vector<uint8_t>* buffer, size_t size,
@@ -78,7 +92,15 @@ class WvCdmTestBase : public ::testing::Test {
// This should be set by test subclasses BEFORE calling SetUp -- i.e. in the
// tests's constructor.
bool binary_provisioning_;
bool binary_provisioning_ = false;
private:
// Skip flags for long running tests.
static bool skip_sleepy_tests_;
static bool skip_decryption_stress_tests_;
static bool skip_request_flood_tests_;
static bool skip_multi_thread_stress_tests_;
static bool skip_usage_table_stress_tests_;
};
// This just makes the constructor public so that we can create one with dummy