3

私は現在JavaScriptに取り組んでおり、JavaScriptの単体テストを設計したいと考えています。google-JS-Testを使用しています。

http://code.google.com/p/google-js-test/

gjstest-1.0.7をダウンロードしました

必要なすべての前提条件をインストールしました。

http://code.google.com/p/google-js-test/wiki/Installing#Prerequisites

しかし、私がグーグルjsテストをインストールするとき

$ cd gjstest-1.0.7 
$ make

次のエラーが発生しました

g++ -DHASH_NAMESPACE=__gnu_cxx -lrt -I. -I/usr/include/libxml2 -DDEFAULT_DATA_DIR=/usr/local/share/gjstest  -c -o gjstest/internal/cpp/v8_utils.o gjstest/internal/cpp/v8_utils.cc
gjstest/internal/cpp/v8_utils.cc:33: error: ‘v8::StackFrame’ has not been declared
gjstest/internal/cpp/v8_utils.cc:34: error: ‘v8::StackTrace’ has not been declared
gjstest/internal/cpp/v8_utils.cc: In function ‘void gjstest::ConvertToStringVector(const v8::Handle<v8::Value>&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)’:
gjstest/internal/cpp/v8_utils.cc:60: error: no matching function for call to ‘v8::Array::Get(uint32&)’
/usr/include/v8.h:1161: note: candidates are: v8::Local<v8::Value> v8::Object::Get(v8::Handle<v8::Value>)
make: *** [gjstest/internal/cpp/v8_utils.o] Error 1

v8が正しくインストールされていないようです

次のようなコマンドを使用してV8をインストールしました

sudo apt-get install libv8-2.0.3 
sudo apt-get install libv8-dbg 
sudo apt-get install libv8-dev 

そしてまたそれをダウンロードすることによって

svn checkout http://v8.googlecode.com/svn/trunk/ v8
cd v8
make dependencies
scons

しかし、それでもこれらのエラーが発生します

したがって、誰かがGoogle Jsをインストールして使用したり、v8をインストールしたりした場合は、この問題を解決する方法を教えてください。

Ubuntu10.04を使用しています。どんな助けでもありがたいです。

4

1 に答える 1

1

これは確かに、非常に古いバージョンのlibv8に対してgjstestをビルドしようとしたことが原因です。

私はここの指示に従って、ubuntu 10.04でより新しいlibv8をチェックアウトし、構築しました:

svn checkout http://v8.googlecode.com/svn/trunk/ v8
cd v8
make depdendencies
make native library=shared
cp out/native/lib.target/libv8.so /usr/local/lib/libv8.so
cp include/v8.h /usr/local/include/v8.h
cp include/v8stdint.h /usr/local/include/v8stdint.h

その後、gjstestはコンパイルされ、さらに驚くことなく実行されました。

于 2012-08-27T20:08:53.823 に答える