Skip to content

Commit 3a788b2

Browse files
committed
automatic gds start wip
1 parent ab4458d commit 3a788b2

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

FprimeZephyrReference/test/int/imu_manager_test.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,36 @@
44
Integration tests for the IMU Manager component.
55
"""
66

7+
import os
8+
import subprocess
9+
import time
10+
from typing import List
11+
712
import pytest
813
from fprime_gds.common.data_types.ch_data import ChData
14+
from fprime_gds.common.data_types.event_data import EventData
915
from fprime_gds.common.testing_fw.api import IntegrationTestAPI
1016

1117

18+
@pytest.fixture(scope="session", autouse=True)
19+
def start_gds(fprime_test_api_session: IntegrationTestAPI):
20+
process = subprocess.Popen(["make", "gds-integration"], cwd=os.getcwd())
21+
22+
gds_working = False
23+
timeout_time = time.time() + 15
24+
while time.time() < timeout_time:
25+
data: List[EventData] = fprime_test_api_session.send_and_assert_command(
26+
command="CdhCore.cmdDisp.CMD_NO_OP"
27+
)
28+
if data != []:
29+
gds_working = True
30+
break
31+
assert gds_working
32+
33+
yield
34+
process.kill()
35+
36+
1237
@pytest.fixture(autouse=True)
1338
def send_packet(fprime_test_api: IntegrationTestAPI):
1439
"""Fixture to clear histories and send the IMU packet before each test"""

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,17 @@ clean-zephyr: ## Remove all Zephyr build files
7373

7474
##@ Operations
7575

76-
.PHONY: gds
76+
GDS_COMMAND ?= $(UV) run fprime-gds -n --dictionary $(ARTIFACT_DIR)/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json --communication-selection uart --uart-baud 115200 --output-unframed-data
7777
ARTIFACT_DIR ?= $(shell pwd)/build-artifacts
78+
79+
.PHONY: gds
7880
gds: ## Run FPrime GDS
7981
@echo "Running FPrime GDS..."
80-
@$(UV) run fprime-gds -n --dictionary $(ARTIFACT_DIR)/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json --communication-selection uart --uart-baud 115200 --output-unframed-data
82+
@$(GDS_COMMAND)
83+
84+
.PHONY: gds-integration
85+
gds-integration:
86+
@$(GDS_COMMAND) --gui=none
8187

8288
##@ Build Tools
8389
BIN_DIR ?= $(shell pwd)/bin

0 commit comments

Comments
 (0)