-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a7f8cb
commit 1f664c2
Showing
132 changed files
with
2,909 additions
and
1,635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
clients/vscode-hlasmplugin/src/test/suite/debugging.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* | ||
* Copyright (c) 2022 Broadcom. | ||
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Broadcom, Inc. - initial API and implementation | ||
*/ | ||
|
||
import * as assert from 'assert'; | ||
import * as vscode from 'vscode'; | ||
import * as path from 'path'; | ||
import * as helper from './testHelper'; | ||
|
||
suite('Debugging Test Suite', () => { | ||
let editor: vscode.TextEditor; | ||
const workspace_file = 'open'; | ||
|
||
suiteSetup(async function () { | ||
this.timeout(10000); | ||
|
||
await helper.showDocument(workspace_file); | ||
editor = helper.get_editor(workspace_file); | ||
}); | ||
|
||
suiteTeardown(async function () { | ||
this.timeout(10000); | ||
|
||
await helper.removeAllBreakpoints(); | ||
await helper.closeAllEditors(); | ||
}); | ||
|
||
// debug open code test | ||
test('Debug test', async () => { | ||
const session = await helper.debugStartSession(); | ||
|
||
// Start by stepping into a macro and checking the file has been accessed | ||
await helper.debugStepOver(4); | ||
await helper.debugStepInto(); | ||
assert.ok(vscode.window.activeTextEditor.document.uri.fsPath === path.join(helper.getWorkspacePath(), 'libs', 'mac.asm'), 'Wrong macro file entered'); | ||
|
||
// Step out and check the file | ||
await helper.debugStepOver(3); | ||
assert.ok(vscode.window.activeTextEditor.document.uri.fsPath === editor.document.uri.fsPath, 'Stepped out to a wrong file'); | ||
|
||
await helper.debugStop(); | ||
|
||
}).timeout(20000).slow(10000); | ||
|
||
test('Breakpoint test', async () => { | ||
await helper.toggleBreakpoints(path.join('libs', 'mac.asm'), [3]); | ||
await helper.toggleBreakpoints('open', [3, 9]); | ||
|
||
await helper.debugStartSession(); | ||
|
||
// Continue until breakpoint is hit | ||
await helper.debugContinue(); | ||
assert.ok(vscode.window.activeTextEditor.document.uri.fsPath === editor.document.uri.fsPath, 'Expected to be in the source file'); | ||
|
||
// Continue until breakpoint is hit | ||
await helper.debugContinue(); | ||
assert.ok(vscode.window.activeTextEditor.document.uri.fsPath == path.join(helper.getWorkspacePath(), 'libs', 'mac.asm'), 'Expected to be in the macro file'); | ||
|
||
// Continue until breakpoint is hit | ||
await helper.debugContinue(); | ||
assert.ok(vscode.window.activeTextEditor.document.uri.fsPath === editor.document.uri.fsPath, 'Expected to be in the source file'); | ||
|
||
await helper.debugStop(); | ||
|
||
}).timeout(20000).slow(10000); | ||
|
||
// verify that virtual files are working | ||
test('Virtual files', async () => { | ||
await helper.toggleBreakpoints('virtual', [7, 11, 12]); | ||
|
||
await helper.debugStartSession(); | ||
|
||
// Continue until breakpoint is hit | ||
await helper.debugContinue(); | ||
assert.ok(vscode.window.activeTextEditor.document.uri.fsPath === path.join(helper.getWorkspacePath(), 'virtual'), 'Expected to be in the source file'); | ||
|
||
// Step into a virtual file | ||
await helper.debugStepInto(); | ||
assert.ok(vscode.window.activeTextEditor.document.uri.path === '/AINSERT:1.hlasm', 'Expected to be in the virtual AINSERT file'); | ||
|
||
// Continue until breakpoint is hit and enter the virtual file again | ||
await helper.debugContinue(); | ||
await helper.debugStepInto(); | ||
assert.ok(vscode.window.activeTextEditor.document.uri.path === '/AINSERT:1.hlasm', 'Expected to be in the virtual AINSERT file'); | ||
|
||
// Continue until breakpoint is hit and enter virtual file through generated macro | ||
await helper.debugContinue(); | ||
assert.ok(vscode.window.activeTextEditor.document.uri.fsPath === path.join(helper.getWorkspacePath(), 'virtual'), 'Expected to be in the source file'); | ||
|
||
await helper.debugStop(); | ||
}).timeout(20000).slow(10000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.