mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 15:26:00 +02:00
Initial checkin
This commit is contained in:
parent
c74712dad9
commit
078564ac9e
3242 changed files with 1616395 additions and 0 deletions
29
IDE/Tests/Test1/scripts/Assembly.txt
Normal file
29
IDE/Tests/Test1/scripts/Assembly.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
# We're testing that we can set a breakpoint on a specific assembly instruction
|
||||
# and that when we re-run, we also stop at that instruction
|
||||
|
||||
#Leak()
|
||||
#Sleep(5000)
|
||||
|
||||
ShowFile("src/Assembly.bf")
|
||||
GotoText("//AssemblyTester_Test")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
StepInto()
|
||||
ShowDisassemblyAtStack()
|
||||
|
||||
GotoTextSkip("call", 1)
|
||||
AdjustCursor(0, 1)
|
||||
ToggleBreakpoint()
|
||||
CloseCurrentDocument()
|
||||
|
||||
Continue()
|
||||
AssertEvalEquals("a", "2")
|
||||
|
||||
StopRunning()
|
||||
CloseCurrentDocument()
|
||||
|
||||
# Make sure when we re-run that we're still stopping after the second IncVal call
|
||||
RunWithCompiling()
|
||||
Continue()
|
||||
AssertEvalEquals("a", "2")
|
31
IDE/Tests/Test1/scripts/Break.txt
Normal file
31
IDE/Tests/Test1/scripts/Break.txt
Normal file
|
@ -0,0 +1,31 @@
|
|||
# This tests that we can manually break a long-executing method and then step in the
|
||||
# correct thread
|
||||
|
||||
ShowFile("src/Break.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
ImmediateEvaluate("Infinite()")
|
||||
nowait Sleep(1000)
|
||||
nowait Break()
|
||||
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("a", "2")
|
||||
StopRunning()
|
||||
|
||||
# The next section uses assembly and it only works in Og+
|
||||
if (platform != "Win64") Stop()
|
||||
|
||||
RunWithCompiling()
|
||||
ShowDisassemblyAtStack()
|
||||
ImmediateEvaluate("Infinite()")
|
||||
nowait Sleep(1000)
|
||||
nowait Break()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
|
||||
AssertEvalEquals("a", "2")
|
48
IDE/Tests/Test1/scripts/Breakpoints.txt
Normal file
48
IDE/Tests/Test1/scripts/Breakpoints.txt
Normal file
|
@ -0,0 +1,48 @@
|
|||
ShowFile("src/Breakpoints.bf")
|
||||
GotoText("//BreakpointTester_Test")
|
||||
ToggleBreakpoint()
|
||||
|
||||
GotoText("//BreakpointTester_LoopA")
|
||||
ToggleBreakpoint()
|
||||
BreakpointSetHitCountTarget(3, "MultipleOf")
|
||||
BreakpointSetCondition("++b < 10")
|
||||
|
||||
GotoText("//BreakpointTester_Recurse")
|
||||
ToggleBreakpoint()
|
||||
|
||||
GotoText("//Recurse_C")
|
||||
ToggleBreakpoint()
|
||||
BreakpointSetCondition("a == 3")
|
||||
|
||||
RunWithCompiling()
|
||||
|
||||
Continue()
|
||||
AssertEvalEquals("a", "2")
|
||||
AssertEvalEquals("b", "3")
|
||||
|
||||
Continue()
|
||||
AssertEvalEquals("a", "5")
|
||||
AssertEvalEquals("b", "6")
|
||||
|
||||
Continue()
|
||||
Continue()
|
||||
AssertLineContains("Recurse(0)")
|
||||
|
||||
StepInto()
|
||||
AssertLineContains("int b = 234")
|
||||
StepOver()
|
||||
AssertLineContains("int c = 345")
|
||||
StepOver()
|
||||
AssertLineContains("a == 10")
|
||||
AssertEvalEquals("a", "0")
|
||||
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertLineContains("int c = 345")
|
||||
AssertEvalEquals("a", "3")
|
||||
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("d", "103")
|
28
IDE/Tests/Test1/scripts/Breakpoints02.txt
Normal file
28
IDE/Tests/Test1/scripts/Breakpoints02.txt
Normal file
|
@ -0,0 +1,28 @@
|
|||
# This tests for a bug where stepping onto a breakpoint and then continuing (F5)
|
||||
# would cause us to immediately hit the breakpoint we were already at
|
||||
|
||||
ShowFile("src/Breakpoints02.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
|
||||
GotoText("//MethodA_1")
|
||||
ToggleBreakpoint()
|
||||
GotoText("//MethodA_2")
|
||||
ToggleBreakpoint()
|
||||
|
||||
RunWithCompiling()
|
||||
Continue()
|
||||
AssertEvalEquals("a", "1")
|
||||
StepOver()
|
||||
AssertEvalEquals("a", "2")
|
||||
Continue()
|
||||
AssertEvalEquals("a", "5")
|
||||
|
||||
# The next section uses assembly and it only works in Og+
|
||||
if (platform != "Win64") Stop()
|
||||
|
||||
ShowDisassemblyAtStack()
|
||||
StepOver()
|
||||
AssertEvalEquals("a", "6")
|
||||
Continue()
|
||||
AssertEvalEquals("a", "9")
|
9
IDE/Tests/Test1/scripts/Bug001.txt
Normal file
9
IDE/Tests/Test1/scripts/Bug001.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
# This tests for a bug where 'b' wasn't visible on the very last line of the method
|
||||
|
||||
ShowFile("src/bugs/Bug001.bf")
|
||||
GotoText("//Bug001_DoTest")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
StepOver()
|
||||
AssertEvalEquals("a", "123")
|
||||
AssertEvalEquals("b", "234")
|
19
IDE/Tests/Test1/scripts/Bug002.txt
Normal file
19
IDE/Tests/Test1/scripts/Bug002.txt
Normal file
|
@ -0,0 +1,19 @@
|
|||
# This tests that loop over an array correctly steps over the array accessor
|
||||
|
||||
ShowFile("src/bugs/Bug002.bf")
|
||||
GotoText("//Bug002_DoTest")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
StepInto()
|
||||
StepOver()
|
||||
AssertEvalEquals("val, na", "\"aaa\"")
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val, na", "\"bbb\"")
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val, na", "\"ccc\"")
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val2", "999")
|
9
IDE/Tests/Test1/scripts/Enums.txt
Normal file
9
IDE/Tests/Test1/scripts/Enums.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
ShowFile("src/Enums.bf")
|
||||
GotoText("//EnumTester_Test")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
AssertEvalEquals("ea", ".B(b:1.2)")
|
||||
AssertEvalEquals("z", "(aa:123, bb:345)")
|
||||
AssertEvalEquals("q", "(a:234, 567, c:999)")
|
||||
AssertEvalEquals("qRef = (4, 5, 6)", "(a:4, 5, c:6)")
|
53
IDE/Tests/Test1/scripts/HotSwap_BaseChange.txt
Normal file
53
IDE/Tests/Test1/scripts/HotSwap_BaseChange.txt
Normal file
|
@ -0,0 +1,53 @@
|
|||
ShowFile("src/HotSwap_BaseChange.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
ToggleCommentAt("ClassC_0")
|
||||
ToggleCommentAt("DoTest0_Body")
|
||||
Compile()
|
||||
|
||||
# DoTest0
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("a0", "100")
|
||||
AssertEvalEquals("a1", "101")
|
||||
AssertEvalEquals("c0", "300")
|
||||
StepOut()
|
||||
|
||||
# DoTest1
|
||||
ToggleCommentAt("ClassC_0")
|
||||
ToggleCommentAt("ClassC_1")
|
||||
ToggleCommentAt("DoTest0_Body")
|
||||
ToggleCommentAt("DoTest1_Body")
|
||||
ToggleCommentAt("DoTest2_Decl")
|
||||
Compile()
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("b0", "200")
|
||||
AssertEvalEquals("c0", "300")
|
||||
|
||||
# DoTest1
|
||||
ToggleCommentAt("ClassB_MethodB1")
|
||||
ToggleCommentAt("ClassC_1")
|
||||
ToggleCommentAt("ClassC_2")
|
||||
ToggleCommentAt("DoTest2_Body")
|
||||
Compile()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("b0", "200")
|
||||
AssertEvalEquals("c0", "1300")
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("b0", "200")
|
||||
AssertEvalEquals("b1", "201")
|
||||
AssertEvalEquals("c0", "1300")
|
||||
AssertEvalEquals("c1", "1301")
|
13
IDE/Tests/Test1/scripts/HotSwap_BaseChange02.txt
Normal file
13
IDE/Tests/Test1/scripts/HotSwap_BaseChange02.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
ShowFile("src/HotSwap_BaseChange.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
ToggleCommentAt("ClassC_3")
|
||||
ToggleCommentAt("DoTest3_Body")
|
||||
SetExpectError("Too many arguments")
|
||||
Compile()
|
||||
|
||||
ToggleCommentAt("ClassC_3")
|
||||
ToggleCommentAt("ClassC_1")
|
||||
Compile()
|
20
IDE/Tests/Test1/scripts/HotSwap_Breakpoints.txt
Normal file
20
IDE/Tests/Test1/scripts/HotSwap_Breakpoints.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
ShowFile("src/HotSwap.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
GotoText("//*HotTester_Test1")
|
||||
AdjustCursor(0, 1)
|
||||
InsertText("int a0 = 1;\n\t\t\tint b0 = 2;\n\t\t\tint c0 = 3;\n")
|
||||
AdjustCursor(0, -2)
|
||||
ToggleBreakpoint()
|
||||
|
||||
# We want to ensure that breakpoint didn't bind yet
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertLineContains("ht.Test1()")
|
||||
|
||||
# ... but now it does
|
||||
Compile()
|
||||
Continue()
|
||||
AssertLineContains("b0 = 2")
|
19
IDE/Tests/Test1/scripts/HotSwap_Data01.txt
Normal file
19
IDE/Tests/Test1/scripts/HotSwap_Data01.txt
Normal file
|
@ -0,0 +1,19 @@
|
|||
ShowFile("src/HotSwap_Data.bf")
|
||||
GotoText("//Test_Test01")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
StepInto()
|
||||
ToggleCommentAt("StructA_mA2")
|
||||
ToggleCommentAt("Test01_mA2")
|
||||
SetExpectError("data changes")
|
||||
Compile()
|
||||
ExpectError()
|
||||
StepOver()
|
||||
StepOver()
|
||||
Compile()
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "101")
|
||||
AssertEvalEquals("sc.mA2", "101")
|
14
IDE/Tests/Test1/scripts/HotSwap_Data02.txt
Normal file
14
IDE/Tests/Test1/scripts/HotSwap_Data02.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
ShowFile("src/HotSwap_Data.bf")
|
||||
GotoText("//Test_Test02")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
ToggleCommentAt("Test_funcPtr")
|
||||
Compile()
|
||||
ToggleCommentAt("Func")
|
||||
ToggleCommentAt("Test_funcPtr")
|
||||
Compile()
|
||||
ToggleCommentAt("StructA_mA2")
|
||||
SetExpectError("data changes")
|
||||
Compile()
|
||||
ExpectError()
|
18
IDE/Tests/Test1/scripts/HotSwap_Data03.txt
Normal file
18
IDE/Tests/Test1/scripts/HotSwap_Data03.txt
Normal file
|
@ -0,0 +1,18 @@
|
|||
ShowFile("src/HotSwap_Data.bf")
|
||||
ToggleCommentAt("Test03_delegate")
|
||||
|
||||
GotoText("//Test_Test03")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
StepOver()
|
||||
ToggleCommentAt("Test03_delegate")
|
||||
Compile()
|
||||
|
||||
# We are rebuilding Func so this should be okay
|
||||
ToggleCommentAt("StructA_mA2")
|
||||
Compile()
|
||||
ToggleCommentAt("Func")
|
||||
ToggleCommentAt("StructA_mA3")
|
||||
SetExpectError("data changes")
|
||||
Compile()
|
||||
ExpectError()
|
23
IDE/Tests/Test1/scripts/HotSwap_Data04.txt
Normal file
23
IDE/Tests/Test1/scripts/HotSwap_Data04.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
ShowFile("src/HotSwap_Data.bf")
|
||||
GotoText("//Test_Test04")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
# Both of these interface will have the same slot number
|
||||
ToggleCommentAt("ClassC_IFaceB_WithComma")
|
||||
SetExpectError("collision error")
|
||||
Compile()
|
||||
ExpectError()
|
||||
|
||||
# Switching interfaces can work if there are no allocations, but this StepInto DOES have an allocation
|
||||
StepInto()
|
||||
ToggleCommentAt("ClassC_IFaceA")
|
||||
ToggleCommentAt("ClassC_IFaceB_WithComma")
|
||||
ToggleCommentAt("ClassC_IFaceB_WithoutComma")
|
||||
SetExpectError("data changes")
|
||||
Compile()
|
||||
ExpectError()
|
||||
|
||||
# But it should succeeed when were back out in Test() with no allocs
|
||||
StepOut()
|
||||
Compile()
|
50
IDE/Tests/Test1/scripts/HotSwap_Funcs.txt
Normal file
50
IDE/Tests/Test1/scripts/HotSwap_Funcs.txt
Normal file
|
@ -0,0 +1,50 @@
|
|||
ShowFile("src/HotSwap.bf")
|
||||
GotoText("//HotStart_Funcs")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
|
||||
# We're on TestFuncs_Compare now
|
||||
GotoText("//HotTester_TestFuncs_Func_Return")
|
||||
AdjustCursor(0, 1)
|
||||
CursorToLineEnd()
|
||||
AdjustCursor(-1, 0)
|
||||
InsertText("4")
|
||||
|
||||
GotoText("//HotB_MethodA_Return")
|
||||
AdjustCursor(0, 1)
|
||||
CursorToLineEnd()
|
||||
AdjustCursor(-1, 0)
|
||||
InsertText("9")
|
||||
|
||||
Compile()
|
||||
|
||||
GotoText("//TestFuncs_Compare_Calls")
|
||||
RunToCursor()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "209")
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "1234")
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "1234")
|
||||
|
||||
Stop()
|
||||
|
||||
StepOut()
|
||||
StepOut()
|
||||
ToggleCommentAt("HotTester_TestFuncs_Func2")
|
||||
ToggleCommentAt("TestFuncs2_Body")
|
||||
Compile()
|
||||
StepInto()
|
||||
StepOver()
|
||||
ToggleCommentAt("TestFuncs2_Compare_Body")
|
||||
Compile()
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "444")
|
15
IDE/Tests/Test1/scripts/HotSwap_GetUnused.txt
Normal file
15
IDE/Tests/Test1/scripts/HotSwap_GetUnused.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
ShowFile("src/HotSwap_GetUnused.bf")
|
||||
GotoText("//Test")
|
||||
ToggleBreakpoint()
|
||||
Compile()
|
||||
ToggleCommentAt("DoTest_MethodB")
|
||||
Compile()
|
||||
ToggleCommentAt("DoTest_MethodB")
|
||||
RunWithCompiling()
|
||||
ToggleCommentAt("DoTest_MethodB")
|
||||
Compile()
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "123")
|
34
IDE/Tests/Test1/scripts/HotSwap_Interfaces.txt
Normal file
34
IDE/Tests/Test1/scripts/HotSwap_Interfaces.txt
Normal file
|
@ -0,0 +1,34 @@
|
|||
# This tests hot adding an unreified interface, hot adding interface methods,
|
||||
# and calling hot-added methods
|
||||
|
||||
ShowFile("src/HotSwap.bf")
|
||||
GotoText("//HotStart_Interfaces")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
StepOver()
|
||||
AssertEvalEquals("hot.IHotA()", "ERROR:'Unable to find address for method, possibly due to compiler optimizations.'")
|
||||
|
||||
ToggleCommentAt("HotTester_TestIHotA")
|
||||
Compile()
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "15")
|
||||
AssertEvalEquals("hot.IHotA()", "15")
|
||||
|
||||
ToggleCommentAt("IHot_IHotB")
|
||||
ToggleCommentAt("HotTester_TestIHotB")
|
||||
Compile()
|
||||
|
||||
# Steps out
|
||||
StepOver()
|
||||
|
||||
# We need an extra step for Win32 for stack adjustment...
|
||||
if (platform == "Win32") StepOver()
|
||||
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "16")
|
||||
AssertEvalEquals("hot.IHotB()", "16")
|
14
IDE/Tests/Test1/scripts/HotSwap_Interfaces2.txt
Normal file
14
IDE/Tests/Test1/scripts/HotSwap_Interfaces2.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
ShowFile("src/HotSwap_Interfaces2.bf")
|
||||
GotoText("//Test")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
StepOver()
|
||||
AssertEvalEquals("v0", "11")
|
||||
|
||||
ToggleCommentAt("IFaceA_Method1")
|
||||
ToggleCommentAt("ClassA_Method1")
|
||||
ToggleCommentAt("Test1_Method1")
|
||||
Compile()
|
||||
StepInto()
|
||||
StepOver()
|
||||
AssertEvalEquals("v1", "22")
|
30
IDE/Tests/Test1/scripts/HotSwap_Reflection.txt
Normal file
30
IDE/Tests/Test1/scripts/HotSwap_Reflection.txt
Normal file
|
@ -0,0 +1,30 @@
|
|||
ShowFile("src/HotSwap_Reflection.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("field.mFieldData.mName, na", "\"mA\"")
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertLineContains("GetMyType")
|
||||
|
||||
GotoText("//ClassA_mA")
|
||||
AdjustCursor(-1, 0)
|
||||
InsertText("1")
|
||||
Compile()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("field.mFieldData.mName, na", "\"mA1\"")
|
||||
StepOver()
|
||||
StepOver()
|
||||
|
||||
GotoText("//ClassA_mA")
|
||||
AdjustCursor(-1, 0)
|
||||
InsertText("2")
|
||||
Compile()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("field.mFieldData.mName, na", "\"mA12\"")
|
||||
StepOver()
|
||||
StepOver()
|
37
IDE/Tests/Test1/scripts/HotSwap_TLS.txt
Normal file
37
IDE/Tests/Test1/scripts/HotSwap_TLS.txt
Normal file
|
@ -0,0 +1,37 @@
|
|||
ShowFile("src/HotSwap_TLS.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "3")
|
||||
AssertEvalEquals("ClassA.sTLS0", "3")
|
||||
AssertEvalEquals("sThreadResult", "1")
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("sThreadResult", "2")
|
||||
ToggleCommentAt("ClassA_TLS1")
|
||||
ToggleCommentAt("Inc1_TLS1")
|
||||
Compile()
|
||||
AssertEvalEquals("ClassA.sTLS1", "0")
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "3")
|
||||
AssertEvalEquals("ClassA.sTLS1", "3")
|
||||
AssertEvalEquals("sThreadResult", "1")
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("sThreadResult", "2")
|
64
IDE/Tests/Test1/scripts/HotSwap_Virtual.txt
Normal file
64
IDE/Tests/Test1/scripts/HotSwap_Virtual.txt
Normal file
|
@ -0,0 +1,64 @@
|
|||
# Tests:
|
||||
# Virtual methods being added during hot compiles
|
||||
# Breakpoints being set in both old versions of methods and new versions
|
||||
|
||||
ShowFile("src/HotSwap.bf")
|
||||
GotoText("//HotStart")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
# MethodA
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "20")
|
||||
|
||||
# MethodB
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "11")
|
||||
|
||||
# Hot compile, adding in MethodB
|
||||
ToggleCommentAt("HotB_MethodB")
|
||||
Compile()
|
||||
|
||||
# MethodB - after hot compile
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "21")
|
||||
|
||||
# Modify Test1 end so we can make sure break hits both val setting
|
||||
GotoText("//HotTester_Test1_EndTest")
|
||||
ToggleBreakpoint()
|
||||
AdjustCursor(0, 1)
|
||||
CursorToLineEnd()
|
||||
AdjustCursor(-1, 0)
|
||||
InsertText("6")
|
||||
|
||||
# Hot compile, adding in MethodC, but MethodC is not called yet
|
||||
ToggleCommentAt("HotA_MethodC")
|
||||
ToggleCommentAt("HotB_MethodC")
|
||||
Compile()
|
||||
|
||||
# Hot compile in usage of MethodC
|
||||
ToggleCommentAt("HotTester_Test2")
|
||||
Compile()
|
||||
|
||||
# 'Test2' - calling MethodC after hot compile
|
||||
StepInto()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "22")
|
||||
|
||||
# Continue to HotTester_Test1_EndTest
|
||||
Continue
|
||||
StepOver
|
||||
AssertEvalEquals("val", "99")
|
||||
|
||||
# Continue to new HotTester_Test1_EndTest
|
||||
Continue()
|
||||
Continue()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "996")
|
||||
|
||||
# Test previously-unused MethodE
|
||||
ToggleCommentAt("HotTester_Test3")
|
||||
Compile()
|
||||
StepInto()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "14")
|
39
IDE/Tests/Test1/scripts/HotSwap_VirtualRemap.txt
Normal file
39
IDE/Tests/Test1/scripts/HotSwap_VirtualRemap.txt
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Tests that even when removing an old virtual method, adding a new one, and then
|
||||
# adding back a method with the same name as the old one, we can call this new
|
||||
# method using an old virtual call
|
||||
ShowFile("src/HotSwap.bf")
|
||||
GotoText("//HotStart_VirtualRemap")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
# Turn off MethodB
|
||||
ToggleCommentAt("HotA_MethodB")
|
||||
ToggleCommentAt("HotTester_Test1")
|
||||
ToggleCommentAt("HotTester_TestVirtualRemap_MethodBCall")
|
||||
ToggleCommentAt("HotTester_TestVirtualRemap_MethodBCall_2")
|
||||
Compile()
|
||||
# Make sure we can call the old 'MethodB'
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "11")
|
||||
|
||||
# Turn on MethodC
|
||||
ShowCurrent()
|
||||
ToggleCommentAt("HotA_MethodC")
|
||||
ToggleCommentAt("HotTester_TestVirtualRemap2_MethodCCall")
|
||||
Compile()
|
||||
StepInto()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "12")
|
||||
|
||||
# Turn on MethodB (version 2)
|
||||
ToggleCommentAt("HotA_MethodB_2")
|
||||
ToggleCommentAt("HotTester_TestVirtualRemap_MethodBCall")
|
||||
Compile()
|
||||
|
||||
StepOver()
|
||||
StepOver()
|
||||
# We are running an old version of TestVirtualRemap that used the old virtual slot
|
||||
# number for the MethodB call, but the new MethodB should be mapped to that same
|
||||
# slot because it mangles the same
|
||||
AssertEvalEquals("val", "111")
|
14
IDE/Tests/Test1/scripts/Inline.txt
Normal file
14
IDE/Tests/Test1/scripts/Inline.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
ShowFile("src/Inline.bf")
|
||||
GotoText("//InlineTester")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
StepInto()
|
||||
AssertEvalEquals("argA", "10")
|
||||
AssertEvalEquals("argB", "2")
|
||||
|
||||
StepOver()
|
||||
AssertEvalEquals("argA", "11")
|
||||
|
||||
StepOut()
|
||||
AssertEvalEquals("c", "13")
|
16
IDE/Tests/Test1/scripts/Lambdas.txt
Normal file
16
IDE/Tests/Test1/scripts/Lambdas.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
ShowFile("src/Lambdas.bf")
|
||||
GotoText("//LambdaTest_Test1")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
StepInto()
|
||||
|
||||
AssertEvalEquals("argA1", "99")
|
||||
AssertEvalEquals("outerVar", "88")
|
||||
AssertEvalEquals("mA", "123")
|
||||
AssertEvalEquals("mB", "234")
|
||||
AssertEvalEquals("this,na", "{ mA=123 mB=234 }")
|
||||
|
||||
AssertDbgAutocomplete("outerVar")
|
||||
AssertDbgAutocomplete("argA1")
|
||||
AssertDbgAutocomplete("this")
|
||||
AssertDbgAutocomplete("mA")
|
12
IDE/Tests/Test1/scripts/MemoryBreakpoints.txt
Normal file
12
IDE/Tests/Test1/scripts/MemoryBreakpoints.txt
Normal file
|
@ -0,0 +1,12 @@
|
|||
ShowFile("src/MemoryBreakpoints.bf")
|
||||
GotoText("//MemoryBreakpointTester_Test")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
StepOver()
|
||||
CreateMemoryBreakpoint("mbt")
|
||||
|
||||
Continue()
|
||||
AssertEvalEquals("a", "0")
|
||||
Continue()
|
||||
AssertEvalEquals("a", "2")
|
28
IDE/Tests/Test1/scripts/Methods.txt
Normal file
28
IDE/Tests/Test1/scripts/Methods.txt
Normal file
|
@ -0,0 +1,28 @@
|
|||
ShowFile("src/Methods.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
StepOver()
|
||||
AssertAutocompleteEquals("ClassA.TEST_", "TEST_StaticMethodA\nTEST_StaticMethodB")
|
||||
AssertAutocompleteEquals("ca.TEST_", "TEST_MethodA\nTEST_MethodB")
|
||||
NavigateBackwards()
|
||||
AssertEvalEquals("ca.TEST_MethodA()", "200")
|
||||
AssertEvalContains("ca.TEST_MethodB()", "Unable to find address for method")
|
||||
AssertEvalEquals("ClassA.TEST_StaticMethodA()", "100")
|
||||
AssertEvalContains("ClassA.TEST_StaticMethodB()", "Unable to find address for method")
|
||||
AssertAutocompleteEquals("ClassA.TEST_", "TEST_StaticMethodA\nTEST_StaticMethodB")
|
||||
AssertAutocompleteEquals("ca.TEST_", "TEST_MethodA\nTEST_MethodB")
|
||||
NavigateBackwards()
|
||||
|
||||
ToggleCommentAt("ClassA_MethodC")
|
||||
ToggleCommentAt("ClassA_StaticMethodC")
|
||||
ToggleCommentAt("DoTest_Body")
|
||||
Compile()
|
||||
AssertEvalEquals("ca.TEST_MethodA()", "200")
|
||||
AssertEvalEquals("ca.TEST_MethodB()", "201")
|
||||
AssertEvalEquals("ca.TEST_MethodC()", "202")
|
||||
AssertEvalEquals("ClassA.TEST_StaticMethodA()", "100")
|
||||
AssertEvalEquals("ClassA.TEST_StaticMethodB()", "101")
|
||||
AssertEvalEquals("ClassA.TEST_StaticMethodC()", "102")
|
||||
AssertAutocompleteEquals("ClassA.TEST_", "TEST_StaticMethodA\nTEST_StaticMethodB\nTEST_StaticMethodC")
|
||||
AssertAutocompleteEquals("ca.TEST_", "TEST_MethodA\nTEST_MethodB\nTEST_MethodC")
|
28
IDE/Tests/Test1/scripts/Mixins.txt
Normal file
28
IDE/Tests/Test1/scripts/Mixins.txt
Normal file
|
@ -0,0 +1,28 @@
|
|||
ShowFile("src/Mixins.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertLineContains("a = 123")
|
||||
StepOver()
|
||||
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertLineContains("b + 1000")
|
||||
StepInto()
|
||||
|
||||
AssertLineContains("a + 10000")
|
||||
StepInto()
|
||||
AssertLineContains("b = a + 10")
|
||||
StepOut()
|
||||
|
||||
# This isn't strictly required
|
||||
AssertLineContains("a + 10000")
|
||||
StepOver()
|
||||
|
||||
AssertLineContains("a + 20000")
|
||||
StepOver()
|
||||
AssertLineContains("a + 30000")
|
93
IDE/Tests/Test1/scripts/Multithread.txt
Normal file
93
IDE/Tests/Test1/scripts/Multithread.txt
Normal file
|
@ -0,0 +1,93 @@
|
|||
# This tests multithreaded stepping
|
||||
# - Steps should stay in the same thread
|
||||
# - Run To Cursor should stay on the same thread
|
||||
# - Step Out should stay on the same thread
|
||||
|
||||
ShowFile("src/Multithread.bf")
|
||||
GotoText("//MultithreadTester_Test")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
StepOver()
|
||||
AssertEvalEquals("doTest = true", "true")
|
||||
|
||||
GotoText("//ThreadFunc")
|
||||
ToggleBreakpoint()
|
||||
Continue()
|
||||
AssertEvalEquals("sLocalVal", "1")
|
||||
Continue()
|
||||
AssertEvalEquals("sLocalVal", "1")
|
||||
Continue()
|
||||
AssertEvalEquals("sLocalVal", "1")
|
||||
|
||||
# We now have all 3 threads running and we're the third one
|
||||
# We now do a series of execution tests, concentrating on the "val++" line
|
||||
# We test that "run to cursor" does a full iteration back to that
|
||||
# same line, both from having stepped onto it using "StepOver" and
|
||||
# having previously arrived there from another "RunToCursor"
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
StepOver()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
StepOver()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
StepOver()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
StepOver()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
StepOver()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
StepOver()
|
||||
AssertEvalEquals("i", "1")
|
||||
|
||||
RunToCursor()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
AssertEvalEquals("i", "2")
|
||||
RunToCursor()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
AssertEvalEquals("i", "3")
|
||||
|
||||
# Pass 2
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
AssertEvalEquals("i", "4")
|
||||
|
||||
RunToCursor()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
AssertEvalEquals("i", "5")
|
||||
RunToCursor()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
AssertEvalEquals("i", "6")
|
||||
|
||||
# Pass 3
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
AssertEvalEquals("i", "7")
|
||||
|
||||
RunToCursor()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
AssertEvalEquals("i", "8")
|
||||
RunToCursor()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
AssertEvalEquals("i", "9")
|
||||
|
||||
# Set up the StepOut test
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertEvalEquals("val", "2")
|
||||
StepOut()
|
||||
AssertEvalEquals("depth", "0")
|
||||
AssertEvalEquals("val", "5")
|
||||
|
||||
StepOut()
|
||||
AssertEvalEquals("threadNum", "2")
|
||||
AssertEvalEquals("i", "9")
|
32
IDE/Tests/Test1/scripts/Multithread02.txt
Normal file
32
IDE/Tests/Test1/scripts/Multithread02.txt
Normal file
|
@ -0,0 +1,32 @@
|
|||
# This test ensure that other threads continue to execute while we execute a method in the debugger
|
||||
# and it tests that we can execute methods on threads other than those which we had originally stopped on
|
||||
|
||||
ShowFile("src/Multithread02.bf")
|
||||
GotoText("//Thread1_0")
|
||||
ToggleBreakpoint()
|
||||
GotoText("//Thread1_1")
|
||||
ToggleBreakpoint()
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
|
||||
RunWithCompiling()
|
||||
StepOver()
|
||||
AssertEvalEquals("doTest = true", "true")
|
||||
Continue()
|
||||
AssertEvalEquals("ca.mA", "100")
|
||||
AssertEvalEquals("sVal0", "1")
|
||||
AssertEvalEquals("ca.GetValWithWait()", "100")
|
||||
AssertEvalEquals("sVal0", "2")
|
||||
SelectThread("")
|
||||
SelectCallStackWithStr(".DoTest()")
|
||||
AssertEvalEquals("ca.mA", "9")
|
||||
AssertEvalEquals("sVal1", "0")
|
||||
AssertEvalEquals("ca.GetValWithWait()", "9")
|
||||
AssertEvalEquals("sVal1", "1")
|
||||
Continue()
|
||||
|
||||
SelectThread("")
|
||||
SelectCallStackWithStr(".DoTest()")
|
||||
AssertEvalEquals("sVal1", "1")
|
||||
AssertEvalEquals("ca.GetValWithWait()", "9")
|
||||
AssertEvalEquals("sVal1", "2")
|
12
IDE/Tests/Test1/scripts/Splats.txt
Normal file
12
IDE/Tests/Test1/scripts/Splats.txt
Normal file
|
@ -0,0 +1,12 @@
|
|||
ShowFile("src/Splats.bf")
|
||||
GotoText("//SplatTester_SplatC_Call")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
StepInto()
|
||||
AssertEvalEquals("this", "{ mC='Z' mB=1.2 mA=123 }")
|
||||
#This fails currently
|
||||
#AssertEvalEquals("GetB()", "1.2")
|
||||
StepOver()
|
||||
AssertEvalEquals("sc.GetB()", "1.2")
|
||||
AssertEvalEquals("GetC(sc)", "123")
|
43
IDE/Tests/Test1/scripts/Stepping_Scope.txt
Normal file
43
IDE/Tests/Test1/scripts/Stepping_Scope.txt
Normal file
|
@ -0,0 +1,43 @@
|
|||
# This tests various cases of hitting breakpoints on the closing brace of a method
|
||||
# along with stepping onto a return, and stepping into scoped destructors.
|
||||
|
||||
ShowFile("src/Stepping_Scope.bf")
|
||||
GotoText("//Stepping_Scope_Test_Start")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
AssertLineContains("Test1(0)")
|
||||
GotoText("//Stepping_Scope_Test1_Leave")
|
||||
ToggleBreakpoint()
|
||||
|
||||
Continue()
|
||||
AssertEvalEquals("a", "2")
|
||||
StepInto()
|
||||
AssertLineContains("b = 99")
|
||||
StepOut()
|
||||
StepOver()
|
||||
|
||||
AssertLineContains("Test1(1)")
|
||||
StepOver()
|
||||
AssertEvalEquals("a", "3")
|
||||
StepInto()
|
||||
AssertLineContains("b = 99")
|
||||
StepOut()
|
||||
StepOver()
|
||||
|
||||
AssertLineContains("Test2(0)")
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertLineContains("scope::")
|
||||
StepOver()
|
||||
StepOver()
|
||||
AssertLineContains("return")
|
||||
StepOver()
|
||||
AssertLineContains("}")
|
||||
StepInto()
|
||||
AssertLineContains("b = 99")
|
||||
StepOut()
|
||||
StepOver()
|
||||
|
||||
AssertLineContains("Test2(1)")
|
27
IDE/Tests/Test1/scripts/Unions.txt
Normal file
27
IDE/Tests/Test1/scripts/Unions.txt
Normal file
|
@ -0,0 +1,27 @@
|
|||
ShowFile("src/Unions.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
RunWithCompiling()
|
||||
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
|
||||
AssertEvalEquals("a", "12")
|
||||
AssertEvalEquals("b", "23")
|
||||
AssertEvalEquals("us.mInnerB.mInnerA.mInt0", "12")
|
||||
AssertEvalEquals("us.mInnerB.mInnerA.mInt1", "23")
|
||||
|
||||
StepOut()
|
||||
StepOver()
|
||||
StepOver()
|
||||
StepInto()
|
||||
StepOver()
|
||||
StepOver()
|
||||
|
||||
AssertEvalEquals("a2", "1432778632")
|
||||
AssertEvalEquals("b2", "287454020")
|
||||
AssertEvalEquals("us.mInnerB.mInnerA.mInt0", "1432778632")
|
||||
AssertEvalEquals("us.mInnerB.mInnerA.mInt1", "287454020")
|
22
IDE/Tests/Test1/scripts/Virtuals.txt
Normal file
22
IDE/Tests/Test1/scripts/Virtuals.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
# This checks that virtual method calls work in the debugger,
|
||||
# and also ensures that the virtual indicies properly remap
|
||||
# after the interface slot count increases between compiles
|
||||
|
||||
ShowFile("src/Virtuals.bf")
|
||||
GotoText("//Test_Start")
|
||||
ToggleBreakpoint()
|
||||
|
||||
RunWithCompiling()
|
||||
AssertEvalEquals("ca.GetA(9)", "2009")
|
||||
AssertEvalEquals("cb.GetA(11)", "2011")
|
||||
AssertEvalEquals("ca.Korf", "234")
|
||||
AssertEvalEquals("cb.Korf", "234")
|
||||
StopRunning()
|
||||
|
||||
ToggleCommentAt("ClassA_IFaces")
|
||||
ToggleCommentAt("Test_IFaces")
|
||||
RunWithCompiling()
|
||||
AssertEvalEquals("ca.GetA(9)", "2009")
|
||||
AssertEvalEquals("cb.GetA(11)", "2011")
|
||||
AssertEvalEquals("ca.Korf", "234")
|
||||
AssertEvalEquals("cb.Korf", "234")
|
Loading…
Add table
Add a link
Reference in a new issue