Author Topic: problems with gae in eclipse  (Read 1105 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,239
    • View Profile
    • http://www.titusgames.de
problems with gae in eclipse
« on: 12 February 2010, 23:10:23 »
I have some problems to setup GAE in eclipse.

I get these errors, whats that?
Looks like some unit test things ...? What is cppunit and why is it needed?
Code: [Select]
../source/test/main.cpp:22:32: Warnung: cppunit/TestRunner.h: No such file or directory
../source/test/main.cpp:23:32: Warnung: cppunit/TestResult.h: No such file or directory
../source/test/main.cpp:24:41: Warnung: cppunit/TestResultCollector.h: No such file or directory
../source/test/main.cpp:25:45: Warnung: cppunit/extensions/HelperMacros.h: No such file or directory
../source/test/main.cpp:26:47: Warnung: cppunit/BriefTestProgressListener.h: No such file or directory
../source/test/main.cpp:27:52: Warnung: cppunit/extensions/TestFactoryRegistry.h: No such file or directory
../source/test/main.cpp:50:2: Warnung: Kein Newline am Dateiende
../source/test/main.cpp: In function »int main()«:
../source/test/main.cpp:32: Fehler: »CPPUNIT_NS« wurde nicht deklariert
../source/test/main.cpp:32: Fehler: expected `;' before »controller«
../source/test/main.cpp:35: Fehler: »CPPUNIT_NS« wurde nicht deklariert
../source/test/main.cpp:35: Fehler: expected `;' before »result«
../source/test/main.cpp:36: Fehler: »controller« wurde in diesem Gültigkeitsbereich nicht definiert
../source/test/main.cpp:36: Fehler: »result« wurde in diesem Gültigkeitsbereich nicht definiert
../source/test/main.cpp:39: Fehler: »CPPUNIT_NS« wurde nicht deklariert
../source/test/main.cpp:39: Fehler: expected `;' before »progress«
../source/test/main.cpp:40: Fehler: »progress« wurde in diesem Gültigkeitsbereich nicht definiert
../source/test/main.cpp:43: Fehler: »CPPUNIT_NS« wurde nicht deklariert
../source/test/main.cpp:43: Fehler: expected `;' before »runner«
../source/test/main.cpp:44: Fehler: »runner« wurde in diesem Gültigkeitsbereich nicht definiert
../source/test/main.cpp:44: Fehler: »CPPUNIT_NS« wurde nicht deklariert
../source/test/main.cpp:47: Fehler: »system« wurde in diesem Gültigkeitsbereich nicht definiert
« Last Edit: 12 February 2010, 23:26:32 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: problems with gae in eclipse
« Reply #1 on: 13 February 2010, 00:26:58 »
cppunit is a unit test framework (which I am VERY impressed to see exists in gae!). Likely just need to do:

sudo apt-get install libcppunit-dev

and the libs should be there.

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: problems with gae in eclipse
« Reply #2 on: 13 February 2010, 01:34:29 »
hehe... don't get to carried away, there is a template in there, that's about all.  I did actually write some tests for parts of the pathfinder and for InfuenceMaps (which was an experiment with 'test-driven' development, [ie, you write the tests first] a very good idea), I need to retrieve them from the old pathfinder branch.  There are numerous problems trying to test some things though, there is a lot a of interdependence of objects which makes it hard to test some things in isolation.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: problems with gae in eclipse
« Reply #3 on: 13 February 2010, 02:12:12 »
I use TDD all the time... NUnit, cppUnit, JUnit FIT, etc.. and I think it brings tremendous value to any product!

Two ways to write your tests:

#1) working with legacy (existing code) you need to use tricks like dependency injection, etc to stub in pretend mock objects for the dependencies you don't care about for your test.

#2) write the code as isolated as you can and pass interfaces or light entities.

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: problems with gae in eclipse
« Reply #4 on: 13 February 2010, 10:17:52 »
#1) working with legacy (existing code) you need to use tricks like dependency injection, etc to stub in pretend mock objects for the dependencies you don't care about for your test.
I think this may be the only way to go for some parts of engine, I never thought of adding 'dummy' objects, and never researched it sufficiently... It sure will be nice to have someone around who knows what they're doing with this kind of stuff :)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

 

anything