RAD Studio 12.0 and GoogleTest Unit Testing Framework – How to Compile Earlier Version

If you are an owner of RAD Studio 11 (or C++ Builder 11) and you followed my suggested setup for GoogleTests, creating local copies of the GoogleTest library with each project as described in my blogs of 25th March:

Tips For Using GoogleTests with Embarcadero Clang64 for Windows VCL Projects.

then you will already have a local copy of the GoogleTest framework downloaded from Getit (using RAD Studio 11). This is stored in your getit repository, typically

C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\GoogleTest-2021.09

I will call this long path ”…GT2021.09” for the rest of this blog. You can take this code and rebuild it using RAD Studio 12 and then update your projects with the newly built GoogleTest library files.

Proceed as follows.

1) Copy folder …GT2021.09 to a convenient new location, say …Projects\GoogleTest-2021.09

2) So you know (in the future) what the folder is, rename it to ..Projects\GoogleTest_12_from_11

3) Start up RAD Studio 12.0 (or C++ Builder 12.0).

4) Open up project group Googletest.groupproj which is in folder ..Projects\GoogleTest_12_from_11

5) Change all of the project targets to Windows 64 bit (*** see note below)

6) Do a “Build All Projects”. It will build all the projects without any errors.

7) Use file explorer to navigate to ..Projects\GoogleTest_12_from_11\cbuilder\bin\Win64\Release
and confirm that there is file sample8_unittest.exe

8) Open up a windows shell command window and run this sample8_unittest.exe file.
You should see a “passed all 12 tests” message. This confirms that all is well.

9) Replace gmock.a, gmock_main.a, gtest.a and gtest_main.a in your working folder (typically)

project_folder\Unit tests\GoogleTest\LibWin64

with newly compiled versions from ..Projects\GoogleTest_12_from_11\cbuilder\lib\Win64\Release

Notes.

*** (item 5 above) I have only tried this for Windows 64 bit applications. But it is sure to work fine with clang32 projects too.

If you are creating a new local copy of GoogleTest for first time use with a project, I repeat my suggestion from the earlier blog:

a) Create a new sub-folder in your project_folder called “Unit tests” (use this for your unit test *.cpp files).

b) Inside project_folder\Unit tests\ create a new sub-folder called Google Tests

c) Inside project_folder\Unit tests\GoogleTest\ create a new folder called LibWin64

d) Inside project_folder\Unit tests\GoogleTest\LibWin64 copy gmock.a, gmock_main.a, gtest.a and gtest_main.a from your newly compiled folder Projects\GoogleTest_12_from_11\cbuilder\lib\Win64\Release

e) Inside project_folder\Unit tests\GoogleTest\ create a new folder called include

f) Inside project_folder\Unit tests\GoogleTest\include copy all the contents (including further sub-folders) of
Projects\GoogleTest_12_from_11\googletest\include\gtest

RAD Studio 12.0 and GoogleTest Unit Testing Framework

There’s a lot of positive news for C++ users of Embarcadero RAD Studio 12.0.

However it seems that there is currently a problem with using the Clang compilers in RAD Studio 12.0 with the GoogleTest framework on getit. The version currently (Jan 2024) available does not build correctly.

I will monitor this situation and blog here as soon as Embarcadero have a working GoogleTest framework on getit.

Useful RAD Studio 12.0 Links

There’s been a lot of blogging and video stuff related to Embarcadero RAD Studio 12.0.

I thought it might be useful to post some links in a convenient place.

How to Create an Android App in RAD Studio 12.0

What can you do with RAD Studio 12

All the New Features

Marco Cantu’s Blog

RAD Studio 12.0 is Here

The next release for Embarcadero RAD Studio is version 12.0 and it is now available.

There are lots of changes for Delphi users but the key IDE improvement for C++ users is the integration of visual assist functions which make source code editing significantly more convenient.

You can learn more about this great new version (and down load a trial) here

What’s Coming For RAD Studio 12.0 ?

The next release for Embarcadero RAD Studio will be version 12.0. As yet Embarcadero have not offered a firm date for this release but they are starting to mention in their marketing e-mails so it must be coming!

They’ve even taken the unusual step of opening up the Beta testing for 12.0 to anyone who takes out a new subscription for 11.3.

The big changes to the C++ operation that were discussed in the video mentioned in my previous posting may or may not all be in the official release of 12.0. I can’t wait to get going with the modern clang based compiler system

Embarcadero do issue the following statement in connection with all speculation about version 12.0.

Please note that all comments and statements about potential new features are subject to change and should not be relied on until the GA release of a product is available.

What’s Coming For Embarcadero C++.

There are big changes coming for Embarcadero C++. There’s a behind the scenes video at

C++ Builder Behind the Scenes Changes

that is full of exciting news.

Embarcadero do issue the following statement so we all may need to be a bit patient!

“Please note that all comments and statements about potential new features are subject to change and should not be relied on until the GA release of a product is available.”

Introduction to XML Mapper

As part of the Delphi Codeing Bootcamp I was delighted to be able to present a webinar introducing the powerful XML Mapper design tool that ships with Delphi / C++ Builder / RAD Studio.

An edited replay is available here: https://youtu.be/S4i0Vp-fQz8

Delphi Coding Bootcamp 2023.

There is a five day long Delphi Codeing Bootcamp starting today (14th Aug 2023) with lots of interesting sessions many of which will include the chance for live Q&A with experts in the field. It’s all completely free of charge.

I am presenting a session titled “Introduction to XML Mapper” today at 8:00 CDT.

More information about the bootcamp is available here

You can sign up for it here.