def GetCommand(self): # Parse the options by reading the .dart source file. source = self.GetSource() vm_options = utils.ParseTestOptions(test.VM_OPTIONS_PATTERN, source, self.context.workspace) dart_options = utils.ParseTestOptions(test.DART_OPTIONS_PATTERN, source, self.context.workspace) # Combine everything into a command array and return it. command = self.context.GetDart(self.mode, self.arch, self.component) command += self.context.flags if self.mode == 'release': command += ['--optimize'] if vm_options: command += vm_options if dart_options: command += dart_options else: command += [self.filename] return command
def GetStubs(self): source = self.GetSource() stub_classes = utils.ParseTestOptions(test.ISOLATE_STUB_PATTERN, source, self.context.workspace) if stub_classes is None: return (None, None, None) (interface, _, classes) = stub_classes[0].partition(':') (interface, _, implementation) = interface.partition('+') return (interface, classes, implementation)
def GetCommand(self): # Parse the options by reading the .dash source file. source = self.GetSource() vm_options = utils.ParseTestOptions(test.VM_OPTIONS_PATTERN, source, self.context.workspace) dash_options = utils.ParseTestOptions(test.DASH_OPTIONS_PATTERN, source, self.context.workspace) # Combine everything into a command array and return it. command = self.context.GetDash(self.mode, self.arch) if vm_options: command += vm_options if dash_options: command += dash_options else: command += ['--', self.filename] if self.filename.endswith(".dash"): # add also CO19 specific header headerPath = self.GetSpecificHeader() command += [headerPath, '--', "Main.main"] return command
def GetCommand(self): # Parse the options by reading the .dart source file. source = self.GetSource() vm_options = utils.ParseTestOptions(test.VM_OPTIONS_PATTERN, source, self.context.workspace) dart_options = utils.ParseTestOptions(test.DART_OPTIONS_PATTERN, source, self.context.workspace) (interface, _, implementation) = self.GetStubs() # Combine everything into a command array and return it. command = self.context.GetDart(self.mode, self.arch, self.component) if interface is None: f = self.filename else: f = GeneratedName(interface) files = [ join(self.GetPath(), f) ] if vm_options: command += vm_options if dart_options: command += dart_options else: command += files return command
def __init__(self, root_path, arch, mode, test): self.root_path = root_path self.arch = arch self.mode = mode self.test = test self.build_root = utils.GetBuildRoot(OS_GUESS, self.mode, self.arch) source = file(test).read() self.vm_options = [] self.dart_options = utils.ParseTestOptions(DART_OPTIONS_PATTERN, source, root_path) self.is_web_test = _IsWebTest(source) self.temp_dir = None