Add missing file in CMakeLists (cheers Dan)

This commit is contained in:
30hours 2023-12-29 01:08:49 +00:00
parent 097e0e8761
commit 8ebad95509
2 changed files with 64 additions and 5 deletions

View file

@ -1,6 +1,6 @@
# blah2 Test
**TODO: Tests not implemented yet. Describing desired behaviour for the time being.**
A set of tests are provided for development/debugging.
## Framework
@ -18,14 +18,26 @@ The test files are split across directories defined by the type of test.
All tests are compiled when building, however tests be run manually.
- Run a single test case for "TestClass".
- Run a single unit test for "TestClass".
```
sudo docker compose run blah2-test TestClass
sudo docker exec -it blah2 /blah2/bin/test/unit/testClass
```
- Run all test cases.
- Run a single functional test for "TestFunctional".
```
sudo docker compose run blah2-test *
sudo docker exec -it blah2 /blah2/bin/test/functional/testFunctional
```
- Run a single comparison test for "TestComparison".
```
sudo docker exec -it blah2 /blah2/bin/test/comparison/testComparison
```
- *TODO:* Run all test cases.
```
sudo docker exec -it blah2 /blah2/bin/test/runall.sh
```

View file

@ -0,0 +1,47 @@
/// @file TestTracker.cpp
/// @brief Unit test for Tracker.cpp
/// @author 30hours
#define CATCH_CONFIG_MAIN
#include "catch_amalgamated.hpp"
#include "Detection.h"
#include "Tracker.h"
#include "Track.h"
#include <string>
#include <vector>
#include <random>
#include <iostream>
/// @brief Test constructor.
/// @details Check constructor parameters created correctly.
TEST_CASE("Constructor", "[constructor]")
{
uint32_t m = 3;
uint32_t n = 5;
uint32_t nDelete = 5;
double cpi = 0.5;
double maxAccInit = 10;
double rangeRes = 100;
Tracker tracker = Tracker(m, n, nDelete, cpi, maxAccInit, rangeRes);
}
/// @brief Test process for an ACTIVE track.
TEST_CASE("Process ACTIVE track constant acc", "[process]")
{
uint32_t m = 3;
uint32_t n = 5;
uint32_t nDelete = 5;
double cpi = 0.5;
double maxAccInit = 10;
double rangeRes = 100;
Tracker tracker = Tracker(m, n, nDelete,
cpi, maxAccInit, rangeRes);
// create detections with constant acc 5 Hz/s
std::vector<double> delay = {10};
std::vector<double> doppler = {-20};
std::string state = "ACTIVE";
}