Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google tests framework for UnitTests #1277

Merged
merged 59 commits into from
Sep 20, 2023

Conversation

CedricGuillemet
Copy link
Contributor

@CedricGuillemet CedricGuillemet commented Aug 7, 2023

  • Fetch and use Google Tests package
  • Use it in UnitTests. Now the JS tests are 1 of the Google Tests
  • noop renderer for Android when no window/context provided (case of unittests)
  • Added 2 new jobs for Android that run the UnitTests in the simulator. Commented for now
  • Redirect stdout to logcat for Android
    - added life cycle test

Notes for Android:
Android Emulator freezes on the CI when running the test. It's not related to the stdout/logcat pipeline (I've tested it). And it does not repro locally.
Most of this change is the Android project.

@CedricGuillemet CedricGuillemet changed the title Google tests framework for UnitTesting Google tests framework for UnitTests Aug 7, 2023
@CedricGuillemet CedricGuillemet marked this pull request as ready for review September 19, 2023 09:09
Core/Graphics/Source/DeviceImpl.h Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
Apps/UnitTests/Shared/Tests.h Show resolved Hide resolved
Apps/UnitTests/Android/app/src/main/cpp/JNI.cpp Outdated Show resolved Hide resolved
Apps/UnitTests/Android/app/src/main/cpp/JNI.cpp Outdated Show resolved Hide resolved
Apps/UnitTests/Android/app/src/main/cpp/JNI.cpp Outdated Show resolved Hide resolved
Apps/UnitTests/Android/app/src/main/cpp/JNI.cpp Outdated Show resolved Hide resolved
Apps/UnitTests/Android/app/src/main/cpp/JNI.cpp Outdated Show resolved Hide resolved
@CedricGuillemet CedricGuillemet merged commit 420364e into BabylonJS:master Sep 20, 2023
19 checks passed
Comment on lines +69 to +75
if(WIN32)
# For Windows: Prevent overriding the parent project's compiler/linker settings
# Default build type for my test projects are /MDd (MultiThreaded DLL) but GTests default to /MTd (MultiTreaded)
# see https://github.com/google/googletest/blob/main/googletest/README.md
# "Enabling this option will make gtest link the runtimes dynamically too, and match the project in which it is included."
set(gtest_force_shared_crt OFF CACHE BOOL "" FORCE)
endif()
Copy link
Contributor

@bghgary bghgary Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: There are tabs here instead of spaces. Also spelling errors "MultiTreaded"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants