Skip to content

Commit

Permalink
camerad: move ae test to pytest/catch2 (commaai#30994)
Browse files Browse the repository at this point in the history
* mv ae gray test

* cleanup
  • Loading branch information
adeebshihadeh authored Jan 13, 2024
1 parent 66ddfec commit 3e601b5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/selfdrive_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ jobs:
$PYTEST --timeout 30 -m 'not slow' && \
./selfdrive/ui/tests/create_test_translations.sh && \
QT_QPA_PLATFORM=offscreen ./selfdrive/ui/tests/test_translations && \
./selfdrive/ui/tests/test_translations.py && \
./system/camerad/test/ae_gray_test"
./selfdrive/ui/tests/test_translations.py"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ testpaths = [
"selfdrive/thermald",
"selfdrive/test/longitudinal_maneuvers",
"selfdrive/test/process_replay/test_fuzzy.py",
"system/camerad",
"system/hardware/tici",
"system/loggerd",
"system/proclogd",
Expand Down
2 changes: 1 addition & 1 deletion system/camerad/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ camera_obj = env.Object(['cameras/camera_qcom2.cc', 'cameras/camera_common.cc',
env.Program('camerad', ['main.cc', camera_obj], LIBS=libs)

if GetOption("extras") and arch == "x86_64":
env.Program('test/ae_gray_test', ['test/ae_gray_test.cc', camera_obj], LIBS=libs)
env.Program('test/test_ae_gray', ['test/test_ae_gray.cc', camera_obj], LIBS=libs)
1 change: 1 addition & 0 deletions system/camerad/test/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
jpegs/
test_ae_gray
17 changes: 0 additions & 17 deletions system/camerad/test/ae_gray_test.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// unittest for set_exposure_target

#include "system/camerad/test/ae_gray_test.h"
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"

#include <cassert>

Expand All @@ -10,7 +9,25 @@
#include "common/util.h"
#include "system/camerad/cameras/camera_common.h"

int main() {
#define W 240
#define H 160


#define TONE_SPLITS 3

float gts[TONE_SPLITS * TONE_SPLITS * TONE_SPLITS * TONE_SPLITS] = {
0.917969, 0.917969, 0.375000, 0.917969, 0.375000, 0.375000, 0.187500, 0.187500, 0.187500, 0.917969,
0.375000, 0.375000, 0.187500, 0.187500, 0.187500, 0.187500, 0.187500, 0.187500, 0.093750, 0.093750,
0.093750, 0.093750, 0.093750, 0.093750, 0.093750, 0.093750, 0.093750, 0.917969, 0.375000, 0.375000,
0.187500, 0.187500, 0.187500, 0.187500, 0.187500, 0.187500, 0.093750, 0.093750, 0.093750, 0.093750,
0.093750, 0.093750, 0.093750, 0.093750, 0.093750, 0.093750, 0.093750, 0.093750, 0.093750, 0.093750,
0.093750, 0.093750, 0.093750, 0.093750, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
0.000000};


TEST_CASE("camera.test_set_exposure_target") {
// set up fake camerabuf
CameraBuf cb = {};
VisionBuf vb = {};
Expand Down Expand Up @@ -63,5 +80,4 @@ int main() {
assert(passed);

delete[] fb_y;
return 0;
}

0 comments on commit 3e601b5

Please sign in to comment.