Skip to content

Commit

Permalink
Now unit test can run with or without input file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Egeberg Hansen committed Dec 19, 2023
1 parent 086132f commit 7cec9d2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions vs-code-extension/client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ export async function activate(context: ExtensionContext) {

const fileChangedEmitter = new vscode.EventEmitter<vscode.Uri>();

// let runCobolCheck_Cmd = vscode.commands.registerCommand('cobolcheck.run', (pathToExpandedProgram : string) => {
let runCobolCheck_Cmd = vscode.commands.registerCommand('cobolcheck.run', () => {
let runCobolCheck_Cmd = vscode.commands.registerCommand('cobolcheck.run', (pathToExpandedProgram : string) => {
//Setting loader
vscode.window.withProgress({location: vscode.ProgressLocation.Notification, cancellable: true, title: 'Cobol Check running:'},
async (progress) => {
Expand All @@ -42,15 +41,15 @@ export async function activate(context: ExtensionContext) {

//Getting arguments to run
let applicationSourceDir = await getConfigurationValueFor(configPath, 'application.source.directory');
// let argument : string = ''
// console.log("Cobol-check extention: pathToExpandedProgram=" + pathToExpandedProgram)
// if(pathToExpandedProgram === undefined) {
let argument : string = getCobolCheckRunArgumentsBasedOnCurrentFile(externalVsCodeInstallationDir, configPath, applicationSourceDir, vscode.window.activeTextEditor.document.uri.fsPath);
// }
// else {
// argument = getCobolCheckRunArgumentsBasedOnCurrentFile(externalVsCodeInstallationDir, configPath, applicationSourceDir, pathToExpandedProgram);
// }
// console.log("Cobol-check extention: argument=" + argument)
let argument : string = null
console.log("Cobol-check extention: pathToExpandedProgram=" + pathToExpandedProgram)
if(pathToExpandedProgram === undefined) {
argument = getCobolCheckRunArgumentsBasedOnCurrentFile(externalVsCodeInstallationDir, configPath, applicationSourceDir, vscode.window.activeTextEditor.document.uri.fsPath);
}
else {
argument = getCobolCheckRunArgumentsBasedOnCurrentFile(externalVsCodeInstallationDir, configPath, applicationSourceDir, pathToExpandedProgram);
}
console.log("Cobol-check extention: argument=" + argument)
if (argument === null) return;

progress.report({ message: 'Running tests' })
Expand Down

0 comments on commit 7cec9d2

Please sign in to comment.