Skip to content

Commit

Permalink
Jump to counterpart Integration test () support
Browse files Browse the repository at this point in the history
  • Loading branch information
h.noppe committed Mar 14, 2020
1 parent 7db5f4d commit 3e3b6d7
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1 +1,2 @@
startup/
startup/
.DS_Store
Binary file modified lib/10.0/omnistap.lbs
Binary file not shown.
Binary file added lib/10.1/omnistap copy.lbs
Binary file not shown.
Binary file added lib/10.1/omnistap.lbs
Binary file not shown.
@@ -1,6 +1,6 @@
Do pirLibrary.$tasks.$findname(pirLibrary.$prefs.$startuptaskname).$insts().$first() Returns lirTaskInstance
If isclear(lirTaskInstance)
Quit method kFalse ## Assume we don't use a separate test library if the task isn't running
Quit method kFalse ## Assume we don't use a separate test library if the task isn't running
End If

Do lirTaskInstance.$useSeparateTestLibrary() Returns lbUseSeparateTestLibrary
Expand Down
@@ -1,4 +1,11 @@
Calculate lcTrimmedMethod as trim(pcMethodName,kTrue,kFalse,"$")
Calculate lcTrimmedMethod as trim(lcTrimmedMethod,kTrue,kFalse,"_")

Quit method con("$u_",lcTrimmedMethod)
Calculate lcUnitTestMethod as con("$u_",lcTrimmedMethod)
Do pirClass.$methods.$findname(lcUnitTestMethod) Returns lirFoundTestMethod
If isclear(lirFoundTestMethod)
Calculate lcIntegrationTestMethod as con("$i_",lcTrimmedMethod)
Do pirClass.$methods.$findname(lcIntegrationTestMethod) Returns lirFoundTestMethod
End If

Quit method pick(isclear(lirFoundTestMethod),lirFoundTestMethod.$name(),lcUnitTestMethod)
7 changes: 4 additions & 3 deletions src/omnistap/OmnisTAP/ogTAPMenuController/class.json
@@ -1,7 +1,7 @@
{
"classtype": "kObjectclass",
"omnisversion": "10.0",
"internalversion": 139,
"omnisversion": "10.1",
"internalversion": 143,
"designtaskname": "Startup_Task",
"cvardefs": [

Expand All @@ -16,6 +16,7 @@
}
],
"properties": {
"canremotedebugwhenlocked": false,
"collectperformancedata": false,
"componenticon": 0,
"componenttype": "kCompStoreHidden",
Expand All @@ -25,7 +26,7 @@
"editordata": "",
"external": true,
"issupercomponent": false,
"moddate": "2019-02-08 23:52:06",
"moddate": "2020-03-14 23:43:35",
"selfcontained": false,
"showascheckedout": false,
"userinfo": "",
Expand Down
29 changes: 29 additions & 0 deletions src/omnistap/OmnisTAP/ogTAPMenuController/methods.json
Expand Up @@ -550,15 +550,44 @@
"subtype": "kSimplechar",
"sublen": 100000000,
"param": 1
},
{
"name": "pirClass",
"order": 4,
"type": "kItemref",
"subtype": "",
"sublen": 0,
"param": 2
}
],
"lvardefs": [
{
"name": "lcIntegrationTestMethod",
"order": 3,
"type": "kCharacter",
"subtype": "kSimplechar",
"sublen": 100000000
},
{
"name": "lcTrimmedMethod",
"order": 2,
"type": "kCharacter",
"subtype": "kSimplechar",
"sublen": 100000000
},
{
"name": "lcUnitTestMethod",
"order": 6,
"type": "kCharacter",
"subtype": "kSimplechar",
"sublen": 100000000
},
{
"name": "lirFoundTestMethod",
"order": 5,
"type": "kItemref",
"subtype": "",
"sublen": 0
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/omnistap/System Classes/#STYLES/class.json
Expand Up @@ -2020,7 +2020,7 @@
{
"name": "kmacOS",
"properties": {
"align": 2,
"align": "kCenterJst",
"backcolor": "RGB(0,0,0)",
"backgroundtheme": "kBGThemeNone",
"backpattern": 0,
Expand Down
3 changes: 3 additions & 0 deletions src/omnistap/_ogTAPMenuController/$setup.omh
@@ -0,0 +1,3 @@
Do inherited

Do $cinst.$mock($objects.ogTAPMenuController) Returns iorMock
@@ -0,0 +1,24 @@
Calculate lcUnitTestMethodName as con("$u_",lcMethodToTestName)
Calculate lcIntegrationTestMethodName as con("$i_",lcMethodToTestName)
Do $objects.$add("TestClass") Returns lirTestClass

Do lirTestClass.$methods.$add(lcUnitTestMethodName) Returns lirUnitTestMethod
Do iorMock.$_getTestMethodNameForMethod(lcMethodToTestName,lirTestClass) Returns lcTestMethod
Do ioTAP.$is_char(lcTestMethod,lcUnitTestMethodName,"Unit test method name is returned")

Do lirTestClass.$methods.$remove(lirUnitTestMethod)
Do lirTestClass.$methods.$add(lcIntegrationTestMethodName) Returns lirIntegrationTestMethod
Do iorMock.$_getTestMethodNameForMethod(lcMethodToTestName,lirTestClass) Returns lcTestMethod
Do ioTAP.$is_char(lcTestMethod,lcIntegrationTestMethodName,"Integration test method name is returned")

Do $cinst.$when("unit test and integration methods do not exist in test class")
Do lirTestClass.$methods.$remove(lirIntegrationTestMethod)
Do iorMock.$_getTestMethodNameForMethod(lcMethodToTestName,lirTestClass) Returns lcTestMethod
Do ioTAP.$is_char(lcTestMethod,lcUnitTestMethodName,"Both test methods do not exist in test class. Unit test is returned")

Do $cinst.$when("unit test and integration methods both exist in test class")
Do lirTestClass.$methods.$add(lcUnitTestMethodName) Returns lirUnitTestMethod
Do lirTestClass.$methods.$add(lcIntegrationTestMethodName) Returns lirIntegrationTestMethod
Do ioTAP.$is_char(lcTestMethod,lcUnitTestMethodName,"Unit test method name is returned if both test methods exist")

Do $objects.$remove(lirTestClass)
36 changes: 36 additions & 0 deletions src/omnistap/_ogTAPMenuController/class.json
@@ -0,0 +1,36 @@
{
"classtype": "kObjectclass",
"omnisversion": "10.1",
"internalversion": 12,
"superclass": "omnistap.ogTAPSuper",
"designtaskname": "Startup_Task",
"cvardefs": [

],
"ivardefs": [
{
"name": "iorMock",
"order": 1,
"type": "kObjectref",
"subtype": "ogTAPMenuController",
"sublen": 0
}
],
"properties": {
"canremotedebugwhenlocked": false,
"collectperformancedata": false,
"componenticon": 0,
"componenttype": "kCompStoreHidden",
"createdate": "2020-03-14 23:19:43",
"desc": "",
"editor": "",
"editordata": "",
"external": true,
"issupercomponent": false,
"moddate": "2020-03-14 23:43:34",
"selfcontained": false,
"showascheckedout": true,
"userinfo": "",
"version": ""
}
}
71 changes: 71 additions & 0 deletions src/omnistap/_ogTAPMenuController/methods.json
@@ -0,0 +1,71 @@
[
{
"name": "$setup",
"order": 1,
"pvardefs": [

],
"lvardefs": [

]
},
{
"name": "$u_getTestMethodNameForMethod",
"order": 3,
"pvardefs": [

],
"lvardefs": [
{
"name": "lcIntegrationTestMethodName",
"order": 3,
"type": "kCharacter",
"subtype": "kSimplechar",
"sublen": 100000000
},
{
"name": "lcMethodToTestName",
"order": 2,
"type": "kCharacter",
"subtype": "kSimplechar",
"sublen": 100000000,
"initval": "'someMethodToTest'"
},
{
"name": "lcTestMethod",
"order": 6,
"type": "kCharacter",
"subtype": "kSimplechar",
"sublen": 100000000
},
{
"name": "lcUnitTestMethodName",
"order": 1,
"type": "kCharacter",
"subtype": "kSimplechar",
"sublen": 100000000
},
{
"name": "lirIntegrationTestMethod",
"order": 7,
"type": "kItemref",
"subtype": "",
"sublen": 0
},
{
"name": "lirTestClass",
"order": 4,
"type": "kItemref",
"subtype": "",
"sublen": 0
},
{
"name": "lirUnitTestMethod",
"order": 5,
"type": "kItemref",
"subtype": "",
"sublen": 0
}
]
}
]
4 changes: 3 additions & 1 deletion src/omnistap/library.json
@@ -1,5 +1,5 @@
{
"omnisversion": "10.0",
"omnisversion": "10.1",
"includes": [
"OMNISCLI"
],
Expand All @@ -17,6 +17,7 @@
"vcsbuildnotes": ""
},
"prefs": {
"animateui": true,
"canfocusbuttons": "kNofocus",
"centuryrange": 1980,
"defaultname": "",
Expand Down Expand Up @@ -55,6 +56,7 @@
"statusevents": true,
"uniquefieldnames": false,
"userexportdelimiter": ";",
"v3events": false,
"vscale": 0,
"weekstart": "kMonday",
"windowsizeexcludesdockingarea": false
Expand Down

0 comments on commit 3e3b6d7

Please sign in to comment.