2012-06-21 67 views
3

我目前工作的JavaScript和想设计单元测试JavaScript的我使用谷歌,JS-测试安装谷歌的JS测试单元测试

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

我已经下载gjstest-1.0.7

我已经安装的所有先决条件的需要。

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

但是当我安装使用

$ 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 

谷歌JS测试看起来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 

但是,如果任何一个已经安装和使用谷歌的js或安装V8仍然得到这些错误

所以,请指导我应该怎么解决这个问题。

我使用的是Ubuntu 10.04。 任何帮助将不胜感激。

回答

1

这确实是试图建立gjstest对一个很老的版本libv8引起的。

我检查出来,并按照下列指示here建在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编译并没有进一步的惊喜跑。