Menu

Unit_Testing_for_Linux_Platform

There is a newer version of this page. You can find it here.

Unit Testing for Linux Platform

This page discusses how to set up Google Test for Magic Lantern code targeting the Linux platform.

Setting up Google Test

Instructions for building and installing Google Test can be found in the README file (https://github.com/google/googletest/blob/master/googletest/README.md). The information in this wiki page supplements that document.

Make sure that 'git' is installed since the source will be retrieved from GitHub.

$ sudo apt-get install git

Retrieve the source:

$ git clone https://github.com/google/googletest.git

Change your working directory to where you cloned the git repository and create the envrironment variable GTEST_DIR:

$ cd googletest
$ export GTEST_DIR=pwd/googletest
$ cd $GTEST_DIR

Build the Google Test library, libgtest.a:

$ cd $GTEST_DIR
$ g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} -pthread -c ${GTEST_DIR}/src/gtest-all.cc
$ ar -rv libgtest.a gtest-all.o

Executing libmlmath Tests

Google Test Resources


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.