-
Notifications
You must be signed in to change notification settings - Fork 359
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
modifications to mocha.js and some TestExecutor logic #1334
Merged
Merged
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
53d9f1a
have run_tests return structured result used by TestExecutor
ozyx b047224
have run_tests accept test data from stdin
ozyx 63d75a2
run_tests receives test data over stdin
ozyx f86fa0c
expose StandardOutput and disable async readline
ozyx 20a9973
TestExecutor receives test results over process StandardOutput
ozyx eb19e28
include testing framework in testInfo object sent to run_tests.js
ozyx 831f60a
comments
ozyx 22a5d5d
close readline interface after running test
ozyx 566851c
revert ProcessOutput
ozyx 1faba48
use JsonConvert.DeserializeObject<TestResult>() instead
ozyx b82e88d
create GetTestResultFromProcess() method
ozyx 2113caf
use Process, copy over helper methods from ProcessOutput
ozyx a512751
close StandardInput after sending test info
ozyx 3e8e08d
include dependency for copied ProcessOutput method
ozyx ca7f182
launch node inside of RunTestCases instead
ozyx bc92e13
remove some debugging stuff
ozyx 0b78611
handle case if result is null
ozyx 5338a27
pass in streams as parameters to allow continual reading/writing
ozyx 7a93d78
move setup logic to RunTests
ozyx 7eb9142
only remove double quotes from test case info
ozyx f0dc92d
move Process launch logic into function
ozyx f48b8c9
mocha uses runner events to determine test pass/fail
ozyx 89837b6
get TestExecutor in working state, still launching one process per on…
ozyx dc5df19
get TextExecutor code into working state
ozyx 36f018a
fixes from PR feedback
ozyx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
var framework; | ||
try { | ||
framework = require('./' + process.argv[2] + '/' + process.argv[2] + '.js'); | ||
} catch (exception) { | ||
console.log("NTVS_ERROR:Failed to load TestFramework (" + process.argv[2] + "), " + exception); | ||
process.exit(1); | ||
} | ||
var readline = require('readline'); | ||
|
||
framework.run_tests(process.argv[3], process.argv[4], process.argv[5], process.argv[6]); | ||
var rl = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
|
||
rl.on('line', (line) => { | ||
var testInfo = JSON.parse(line); | ||
// get rid of leftover quotations from C# (necessary?) | ||
for(var s in testInfo) { | ||
testInfo[s] = testInfo[s].replace(/["]+/g, ''); | ||
} | ||
|
||
try { | ||
framework = require('./' + testInfo.framework + '/' + testInfo.framework + '.js'); | ||
} catch (exception) { | ||
console.log("NTVS_ERROR:Failed to load TestFramework (" + process.argv[2] + "), " + exception); | ||
process.exit(1); | ||
} | ||
// run the test | ||
framework.run_tests(testInfo.testName, testInfo.testFile, testInfo.workingFolder, testInfo.projectFolder); | ||
|
||
// close readline interface | ||
rl.close(); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use
process.stdout.write = callback
here