I've followed the build instructions in the README file and the cpp source seems to build fine, but when the python tests try to run there is a scons error. I've tried using scons 1.0.0 and (currently) trying scons 0.98.5.
I understand the python error (calling a string method on a list object), but I don't really see what the solution is. I've also tried running the .py test files on their own and this leads to various other issues. Seems like I should be able to run the tests using the scons script though!
matt@pike:~/code/lognet/jsoncpp$ ./scons.py platform=linux-gcc check
scons: Reading SConscript files ...
Using platform 'linux-gcc-4.1.3'
LD_LIBRARY_PATH = :libs/linux-gcc-4.1.3
Building using PLATFORM = linux-gcc-4.1.3
scons: warning: The env.Copy() method is deprecated; use the env.Clone() method
instead.
File "/home/matt/code/lognet/jsoncpp/SConstruct", line 193, in <module>
scons: done reading SConscript files.
scons: Building targets ...
RunJSONTests("[<SCons.Node.FS.File instance at 0xb781706c>]")
scons: *** [check] Exception
Traceback (most recent call last):
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Taskmaster.py",
line 222, in execute
self.targets[0].build()
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Node/__init__.py
", line 372, in build
apply(self.get_executor(), (self,), kw)
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Executor.py", li
ne 145, in __call__
return self.do_execute(target, kw)
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Executor.py", li
ne 131, in do_execute
status = apply(act, (self.targets, self.get_sources(), env), kw)
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Action.py", line
468, in __call__
stat = self.execute(target, source, env)
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Action.py", line
846, in execute
result = self.execfunction(target=target, source=rsources, env=env)
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Action.py", line
991, in __call__
return apply(self.parent.actfunc, args, kw)
File "/home/matt/code/lognet/jsoncpp/SConstruct", line 235, in runJSONTests_ac
tion
return runjsontests.runAllTests( os.path.abspath(source), jsontest_path )
File "posixpath.py", line 402, in abspath
if not isabs(path):
File "posixpath.py", line 49, in isabs
return s.startswith('/')
AttributeError: 'list' object has no attribute 'startswith'
scons: building terminated because of errors.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've followed the build instructions in the README file and the cpp source seems to build fine, but when the python tests try to run there is a scons error. I've tried using scons 1.0.0 and (currently) trying scons 0.98.5.
I understand the python error (calling a string method on a list object), but I don't really see what the solution is. I've also tried running the .py test files on their own and this leads to various other issues. Seems like I should be able to run the tests using the scons script though!
matt@pike:~/code/lognet/jsoncpp$ ./scons.py platform=linux-gcc check
scons: Reading SConscript files ...
Using platform 'linux-gcc-4.1.3'
LD_LIBRARY_PATH = :libs/linux-gcc-4.1.3
Building using PLATFORM = linux-gcc-4.1.3
scons: warning: The env.Copy() method is deprecated; use the env.Clone() method
instead.
File "/home/matt/code/lognet/jsoncpp/SConstruct", line 193, in <module>
scons: done reading SConscript files.
scons: Building targets ...
RunJSONTests("[<SCons.Node.FS.File instance at 0xb781706c>]")
scons: *** [check] Exception
Traceback (most recent call last):
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Taskmaster.py",
line 222, in execute
self.targets[0].build()
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Node/__init__.py
", line 372, in build
apply(self.get_executor(), (self,), kw)
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Executor.py", li
ne 145, in __call__
return self.do_execute(target, kw)
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Executor.py", li
ne 131, in do_execute
status = apply(act, (self.targets, self.get_sources(), env), kw)
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Action.py", line
468, in __call__
stat = self.execute(target, source, env)
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Action.py", line
846, in execute
result = self.execfunction(target=target, source=rsources, env=env)
File "/home/matt/code/lognet/jsoncpp/scons-local-0.98.5/SCons/Action.py", line
991, in __call__
return apply(self.parent.actfunc, args, kw)
File "/home/matt/code/lognet/jsoncpp/SConstruct", line 235, in runJSONTests_ac
tion
return runjsontests.runAllTests( os.path.abspath(source), jsontest_path )
File "posixpath.py", line 402, in abspath
if not isabs(path):
File "posixpath.py", line 49, in isabs
return s.startswith('/')
AttributeError: 'list' object has no attribute 'startswith'
scons: building terminated because of errors.
OK. In case anyone else encounters this problem... I ended up giving up on Scons and just invoking the unit tests directly.
Set LD_LIBRARY_PATH to contain the path to the .so:
export LD_LIBRARY_PATH=/home/matt/code/lognet/jsoncpp/libs/linux-gcc-4.1.3
invoke runjsontests.py with the path to jsontestrunner as the only argument, like so:
matt@pike:~/code/lognet/jsoncpp/test$ python runjsontests.py /home/matt/code/lognet/jsoncpp/bin/linux-gcc-4.1.3/jsontestrunner
(obviously, replace /home/matt/code/lognet with your own root)
All the test are running/passing for me now after doing the above.