LoginSignup
8
8

More than 5 years have passed since last update.

cppUTest のインストール

Posted at

cppUTestのインストールが案外てこずった。ググるとけっこう情報があるんだけどそれらの通りにやるとうまくいかなくて、結局配布元に書いてある通りにやったらできた。

環境:Mac OS 10.9.4

home brew でインストール

brew install cpputest 

これでうまくいけばいいんだけどなんかエラー出てうまくいかなかった。

ソースコードからビルド

インストールできなかったのでソースコードからビルドする。
まず github から適当なフォルダに clone、パスに空白が入らないように。

git clone git://github.com/cpputest/cpputest.git 

必要なものをインストール。

brew install automake  
brew install autoconf  
brew install libtool  

cpputest_build ディレクトリに移動してmake。

cd cpputest_build 
autoreconf .. -i 
../configure $ make

おわり。

スクリプトのインストール

cppUTest には便利なスクリプトがついていて、それらをつかえるようにする。
まず環境変数 CPPUTEST_HOME の設定をする。vim で.bash_profileを開いて、

vim ~/.bash_profile 

環境変数を追記する(cppUTestのディレクトリを指定)

export CPPUTEST_HOME=$HOME/tools/cpputest

vimを閉じて.bash_profileを読みこむとcppUTestのホームディレクトリが環境変数に追記される。

source ~/.bash_profile

スクリプトのインストールをするのでスクリプトに実行権限を与える。

cd $CPPUTEST_HOME/scripts
chmod -x *.sh

スクリプトをインストールする用のスクリプトが用意されているので実行。

./InstallScripts.sh

おわり。これで $ NewCModule hogehoge みたいなかんじで使えるようになる。

まとめ

だいたい公式サイトに書いてあるとおりにやったらできた。でも英語読むの嫌だから日本語情報を探してたらいろいろとはまった。最初から英語を読んでおけばよかった。

8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8