File tree Expand file tree Collapse file tree 6 files changed +67
-7
lines changed Expand file tree Collapse file tree 6 files changed +67
-7
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,5 @@ install.*
1212
1313obj /
1414bin /
15- test /** /.vscode
15+ test /** /.vscode
16+ .logs /
Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ install:
3333script :
3434 - npm test --silent
3535
36+ after_failure :
37+ - ./.travis/printLogs.sh
38+
39+ after_success :
40+ - ./.travis/printLogs.sh
41+
3642deploy :
3743 provider : releases
3844 api_key :
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # ---------------------------------------------------------------------------------------------
4+ # Copyright (c) Microsoft Corporation. All rights reserved.
5+ # Licensed under the MIT License. See License.txt in the project root for license information.
6+ # --------------------------------------------------------------------------------------------
7+
8+ fold_start () {
9+ echo -e " travis_fold:start:$1 \033[33;1m$2 \033[0m"
10+ }
11+
12+ fold_end () {
13+ echo -e " \ntravis_fold:end:$1 \r"
14+ }
15+
16+ fold_start testLogs " Test Logs"
17+
18+ for f in ./.logs/* .log
19+ do
20+ fold_start logFile $f
21+ cat $f
22+ fold_end logFile
23+ done
24+
25+ fold_end testLogs
Original file line number Diff line number Diff line change 33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6+ let Subscriber : ( message : string ) => void ;
7+
8+ export function SubscribeToAllLoggers ( subscriber : ( message :string ) => void ) {
9+ Subscriber = subscriber ;
10+ }
11+
612export class Logger {
713 private _writer : ( message : string ) => void ;
814 private _prefix : string ;
@@ -20,17 +26,17 @@ export class Logger {
2026 if ( this . _atLineStart ) {
2127 if ( this . _indentLevel > 0 ) {
2228 const indent = " " . repeat ( this . _indentLevel * this . _indentSize ) ;
23- this . _writer ( indent ) ;
29+ this . write ( indent ) ;
2430 }
2531
2632 if ( this . _prefix ) {
27- this . _writer ( `[${ this . _prefix } ] ` ) ;
33+ this . write ( `[${ this . _prefix } ] ` ) ;
2834 }
2935
3036 this . _atLineStart = false ;
3137 }
3238
33- this . _writer ( message ) ;
39+ this . write ( message ) ;
3440 }
3541
3642 public increaseIndent ( ) : void {
@@ -53,4 +59,12 @@ export class Logger {
5359 this . _appendCore ( message + '\n' ) ;
5460 this . _atLineStart = true ;
5561 }
62+
63+ private write ( message : string ) {
64+ this . _writer ( message ) ;
65+
66+ if ( Subscriber ) {
67+ Subscriber ( message ) ;
68+ }
69+ }
5670}
Original file line number Diff line number Diff line change 33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6+ import * as fs from "fs" ;
7+
8+ import { SubscribeToAllLoggers } from "../../src/logger" ;
9+
610//
711// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
812//
1519// to report the results back to the caller. When the tests are finished, return
1620// a possible error to the callback or null if none.
1721
18- var testRunner = require ( 'vscode/lib/testrunner' ) ;
22+ let testRunner = require ( 'vscode/lib/testrunner' ) ;
1923
2024// You can directly control Mocha options by uncommenting the following lines
2125// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
@@ -26,4 +30,14 @@ testRunner.configure({
2630 useColors : true // colored output from test results
2731} ) ;
2832
33+ if ( process . env . OSVC_SUITE ) {
34+ if ( ! fs . existsSync ( "./.logs" ) ) {
35+ fs . mkdirSync ( "./.logs" ) ;
36+ }
37+
38+ let logFilePath = `./.logs/${ process . env . OSVC_SUITE } .log` ;
39+
40+ SubscribeToAllLoggers ( message => fs . appendFileSync ( logFilePath , message ) ) ;
41+ }
42+
2943module . exports = testRunner ;
Original file line number Diff line number Diff line change 1515// to report the results back to the caller. When the tests are finished, return
1616// a possible error to the callback or null if none.
1717
18- var testRunner = require ( 'vscode/lib/testrunner' ) ;
18+ let testRunner = require ( 'vscode/lib/testrunner' ) ;
1919
2020// You can directly control Mocha options by uncommenting the following lines
2121// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
@@ -26,4 +26,4 @@ testRunner.configure({
2626 useColors : true // colored output from test results
2727} ) ;
2828
29- module . exports = testRunner ;
29+ module . exports = testRunner ;
You can’t perform that action at this time.
0 commit comments