2013-02-04 6 views
8

私が作業しているプロジェクトでどのGtestのバージョンが使用されているかを知るにはどうすればよいですか?私はLinuxプラットフォームで作業しています。gtestを確立する

+0

あなたは結核ですか? –

+0

@BЈовићリンクする – Baz

+0

プロジェクト内でgtestのどのファイルが見えますか?あなたはgtest/gtest.hが入っているフォルダを見つけることができますか? – Strubbl

答えて

0

gtestのホームディレクトリにあるCHANGESファイルにはgtestバージョン番号が含まれています。

1

libgtestまたはlibgtest_mainのライブラリには、バージョンを認識できる特別な機能(GetGTestVersion()など)が含まれていません。 また、ヘッダファイルには識別子がありません(GTEST_VERSIONなど)。 したがって、実行時にユーザコード内でGoogle C++ Testing Frameworkのバージョンを確認することはできません。使用例が含まれても

... 
Installation Queries: 
... 
--version the version of the Google Test installation 

Version Queries: 
--min-version=VERSION return 0 if the version is at least VERSION 
--exact-version=VERSION return 0 if the version is exactly VERSION 
--max-version=VERSION return 0 if the version is at most VERSION 
... 

スクリプトを:このスクリプトは、バージョンと接続され、いくつかのオプションを持っている他のもののうち、

... 
provides access to the necessary compile and linking 
flags to connect with Google C++ Testing Framework, both in a build prior to 
installation, and on the system proper after installation. 
... 

しかし、メンテナは、フレームワークの特別なスクリプトscripts/gtest-confの一部として提供しますその:

Examples: 
gtest-config --min-version=1.0 || echo "Insufficient Google Test version." 
... 

スクリプトgtest-configを使用して、ビルド時にフレームワークのバージョンをテストできます。

スクリプトgtest-configconfigure.acで宣言された変数によって設定時にフレームワークの実際のバージョンを取得します。

... 
AC_INIT([Google C++ Testing Framework], 
     [1.7.0], 
     [[email protected]], 
     [gtest]) 
... 

そして人口configureファイル内autoconf次の識別子を呼び出した後

... 
# Identity of this package. 
PACKAGE_NAME='Google C++ Testing Framework' 
PACKAGE_TARNAME='gtest' 
PACKAGE_VERSION='1.7.0' 
PACKAGE_STRING='Google C++ Testing Framework 1.7.0' 
PACKAGE_BUGREPORT='[email protected]' 
PACKAGE_URL='' 
... 
# Define the identity of the package. 
PACKAGE='gtest' 
VERSION='1.7.0' 
... 

は限りオプション AC_CONFIG_HEADERSでコンパイルされたフレームワークは、この識別子は、ファイル build-aux/config.hに保存され、コンパイル時にユーザーのためのavailiable。

関連する問題