Since we want to migrate to using GTEST_SKIP to skip unit tests instead of GTEST_FILTER, we can remove the RestrictFilter() function which filters the tests out using GTEST_FILTER. To do this, the RSAPerformance test needs to be removed, which is acceptable since no one uses this test anymore. However, b/299135804 is being used to track a new way to either execute/track permance. Bug: 251240681, 299135804 Change-Id: Ife59c468ee127f4c39d3be91707ca38a061b7895
56 lines
2.0 KiB
C++
56 lines
2.0 KiB
C++
#include <gtest/gtest.h>
|
|
#include <iostream>
|
|
|
|
#include "OEMCryptoCENC.h"
|
|
#include "log.h"
|
|
#include "oec_device_features.h"
|
|
#include "oemcrypto_corpus_generator_helper.h"
|
|
#include "test_sleep.h"
|
|
|
|
static void acknowledge_cast() {
|
|
std::cout
|
|
<< "==================================================================\n"
|
|
<< "= This device is expected to load x509 certs as a cast receiver. =\n"
|
|
<< "==================================================================\n";
|
|
}
|
|
|
|
// This special main procedure is used instead of the standard GTest main,
|
|
// because we need to initialize the list of features supported by the device.
|
|
// Also, the test filter is updated based on the feature list.
|
|
int main(int argc, char** argv) {
|
|
bool is_cast_receiver = false;
|
|
int verbosity = 0;
|
|
// Skip the first element, which is the program name.
|
|
const std::vector<std::string> args(argv + 1, argv + argc);
|
|
for (const std::string& arg : args) {
|
|
if (arg == "--generate_corpus") {
|
|
wvoec::SetGenerateCorpus(true);
|
|
}
|
|
if (arg == "--verbose" || arg == "-v") {
|
|
++verbosity;
|
|
} else if (arg == "--cast") {
|
|
acknowledge_cast();
|
|
is_cast_receiver = true;
|
|
}
|
|
if (arg == "--force_load_test_keybox") {
|
|
std::cerr << "The argument --force_load_test_keybox is obsolete.\n";
|
|
return 1;
|
|
}
|
|
if (arg == "--fake_sleep") {
|
|
wvutil::TestSleep::set_real_sleep(false);
|
|
}
|
|
}
|
|
wvutil::g_cutoff = static_cast<wvutil::LogPriority>(verbosity);
|
|
wvoec::global_features.Initialize();
|
|
if (is_cast_receiver) {
|
|
// Turn it on if passed in on the command line. Do not turn these tests off
|
|
// automtically -- instead, we'll let the caller filter them out if they
|
|
// need to. These tests will normally only run if the device claims to
|
|
// support being a cast receiver.
|
|
wvoec::global_features.set_cast_receiver(is_cast_receiver);
|
|
}
|
|
// Init GTest after device properties has been initialized.
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
return RUN_ALL_TESTS();
|
|
}
|