Skip to content
This repository has been archived by the owner on Jul 17, 2019. It is now read-only.

Mock class generation by running the script #220

Open
mohammadbari opened this issue Jan 9, 2019 · 0 comments
Open

Mock class generation by running the script #220

mohammadbari opened this issue Jan 9, 2019 · 0 comments

Comments

@mohammadbari
Copy link

Hi,

i tried to run the script by following the instructions mentioned here -

https://github.com/google/googletest/tree/master/googlemock/scripts/generator

I ended up some errors, does not know what causing it or how to solve it. Can someone reply about it if you are already familiar about the errors?

./gmock_gen.py iHandler.h iHandler
Got exception in iHandler.h @ Token('class', 36, 41) []
Traceback (most recent call last):
File "C:\Workspace\googletest\googlemock\scripts\generator\cpp\ast.py", line 706, in Generate
token = self._GetNextToken()
File "C:\Workspace\googletest\googlemock\scripts\generator\cpp\ast.py", line 908, in _GetNextToken
return next(self.tokens)
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "./gmock_gen.py", line 31, in
gmock_class.main()
File "C:\Workspace\googletest\googlemock\scripts\generator\cpp\gmock_class.py", line 222, in main
lines = _GenerateMocks(filename, source, entire_ast, desired_class_names)
File "C:\Workspace\googletest\googlemock\scripts\generator\cpp\gmock_class.py", line 129, in _GenerateMocks
for node in ast_list:
File "C:\Workspace\googletest\googlemock\scripts\generator\cpp\ast.py", line 720, in Generate
result = self._GenerateOne(token)
File "C:\Workspace\googletest\googlemock\scripts\generator\cpp\ast.py", line 743, in _GenerateOne
return method()
File "C:\Workspace\googletest\googlemock\scripts\generator\cpp\ast.py", line 1458, in handle_class
return self._GetClass(Class, VISIBILITY_PRIVATE, None)
File "C:\Workspace\googletest\googlemock\scripts\generator\cpp\ast.py", line 1540, in _GetClass
body = list(ast.Generate())
RuntimeError: generator raised StopIteration


I tried with different python versions and found different errors with different versions.

I am almost stuck at this point and can not proceed with it.
Eagerly waiting for the answer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant