Skip to content

Commit 3af7b39

Browse files
solidgoldbombpeabody124
authored andcommitted
python: add basic test for UAVOCollection class
Conflicts: python/test.py
1 parent be17eaa commit 3af7b39

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ $(eval $(call SIM_TEMPLATE,openpilot,OpenPilot,'op ',win32,exe))
878878
##############################
879879

880880
ALL_UNITTESTS := logfs i2c_vm misc_math sin_lookup coordinate_conversions
881+
ALL_PYTHON_UNITTESTS := python_ut_test
881882

882883
UT_OUT_DIR := $(BUILD_DIR)/unit_tests
883884

@@ -897,7 +898,7 @@ all_ut_tap: all_ut_xml
897898
all_ut_xml: $(addsuffix _xml, $(addprefix ut_, $(ALL_UNITTESTS)))
898899

899900
.PHONY: all_ut_run
900-
all_ut_run: $(addsuffix _run, $(addprefix ut_, $(ALL_UNITTESTS)))
901+
all_ut_run: $(addsuffix _run, $(addprefix ut_, $(ALL_UNITTESTS))) $(ALL_PYTHON_UNITTESTS)
901902

902903
.PHONY: all_ut_gcov
903904
all_ut_gcov: | $(addsuffix _gcov, $(addprefix ut_, $(ALL_UNITTESTS)))
@@ -954,6 +955,11 @@ endef
954955
# Expand the unittest rules
955956
$(foreach ut, $(ALL_UNITTESTS), $(eval $(call UT_TEMPLATE,$(ut))))
956957

958+
.PHONY: python_ut_test
959+
python_ut_test:
960+
$(V0) @echo " PYTHON_UT test.py"
961+
$(V1) $(PYTHON) python/test.py
962+
957963
# Disable parallel make when the all_ut_run target is requested otherwise the TAP
958964
# output is interleaved with the rest of the make output.
959965
ifneq ($(strip $(filter all_ut_run,$(MAKECMDGOALS))),)

python/test.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#!/usr/bin/python -B
22

3-
# Insert the parent directory into the module import search path.
4-
import os
5-
import sys
6-
sys.path.insert(1, os.path.dirname(sys.path[0]))
7-
83
def main():
94

105
# Load the UAVO xml files in the workspace

0 commit comments

Comments
 (0)