13a094d8bSJeremy Morse# DExTer : Debugging Experience Tester 23a094d8bSJeremy Morse# ~~~~~~ ~ ~~ ~ ~~ 33a094d8bSJeremy Morse# 43a094d8bSJeremy Morse# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 53a094d8bSJeremy Morse# See https://llvm.org/LICENSE.txt for license information. 63a094d8bSJeremy Morse# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 73a094d8bSJeremy Morse"""A Command that specifies the command line with which to run the test. 83a094d8bSJeremy Morse""" 93a094d8bSJeremy Morse 103a094d8bSJeremy Morsefrom dex.command.CommandBase import CommandBase 113a094d8bSJeremy Morse 12*f98ee40fSTobias Hieta 133a094d8bSJeremy Morseclass DexCommandLine(CommandBase): 143a094d8bSJeremy Morse def __init__(self, the_cmdline): 153a094d8bSJeremy Morse if type(the_cmdline) is not list: 16*f98ee40fSTobias Hieta raise TypeError("Expected list, got {}".format(type(the_cmdline))) 173a094d8bSJeremy Morse for x in the_cmdline: 183a094d8bSJeremy Morse if type(x) is not str: 19*f98ee40fSTobias Hieta raise TypeError( 20*f98ee40fSTobias Hieta 'Command line element "{}" has type {}'.format(x, type(x)) 21*f98ee40fSTobias Hieta ) 223a094d8bSJeremy Morse self.the_cmdline = the_cmdline 233a094d8bSJeremy Morse super(DexCommandLine, self).__init__() 243a094d8bSJeremy Morse 253a094d8bSJeremy Morse def eval(self): 26*f98ee40fSTobias Hieta raise NotImplementedError("DexCommandLine commands cannot be evaled.") 273a094d8bSJeremy Morse 283a094d8bSJeremy Morse @staticmethod 293a094d8bSJeremy Morse def get_name(): 303a094d8bSJeremy Morse return __class__.__name__ 313a094d8bSJeremy Morse 323a094d8bSJeremy Morse @staticmethod 333a094d8bSJeremy Morse def get_subcommands() -> dict: 343a094d8bSJeremy Morse return None 35