Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [R2021a, latest]
os: [windows-latest, ubuntu-latest, macos-13]
version: [R2021b, R2022a, R2022b, latest]
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [R2021a, latest]
os: [windows-latest, ubuntu-latest, macos-13]
version: [R2021b, R2022a, R2022b, latest]
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -63,4 +63,5 @@ jobs:
MLM_WEB_LICENSE: true
MLM_WEB_ID: ${{secrets.MLM_WEB_ID}}
MLM_WEB_USER_CRED: ${{secrets.MLM_WEB_USER_CRED}}
DISPLAY: ":17.0"
DISPLAY: ":17.0"
if: ${{ success() && matrix.os != 'ubuntu-latest' }}
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [R2021a, latest]
os: [windows-latest, ubuntu-latest, macos-13]
version: [R2021b, R2022a, R2022b, latest]
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -50,6 +50,7 @@ jobs:
MLM_WEB_ID: ${{secrets.MLM_WEB_ID}}
MLM_WEB_USER_CRED: ${{secrets.MLM_WEB_USER_CRED}}
DISPLAY: ":17.0"
if: ${{ success() && matrix.os != 'ubuntu-latest' }}
- name: Run Smoke tests
run: npm run test-smoke
env:
Expand Down
5 changes: 5 additions & 0 deletions src/test/test-files/hScript2.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
a=1;
b=2;
c=3;
d=4;
e=5;
25 changes: 0 additions & 25 deletions src/test/tester/PollingUtils.ts

This file was deleted.

142 changes: 0 additions & 142 deletions src/test/tester/VSCodeTester.ts

This file was deleted.

41 changes: 41 additions & 0 deletions src/test/tools/tester/DebuggerTester.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2024-2025 The MathWorks, Inc.
import * as vet from 'vscode-extension-tester'
import * as PollingUtils from '../utils/PollingUtils'

/**
* DebuggerTester
* Used to test the debugging functionality for MATLAB in VSCode.
*/
export class DebuggerTester {
private readonly workbench: vet.Workbench
public toolbar!: vet.DebugToolbar

public constructor (workbench: vet.Workbench) {
this.workbench = workbench
}

public async waitForToolbar (): Promise<void> {
this.toolbar = await vet.DebugToolbar.create()
}

public async assertStoppedAtLine (lineNumber: number): Promise<void> {
return await PollingUtils.poll(this.getCurrentExecutionLine.bind(this), lineNumber, `Expected debugger to be stopped at ${lineNumber}`)
}

public async assertNotDebugging (): Promise<void> {
return await PollingUtils.poll(this.getCurrentExecutionLine.bind(this), -1, 'Expected debugger to not be stopped at any line')
}

private async getCurrentExecutionLine (): Promise<number> {
const editor = new vet.TextEditor()
const breakpoint = await editor.getPausedBreakpoint()
return await breakpoint?.getLineNumber() ?? -1
}

public async setToolbarPosition (position: string): Promise<void> {
const editor = await this.workbench.openSettings();
const setting = await editor.findSettingByID('debug.toolBarLocation') as vet.ComboSetting
await setting.setValue(position)
return await new vet.EditorView().closeEditor('Settings')
}
}
12 changes: 9 additions & 3 deletions src/test/tools/tester/TestSuite.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2024 The MathWorks, Inc.
// Copyright 2024-2025 The MathWorks, Inc.
import { GlobSync } from 'glob'
import * as path from 'path'
import { ExTester, ReleaseQuality } from 'vscode-extension-tester'
import * as PollingUtils from '../utils/PollingUtils'
import * as fs from 'fs';
import * as os from 'os';

Expand Down Expand Up @@ -30,8 +31,12 @@ export class TestSuite {
const settingsjson = path.join(__dirname, '..', 'config', 'settings.json')
const settings = JSON.stringify({
'MATLAB.installPath': MATLAB_PATH,
'MATLAB.telemetry': false,
'MATLAB.startDebuggerAutomatically': true,
'window.dialogStyle': 'custom',
'terminal.integrated.copyOnSelection': true
'terminal.integrated.copyOnSelection': true,
'debug.toolBarLocation': 'docked',
'workbench.startupEditor': 'none'
})
fs.writeFileSync(settingsjson, settings)
this.vscodeSettings = settingsjson
Expand All @@ -53,7 +58,7 @@ export class TestSuite {
}

/**
* Queues the array of tests provided to each run in a seperate VSCode instance
* Queues the array of tests provided to each run in a separate VSCode instance
*/
public async enqueueTests (tests: string[]): Promise<void> {
const exTester = new ExTester(this.storageFolder, this.releaseQuality, undefined)
Expand All @@ -74,6 +79,7 @@ export class TestSuite {
console.log(err)
process.exit(1)
}
await PollingUtils.pause(10000); // wait for state to be reset before running next test
}
}
}
Loading
Loading