space-concordia-robotics / robotics-prototype

Teleoperated Mars rover with autonomous capabilities intended for robotics competitions.
https://spaceconcordia.github.io/robotics.html
25 stars 18 forks source link

Cxx unit testing 471 #506

Closed steamypotato closed 3 years ago

steamypotato commented 3 years ago

Assignee Section

Description

Unit testing for C++ code. This PR will include a basic example test directory in science just for testing purposes. Check the wiki (/wiki/CXX-----Unit-Testing) for a detailed explanation on how everything works.

Steps for Testing

  1. mkdir build && cd build (in robot/rover)
  2. cmake .. (Make sure the installation of AUnit and UnixHostDuino are logged)
  3. make (We are looking for the 'ScienceTests' target to be built)
  4. cd ../science/tests
  5. make
  6. ./ScienceTests.out (Check that tests run)
  7. make clean

closes #471

Reviewer Section Aside from local testing and the General Integration Test it is implied that static analysis should be included in the verification process.

VimFreeman commented 3 years ago

screenshot Is this expected behaviour?

steamypotato commented 3 years ago

screenshot Is this expected behaviour?

yup i've had this bug for a while, it happens when you cross compile in cmake, its just a visual bug it doesn't affect anything although I havent found a solution for it yet

VimFreeman commented 3 years ago

Just tested again, this time on step 6, I do not have a file called ScienceTests.out in the science/tests directory

MartensCedric commented 3 years ago

@steamypotato could you fix this because Im gonna make unit tests

MartensCedric commented 3 years ago

you have conflicts but you're done

MartensCedric commented 3 years ago

@steamypotato the tests fail, could you 1) make it so the tests dont fail, 2) make sure that if travis fails, github CI also fails (something is clearly wrong in github CI if only travis fails!)

MartensCedric commented 3 years ago

tim orally approves