Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
JPScore
JPScore
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 92
    • Issues 92
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 3
    • Merge Requests 3
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • JuPedSim
  • JPScoreJPScore
  • Issues
  • #88

Closed
Open
Opened Apr 02, 2015 by Mohcine Chraibi@chraibi1Owner

Unit Test Coverage

The next step for JPSCore is to provide unit tests to make sure that every methode we write does what we expect it to do. Our pyhton scripts are only for testing our simulation model, but not the methods itself.

A Unit test should cover at least 80% of a class/cpp file (100% would be the best of course). We are using Boost.Test as our Framework. You can find a sample of a unit test written with boost in jpscore/Utest/TestClassPointBoost.cpp

The first unit tests to write are for

Point.cpp (currently 60%) JEllipse.cpp (currently 66%) Line.cpp (currently 20%) Wall.cpp (0%) Room.cpp (0%) Obstacle.cpp (0%)

Please write the tests (one file per cpp-file) from scratch with boost (except for Point, you can simply extend TestClassPointBoost).

to check the code coverage by yourself you need to install gcovr (a python script open source) and call cmake with

cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DBUILD_CPPUNIT_TEST=ON ..

after that of coure make and then ctest make ctest

after the tests where running you call gcovr "`pwd`/build/CMakeFiles/core.dir" -r . if you are in the jpscore directory.

If you have further questions let me know ;)

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: jupedsim/jpscore#88