Files
NativeScript/build/travis-scripts/check-testrun-broken.js
Erjan Gavalji 1485abaa8b Run tests in travis-CI
Add android definitions to check if they will get downloaded
Set the language to android
Attempt starting the app
Add a new redirection to the testapp-runner - a runOnly verb
Disable the install prompt
Enable the buildOnly- and runOnly- commands
Fix the version of the packages
Comment cleanup code. Workflow to be reworked
Install android 23 to make the app build
Build the test app with the @next android runtime
Add @next ability. Build with it
Specify oracle java version 8
Use switcher to switch to oraclejdk8
Switch to a single step so that build breaks on first failure
Reorder attempting to use higher nodejs
Attempt using node 5.10.1
Detect test failure
Add detection for test failures
Decrease verbosity
Extract the test checkers to a separate script
Unignore the build folder recursively. Add the fixed script
Remove the redundant node-version messages
Run the tests with Api level 21
2016-03-04 16:53:30 +02:00

26 lines
720 B
JavaScript
Executable File

#!/usr/bin/env node
var fsModule = require('fs');
var resultsFile = 'TestRunResult.txt';
var successMarker ='=== ALL TESTS COMPLETE ===';
var passMarker = /=== ALL TESTS COMPLETE ===\s+[^\n]*OK,\s+0\s+failed/mg;
var messages = {
crash: 'TEST RUN CRASHED!',
runGood: 'Test run exited successfully',
pass: 'NativeScript Cross-Platform Module Tests passed',
fail: 'TEST FAILURES FOUND!'
};
var results = fsModule.readFileSync(resultsFile, 'utf-8');
if (results.indexOf(successMarker) == -1) {
console.log(messages.crash);
process.exit(1);
} else if (results.match(passMarker)) {
console.log(messages.pass);
process.exit(0);
} else {
console.log(messages.fail);
process.exit(1);
}