common/tests: combine multiple test binaries into one (#29623)

old-commit-hash: 2709cd6538
beeps
Dean Lee 2 years ago committed by GitHub
parent 5385263422
commit 00f900e8c4
  1. 4
      .github/workflows/selfdrive_tests.yaml
  2. 6
      common/SConscript
  3. 4
      common/tests/.gitignore
  4. 1
      common/tests/test_ratekeeper.cc
  5. 2
      common/tests/test_runner.cc
  6. 6
      common/tests/test_swaglog.cc
  7. 2
      common/tests/test_util.cc

@ -268,9 +268,7 @@ jobs:
./selfdrive/ui/tests/create_test_translations.sh && \ ./selfdrive/ui/tests/create_test_translations.sh && \
QT_QPA_PLATFORM=offscreen ./selfdrive/ui/tests/test_translations && \ QT_QPA_PLATFORM=offscreen ./selfdrive/ui/tests/test_translations && \
./selfdrive/ui/tests/test_translations.py && \ ./selfdrive/ui/tests/test_translations.py && \
./common/tests/test_util && \ ./common/tests/test_common && \
./common/tests/test_ratekeeper && \
./common/tests/test_swaglog && \
./selfdrive/boardd/tests/test_boardd_usbprotocol && \ ./selfdrive/boardd/tests/test_boardd_usbprotocol && \
./system/loggerd/tests/test_logger &&\ ./system/loggerd/tests/test_logger &&\
./system/proclogd/tests/test_proclog && \ ./system/proclogd/tests/test_proclog && \

@ -28,9 +28,9 @@ _gpucommon = fxn('gpucommon', files)
Export('_common', '_gpucommon') Export('_common', '_gpucommon')
if GetOption('extras'): if GetOption('extras'):
env.Program('tests/test_util', ['tests/test_util.cc'], LIBS=[_common]) env.Program('tests/test_common',
env.Program('tests/test_swaglog', ['tests/test_swaglog.cc'], LIBS=[_common, 'json11', 'zmq', 'pthread']) ['tests/test_runner.cc', 'tests/test_util.cc', 'tests/test_swaglog.cc', 'tests/test_ratekeeper.cc'],
env.Program('tests/test_ratekeeper', ['tests/test_ratekeeper.cc'], LIBS=[_common, 'json11', 'zmq', 'pthread']) LIBS=[_common, 'json11', 'zmq', 'pthread'])
# Cython # Cython
envCython.Program('params_pyx.so', 'params_pyx.pyx', LIBS=envCython['LIBS'] + [_common, 'zmq', 'json11']) envCython.Program('params_pyx.so', 'params_pyx.pyx', LIBS=envCython['LIBS'] + [_common, 'zmq', 'json11'])

@ -1,3 +1 @@
test_ratekeeper test_common
test_util
test_swaglog

@ -1,4 +1,3 @@
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp" #include "catch2/catch.hpp"
#include "common/ratekeeper.h" #include "common/ratekeeper.h"
#include "common/timing.h" #include "common/timing.h"

@ -0,0 +1,2 @@
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"

@ -1,13 +1,13 @@
#include <zmq.h> #include <zmq.h>
#include <iostream> #include <iostream>
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"
#include "third_party/json11/json11.hpp" #include "catch2/catch.hpp"
#include "common/swaglog.h" #include "common/swaglog.h"
#include "common/util.h" #include "common/util.h"
#include "common/version.h" #include "common/version.h"
#include "system/hardware/hw.h" #include "system/hardware/hw.h"
#include "third_party/json11/json11.hpp"
const char *SWAGLOG_ADDR = "ipc:///tmp/logmessage"; const char *SWAGLOG_ADDR = "ipc:///tmp/logmessage";
std::string daemon_name = "testy"; std::string daemon_name = "testy";

@ -5,10 +5,10 @@
#include <algorithm> #include <algorithm>
#include <climits> #include <climits>
#include <fstream>
#include <random> #include <random>
#include <string> #include <string>
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp" #include "catch2/catch.hpp"
#include "common/util.h" #include "common/util.h"

Loading…
Cancel
Save