Skip to content

Commit

Permalink
Fix for issue-4 (blank filenames)
Browse files Browse the repository at this point in the history
and issue-6 ("Maximum call stack size exceeded." in JS)
  • Loading branch information
RobertK66 committed Jun 20, 2016
1 parent 5a66df1 commit cb91f3c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
15 changes: 10 additions & 5 deletions TFSExtension/BuildResultsEnhancer/src/enhancer/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export class OpenCoverResult extends Object {
constructor(buffer: ArrayBuffer) {
super();

var cont = String.fromCharCode.apply(null, new Uint8Array(buffer));
// var cont = String.fromCharCode.apply(null, new Uint8Array(buffer));
var cont = this.Uint8ToString(new Uint8Array(buffer));
this.resdoc = $.parseXML(cont);
var $xml = $(this.resdoc);
var $Summary = $xml.find("Summary");
Expand All @@ -45,11 +46,15 @@ export class OpenCoverResult extends Object {
this.$trackedModules = $xml.find("Module").not("[skippedDueTo]");
}

public doSomethingElse(): string {
return "Hallo It's me. An Object Child";
public Uint8ToString(u8a: Uint8Array) :string {
var CHUNK_SZ = 0x8000;
var c = [];
for (var i = 0; i < u8a.length; i += CHUNK_SZ) {
c.push(String.fromCharCode.apply(null, u8a.subarray(i, i + CHUNK_SZ)));
}
return c.join("");
}




}

Expand Down
15 changes: 7 additions & 8 deletions TFSExtension/RunNunitWithOpenCover/RunOpenCover.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,26 @@ $nunitprojectroot = ""
$nunitproject = "<NUnitProject>
<Settings activeconfig=""Debug""/>
<Config name=""Debug"">"

$filelist = ""

foreach ($testfile in $testAssemblyFiles) {
if (!$nunitprojectroot) {
$nunitprojectroot = split-path $testfile
}
$nunitproject = $nunitproject + "<assembly path=""$testfile""/>"
$filelist = $filelist + """""$testfile"""" "
}
$nunitproject = $nunitproject + "
</Config>
</NUnitProject>"

Write-Host "Generating nunit project file at $nunitprojectroot with content: $nunitproject"
$nunitproject | Out-File $nunitprojectroot\project.nunit
#Write-Host "Generating nunit project file at $nunitprojectroot with content: $nunitproject"
#$nunitproject | Out-File $nunitprojectroot\project.nunit

$cmd = ".\${ocToolPath}\OpenCover.Console.exe"
$arg1 = "-target:"".\$nuToolPath\nunit3-console.exe"""
$arg2 = "-targetargs:""$nunitprojectroot\project.nunit --work=$outputPath"""
$arg2 = "-targetargs:""$filelist --work=$outputPath"""
$arg3 = "-filter:""$coverageFilter"""
$arg4 = "-register:$registerOption"
$arg5 = "-coverbytest:*"
Expand Down Expand Up @@ -97,8 +101,3 @@ Write-Host "Executing:'& $cmd $arg1 $arg2 $arg3 $arg4 $arg5 $arg6' "
& $cmd $arg1 $arg2 $arg3 $arg4 $arg5 $arg6

Write-Host "RunOpenCover.ps1 finished."





2 changes: 1 addition & 1 deletion TFSExtension/RunNunitWithOpenCover/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 0,
"Patch": 2
"Patch": 3
},
"demands": [
"Cmd"
Expand Down

0 comments on commit cb91f3c

Please sign in to comment.