3

We are working with Marmalade SDK in Visual Studio and sharing files via git with a team. And we would love to use unit tests.

There are many possibilities

  • We tried to implement unit tests with built-in function of Visual Studio, so we just created a new test project in same solution. Everything looked fine until we try to included Marmalade SDK files. There was a problem with compiler. Marmalade SDK generates his own project properties, there are compilers like "ARM (x86) Debug" and many more, and in Test project are just defaults like Debug, Release. So the code can't be compiled correctly. Can I just copy those properties to Test project? Will it work? It will be much better if we will find answer on this option.

  • But also, we can use some unit test c++ framework. Link it in same main project as Marmalade SDK create. But which framework will be the best? There are plenty of them and I couldn't find out what will be the best. Also, we will need to do special main.cpp for running unit tests, right? If you can provide best test framework for easy to implement in Visual Studio with some tutorial I will really appreciate it.

Thank you for any answer!

Petr Brazdil
  • 231
  • 2
  • 10
  • I've just started with Marmalade SDK. But for other projects we use C++ Google Test framrwork for unit testing. We have new project for unit tests and it's own entry point file (main.cpp), that creates test suite and runs it. To reference the project, which you want to test, you should share the headers and .lib (object file) files with TestProject, so the C++ compiler is able to find your classes and linker is able to bind tests with classes. – ajukraine Dec 24 '12 at 14:29

1 Answers1

0

I am trying here to explain how we use version control in marmalade projects, however I'd really like to know if there's any better solution.

We use tortoise svn on all our client machines and Visual SVN server on server. We generally update and commit from windows explorer context menu, not from inside the visual studio, as we've experienced some problem in past.

While testing, we generally make a new repository or work with the current one.

0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184
  • "While testing, we generally make a new repository or work with the current one."... can you please specify how? Are you using Visual Studio test project? How do you include marmalade SDK? – Petr Brazdil Oct 02 '12 at 10:08
  • And about SVN, we are sharing files outside of visual studio build. And we don't push visual studio build folder to SVN. Because after clicking on mkb it generates new build for specific computer, so this way help us to overcome problems with absolute paths for specific computer. – Petr Brazdil Oct 02 '12 at 10:11
  • Well, we never use visual studio build folder, we open projects using mkb only, thus it eliminates the dependency on visual studio environment. Also for test project, we just make a new test repository on svn and use the same for testing. When testing is completed, the code is merged with main project/repository. The same main repository is used sometimes, with different location on client machine depending on minority of the test. – 0xC0DED00D Oct 02 '12 at 10:26
  • 1
    Can you be more specific about unit test implementation? Are you using any Unit Test framework or just Visual Studio test project? How you link Marmalade SDK into it? – Petr Brazdil Oct 02 '12 at 13:59