Skip to content

Instantly share code, notes, and snippets.

@natanaeljr
Created January 27, 2019 14:29
Show Gist options
  • Save natanaeljr/52fcf0436c060bcfe05ddf68a3c59093 to your computer and use it in GitHub Desktop.
Save natanaeljr/52fcf0436c060bcfe05ddf68a3c59093 to your computer and use it in GitHub Desktop.
#!/bin/bash
## Setup GTest/GMock
set -Eeuxo pipefail
# Require root
[ "$UID" -eq 0 ] || exec sudo "$0" "$@"
# Check required packages are installed
dpkg -s libgtest-dev
# Save current directory
pushd $(pwd)
# Build and install GoogleTest
cd /usr/src/googletest
cmake CMakeLists.txt
make
make install
# Rollback to entrance directory
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment