Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ jobs:
--gha_build \
--arch ${{ matrix.arch }} \
${additional_flags[*]}
- name: Copy Analytics DLL to test folders (Windows)
if: startsWith(matrix.os, 'windows')
shell: bash
run: |
find "testapps-desktop-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.ssl_variant }}" -name integration_test.exe -exec dirname {} \; | while read dir; do cp analytics/windows/analytics_win.dll "$dir/"; done
- name: Upload Desktop Cmake
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
Expand Down
1 change: 1 addition & 0 deletions analytics/integration_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ set(FIREBASE_INTEGRATION_TEST_SRCS

# The include directory for the testapp.
include_directories(src)
include_directories(${FIREBASE_CPP_SDK_DIR})

# Firebase C++ SDK requires C++14.
set (CMAKE_CXX_STANDARD 14)
Expand Down
9 changes: 9 additions & 0 deletions analytics/integration_test/src/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <cstring>
#include <ctime>

#include "analytics/src/analytics_internal.h"
#include "app_framework.h" // NOLINT
#include "firebase/analytics.h"
#include "firebase/analytics/event_names.h"
Expand Down Expand Up @@ -353,4 +354,12 @@ TEST_F(FirebaseAnalyticsTest, TestSetConsent) {
did_test_setconsent_ = true;
}

TEST_F(FirebaseAnalyticsTest, TestIsAnalyticsDllLoaded) {
#if defined(_WIN32)
EXPECT_TRUE(firebase::analytics::internal::IsAnalyticsDllLoaded());
#else
GTEST_SKIP();
#endif // defined(_WIN32)
}

} // namespace firebase_testapp_automated
3 changes: 3 additions & 0 deletions analytics/src/analytics_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <vector>

#include "analytics/src/analytics_common.h"
#include "analytics/src/analytics_internal.h"
#include "analytics/src/include/firebase/analytics.h"
#include "app/src/assert.h"
#include "app/src/include/firebase/app.h"
Expand Down Expand Up @@ -165,6 +166,8 @@ namespace internal {
// Determine whether the analytics module is initialized.
bool IsInitialized() { return g_app != nullptr; }

bool IsAnalyticsDllLoaded() { return false; }

} // namespace internal

// Clean up the API.
Expand Down
9 changes: 9 additions & 0 deletions analytics/src/analytics_desktop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "analytics/src/analytics_common.h"
#include "analytics/src/analytics_desktop_dynamic.h"
#include "analytics/src/analytics_internal.h"
#include "analytics/src/include/firebase/analytics.h"
#include "app/src/future_manager.h" // For FutureData
#include "app/src/include/firebase/app.h"
Expand Down Expand Up @@ -124,6 +125,14 @@ void Initialize(const App& app) {

namespace internal {

bool IsAnalyticsDllLoaded() {
#if defined(_WIN32)
return g_analytics_module != 0;
#else
return false;
#endif // defined(_WIN32)
}

// Determine whether the analytics module is initialized.
bool IsInitialized() { return g_initialized; }

Expand Down
32 changes: 32 additions & 0 deletions analytics/src/analytics_internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef FIREBASE_ANALYTICS_SRC_ANALYTICS_INTERNAL_H_
#define FIREBASE_ANALYTICS_SRC_ANALYTICS_INTERNAL_H_

namespace firebase {
namespace analytics {
namespace internal {

// Checks if the Analytics DLL is loaded.
// Returns true if the DLL is loaded and functions are available.
// Returns false otherwise (e.g. on non-Windows desktop platforms or if loading
// failed).
bool IsAnalyticsDllLoaded();

} // namespace internal
} // namespace analytics
} // namespace firebase

#endif // FIREBASE_ANALYTICS_SRC_ANALYTICS_INTERNAL_H_
3 changes: 3 additions & 0 deletions analytics/src/analytics_ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "analytics/src/include/firebase/analytics.h"

#include "analytics/src/analytics_common.h"
#include "analytics/src/analytics_internal.h"
#include "app/src/assert.h"
#include "app/src/include/firebase/internal/mutex.h"
#include "app/src/include/firebase/version.h"
Expand Down Expand Up @@ -133,6 +134,8 @@ void Initialize(const ::firebase::App& app) {
// Determine whether the analytics module is initialized.
bool IsInitialized() { return g_initialized; }

bool IsAnalyticsDllLoaded() { return false; }

} // namespace internal

// Terminate the API.
Expand Down
2 changes: 1 addition & 1 deletion scripts/gha/build_testapps.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ def _build_apple(
"--XCodeCPP.frameworks", ",".join(framework_paths)
]
# Internal integration tests require the SDK root as an include path.
if repo_dir and api_config.internal_testapp_path:
if repo_dir:
xcode_patcher_args.extend(("--XCodeCPP.include", repo_dir))
if os.path.isfile(entitlements_path): # Not all testapps require entitlements
logging.info("Entitlements file detected.")
Expand Down
Loading