Android tests call exit() when complete. am: 16c704fa09

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13845281

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifa7e194f128b305ec90534d51a4bd9226a7ca91b
This commit is contained in:
Alex Dale
2021-03-13 03:44:19 +00:00
committed by Automerger Merge Worker
3 changed files with 23 additions and 3 deletions

View File

@@ -5,7 +5,7 @@
// Use in place of the gtest_main in order to initialize the WvCdmTestBase using
// command line parameters.
#include <stdio.h>
#include <stdlib.h>
#include "log.h"
#include "test_base.h"
@@ -13,5 +13,8 @@
int main(int argc, char** argv) {
if (!wvcdm::WvCdmTestBase::Initialize(argc, argv)) return 1;
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
const int status = RUN_ALL_TESTS();
LOGD("CDM test complete with status %d", status);
exit(status); // Explicit call to exit() is required for code coverage.
return status;
}

View File

@@ -0,0 +1,17 @@
// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine License
// Agreement.
#include <stdlib.h>
#include "gtest/gtest.h"
#include "log.h"
int main(int argc, char** argv) {
LOGI("Running Android CDM tests");
testing::InitGoogleTest(&argc, argv);
const int status = RUN_ALL_TESTS();
LOGD("CDM test complete with status %d", status);
exit(status); // Explicit call to exit() is required for code coverage.
return status;
}

View File

@@ -20,6 +20,7 @@ LOCAL_SRC_FILES := \
../core/test/url_request.cpp \
../../oemcrypto/test/oec_device_features.cpp \
../util/test/test_sleep.cpp \
./cdm_test_main.cpp \
LOCAL_C_INCLUDES := \
vendor/widevine/libwvdrmengine/android/cdm/test \
@@ -44,7 +45,6 @@ LOCAL_STATIC_LIBRARIES := \
libjsmn \
libgmock \
libgtest \
libgtest_main \
libwvlevel3 \
LOCAL_SHARED_LIBRARIES := \