Synodic-Software / Soul-Engine

Physically based renderer and simulation engine for real-time applications.
GNU General Public License v3.0
42 stars 24 forks source link

Create Initial Multi-threading Test(s) #85

Closed Behemyth closed 7 years ago

Behemyth commented 7 years ago

Multithreading/Scheduler.h and Scheduler.cpp need unit tests that can be used later in the project to guarantee new pull request do not break functionality. As the testing apps (Travis CI and Appveyor) are not setup, you can place a new visual studio project or files in Test/Multithreading. The project here will compile separately from the main project. For an example of how to use the boost specific code, visit https://github.com/boostorg/fiber. To examine how Soul Engine uses this, visit Source Files/Engine Core/SoulCore.cpp

To create a project, you will need to link to a boost release. I am currently using 1.64, although I plan to update to 1.65.1 in a month or two https://sourceforge.net/projects/boost/files/boost-binaries/. You can place all the contents of the binaries and headers in Libraries/boost under the root directory. In Visual Studio (which I believe you are trying to use) you have to visit the test project settings and link boost to this location.

The tests in question can start simple as you begin to learn how the system works. Maybe a simple spawning test using assert to guarantee it finishes running without a hitch and another one trying to spawn 100 fibers. More test will follow once more features are added and explored by you.

Behemyth commented 7 years ago

In fact, if you do not want to commit the Visual Studio project, you can just place the test files inside Test/Multithreading and build separately, minimizing the size of the repository.

gartea commented 7 years ago

This makes sense, ill try it out