mirror of
https://github.com/urbit/shrub.git
synced 2024-11-30 22:15:47 +03:00
54 lines
1.2 KiB
JavaScript
54 lines
1.2 KiB
JavaScript
'use strict';
|
|
|
|
var fs = require('fs')
|
|
var runner = require('urbit-runner')
|
|
var Urbit = runner.Urbit;
|
|
var ERROR = runner.ERROR;
|
|
var actions = runner.actions
|
|
|
|
var args = ['-cgSF', 'zod', '-B', 'brass.pill', 'zod'];
|
|
var urbit = new Urbit(args);
|
|
|
|
// vere hangs (always?) with run in travis-ci with -P
|
|
// so we send ^Z if we hang for ~s30
|
|
function exit() {
|
|
setTimeout(function(){
|
|
urbit.pty.write('\x1a');
|
|
urbit.pty.on('exit', function(code, signal){
|
|
process.exit(0);
|
|
})
|
|
}, 30 * 1000);
|
|
|
|
return urbit.exit(0);
|
|
}
|
|
|
|
Promise.resolve(urbit)
|
|
// XX temporary
|
|
// send ctrl-x to select dojo
|
|
//
|
|
.then(function(){
|
|
return urbit.expect(/talk\[\] /)
|
|
.then(function() {
|
|
return urbit.pty.write("\x18")
|
|
})
|
|
.then(function() { return urbit })
|
|
})
|
|
.then(actions.safeBoot)
|
|
.then(actions.test)
|
|
.then(function(){
|
|
return urbit.line("|mass")
|
|
.then(function(){
|
|
return urbit.expectEcho("%ran-mass")
|
|
.then(function(){ return urbit.resetListeners(); })
|
|
})
|
|
})
|
|
.then(exit)
|
|
.catch(function(err){
|
|
// we still exit 0, Arvo errors are not our fault ...
|
|
return urbit.waitSilent()
|
|
.then(function(){
|
|
return urbit.warn("Arvo test aborted:", err);
|
|
})
|
|
.then(exit);
|
|
});
|