[SCFToGPU] Convert scf.parallel+scf.reduce to gpu.all_reduce (#122782)
[llvm-project.git] / lldb / test / API / lua_api / TestFileHandle.lua
blob8db5ccb2c4650a5ea94f87c0a72010c2e4e92f16
1 _T = require('lua_lldb_test').create_test('TestFileHandle')
3 function _T:TestLegacyFileOutScript()
4 local f = io.open(self.output, 'w')
5 local sbf = lldb.SBFile(f)
6 self.debugger:SetOutputFile(sbf)
7 self:handle_command('script print(1+1)')
8 self.debugger:GetOutputFileHandle():write('FOO\n')
9 self.debugger:GetOutputFileHandle():flush()
10 f:close()
12 f = io.open(self.output, 'r')
13 assertEqual(read_file_non_empty_lines(f), {'2', 'FOO'})
14 f:close()
15 end
17 function _T:TestLegacyFileOut()
18 local f = io.open(self.output, 'w')
19 local sbf = lldb.SBFile(f)
20 self.debugger:SetOutputFile(sbf)
21 self:handle_command('expression/x 3735928559', false)
22 f:close()
24 f = io.open(self.output, 'r')
25 assertStrContains(f:read('*l'), 'deadbeef')
26 f:close()
27 end
29 function _T:TestLegacyFileErr()
30 local f = io.open(self.output, 'w')
31 local sbf = lldb.SBFile(f)
32 self.debugger:SetErrorFile(sbf)
33 self:handle_command('lol', false)
34 f:close()
36 f = io.open(self.output, 'r')
37 assertStrContains(f:read('*l'), 'is not a valid command')
38 f:close()
39 end
41 os.exit(_T:run())