You can skip some of the following steps if you have already installed them.
Download GoogleTest release package, extract it, and go to folder:
googletest-release-x.x.x
Run following commands
cmake -G "MinGW Makefiles"
You may have to change Mingw-w64 path in the following instructions, according to your environment.
googletest-release-x.x.x/googletest/include/gtest
and googletest-release-x.x.x/googletest/include/gmock
to C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/include/
copy googletest-release-x.x.x/lib/libgtest*.a
to C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/lib/gtest/
googletest-release-x.x.x/lib/libgmock*.a
to C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/lib/gmock/
MathLib will help you know how to use GoogleTest.