blob: b00d8f4ea9cb095ff9423c05e1157a7b4e33d4f5 [file] [log] [blame]
Heinrich Schuchardt393fcf72023-07-31 22:01:21 +02001# SPDX-License-Identifier: GPL-2.0-or-later
2
3"""Fixture for semihosting command test
4"""
5
6import os
7import pytest
8
9@pytest.fixture(scope='session')
10def semihosting_data(u_boot_config):
11 """Set up a file system to be used in semihosting tests
12
13 Args:
14 u_boot_config -- U-Boot configuration.
15 """
16 image_path = u_boot_config.persistent_data_dir + '/semihosting.txt'
17
18 with open(image_path, 'w', encoding = 'utf-8') as file:
19 file.write('Das U-Boot\n')
20
21 yield image_path
22
23 os.remove(image_path)