Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Unit tests  (Read 17269 times)

0 Members and 1 Guest are viewing this topic.

Hiura

  • Moderator
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Unit tests
« Reply #45 on: April 29, 2015, 07:06:54 pm »
@Tank: I'm just wondering if some of us -- probably you in fact -- have more experience with techniques involving mock objects and could help defining a good strategy for tests.

I did some TDD a few years back for some Android app (a class project) but tbh I didn't like it. Although it was most probably because we were not properly taught how to do it.
SFML / OS X developer

Tank

  • Moderator
  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
    • Blog
    • Email
Re: Unit tests
« Reply #46 on: April 30, 2015, 01:58:29 pm »
I've done some work on such things, yeah. Not much with C++, but I guess there are always ways. I could work something out I guess. Any idea for a concrete code location? Maybe window creation code or something?

eXpl0it3r

  • Moderator
  • Hero Member
  • *****
  • Posts: 9938
    • View Profile
    • development blog
    • Email
Re: Unit tests
« Reply #47 on: May 01, 2015, 03:36:11 pm »
Now that my PC is currently building SFML including the unit test branch, I noticed an issue that I had as well back when working with FlexWorld.

If you build the unittest application with SFML linked shared and then try to run it, the unittest, won't know where the shared libraries are and will simply crash.
It's essentially useless when we allow running the test directly after building SFML shared.

Question is, do simply prevent the unittests from running with shared libraries or do we copy things around in the build directory so the sfmltest application will actually find the proper libraries?
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

Tank

  • Moderator
  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
    • Blog
    • Email
Re: Unit tests
« Reply #48 on: May 04, 2015, 09:10:30 am »
At least on Linux, the RPATH takes care of it, so that libraries don't have to be copied. Instead the full path to the libs is stored in the ELF file. I don't know how it works on Windows, though. If it's an issue, copying should work.

Quote from: eXpl0it3r
do simply prevent the unittests from running with shared libraries
That's simple indeed, but misses the point of unit testing. ;)

eXpl0it3r

  • Moderator
  • Hero Member
  • *****
  • Posts: 9938
    • View Profile
    • development blog
    • Email
Re: Unit tests
« Reply #49 on: October 10, 2015, 04:51:16 pm »
So anyone willing to update the branch, address the issue of shared libraries and create a PR? ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

eXpl0it3r

  • Moderator
  • Hero Member
  • *****
  • Posts: 9938
    • View Profile
    • development blog
    • Email
Re: Unit tests
« Reply #50 on: August 15, 2018, 11:22:26 pm »
I just move this topic from internal discussions years ago into the public "SFML development" sub-forum, as the foundation for unit testing as discussed and implemented in this thread, will finally be merged in SFML 2.6.0.

See also the SFML Test Strategy thread.
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

 

anything