Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode: update package name and refine logging #11083

Merged
merged 2 commits into from
Oct 6, 2023
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 tools/vscode-extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion tools/vscode-extension/src/commands/cmdEndToEndCoverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ async function endToEndRun(
vscode.window.showInformationMessage(
'Building project: ' + ossFuzzProjectNameInput.toString()
);
await buildFuzzersFromWorkspace(ossFuzzProjectNameInput.toString(), '', true);
if (await buildFuzzersFromWorkspace(ossFuzzProjectNameInput.toString(), '', true) == false) {
println("Failed to build project");
return;
}
println('Build projects');

// List all of the fuzzers in the project
Expand Down
4 changes: 4 additions & 0 deletions tools/vscode-extension/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export function println(line: string) {
vscodeOutputChannel.appendLine(line);
}

export function printRaw(line: string) {
vscodeOutputChannel.append(line);
}

export function debugPrintln(line: string) {
console.log(line);
}
6 changes: 3 additions & 3 deletions tools/vscode-extension/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as vscode from 'vscode';
const fs = require('fs');
const {spawn} = require('node:child_process');

import {println, debugPrintln} from './logger';
import {println, printRaw, debugPrintln} from './logger';

/**
* Checks if the current workspace has a generated OSS-Fuzz folder. This is the
Expand Down Expand Up @@ -187,10 +187,10 @@ export async function systemSync(cmd: string, args: Array<string | undefined>) {

// Callbacks for output events, to capture stdout and stderr live.
command.stdout.on('data', (x: {toString: () => string}) => {
println(x.toString());
printRaw(x.toString());
});
command.stderr.on('data', (x: {toString: () => string}) => {
println(x.toString());
printRaw(x.toString());
});

// Monitor for child exit.
Expand Down