Coder Social home page Coder Social logo

googletest-installer's Introduction

googletest-installer

Install gtest on gh actions

Usage

action.yml:

- name: Install gtest
  uses: MarkusJx/[email protected]

On linux

  • The libraries will be located in /usr/lib
  • The headers to include will be located in /usr/include

On windows

  • The libraries will be located in D:/gtest/lib
  • The headers to include will be located in D:/gtest/include

On macOs

  • The libraries will be located in /usr/local/lib
  • The headers to include will be located in /usr/local/include

To set the correct paths, you could add to your CMakeLists.txt:

if (DEFINED ENV{GITHUB_ACTIONS})
  if (WIN32)
    link_directories("D:/gtest/lib")
    include_directories("D:/gtest/include")

    set(CMAKE_CXX_FLAGS_RELEASE "/MT")
    set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
  elseif (APPLE)
    link_directories("/usr/local/lib")
    include_directories("/usr/local/include")
  endif ()
endif ()

googletest-installer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

florianfrank

googletest-installer's Issues

Issue on windows

Hi

I tested on windows but it fails. it seems that the location where gtest will be installed is not correct.

I put the following code in my cmakelist.txt

if (DEFINED ENV{GITHUB_ACTIONS})
  if (WIN32)
    link_directories("D:/gtest/lib")
    include_directories("D:/gtest/include")

    set(CMAKE_CXX_FLAGS_RELEASE "/MT")
    set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
  elseif (APPLE)
    link_directories("/usr/local/lib")
    include_directories("/usr/local/include")
  endif ()
endif ()

CXX_Path and CC_PAH is not working.

Hello,
thanks for this nice gtest installer.
I'm using the github action to run google tests on different platforms. On windows I use MINGW instead of MSVC.
When I set the CXX_Path and CC_Path flags It detects the right compiler and sets the right CMake flags but finally builds it again using MSVC.
image

gmock not found

Hi!
You also need to copy gmock headers:

sudo cp -R googletest/googlemock/include/gmock /usr/include

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.