1#!/usr/bin/env python3 2# -*- coding: utf-8 -*- 3 4# 5# Copyright (c) 2024 Huawei Device Co., Ltd. 6# Licensed under the Apache License, Version 2.0 (the "License"); 7# you may not use this file except in compliance with the License. 8# You may obtain a copy of the License at 9# 10# http://www.apache.org/licenses/LICENSE-2.0 11# 12# Unless required by applicable law or agreed to in writing, software 13# distributed under the License is distributed on an "AS IS" BASIS, 14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15# See the License for the specific language governing permissions and 16# limitations under the License. 17# 18 19import os 20 21from test_base import Test 22 23 24class InUseIdl(Test): 25 def get_file_name(self): 26 return __file__ 27 28 def update_command(self): 29 files = os.listdir(f'{self.working_dir}/foo') 30 idl_files = [] 31 for file in files: 32 idl_files.append(os.path.realpath(f'{self.working_dir}/foo/{file}')) 33 self.command = self._command_format.format(self._idl, self._gen_langauge, ' '.join(idl_files), self.output_dir) 34 35 def run_cpp(self): 36 self.set_gen_cpp_env() 37 return self.run_choose(True) 38 39 def run(self): 40 return self.run_cpp() 41 42 43if __name__ == "__main__": 44 InUseIdl().test() 45