3

I am currently working on JavaScript and want to design unit test for JavaScript I am using google-JS-Test

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

I have downloaded gjstest-1.0.7

I have installed all the prerequisites need.

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

but when I install google js test using

$ cd gjstest-1.0.7 
$ make

I got following errors

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

It seems like v8 is not install correctly

I have installed V8 using commands like

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

And also by downloading it

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

But still getting these errors

So if any one has installed and used Google Js or installed v8, kindly guide me on how should I solve this problem.

I am using Ubuntu 10.04. Any help will be appreciated.

1 Answer 1

1

This is indeed caused by trying to build gjstest against a very old version of libv8.

I checked out and built a more recent libv8 on ubuntu 10.04 by following the instructions here:

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

After which gjstest compiled and ran without further surprises.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.