diff --git a/test/test.js b/test/test.js index 14150186..c3d9a2ba 100644 --- a/test/test.js +++ b/test/test.js @@ -2,15 +2,17 @@ var util = require('util'), exec = require('child_process').exec, child; -var lScript='curl http://phantomjs.googlecode.com/files/phantomjs-1.5.0-linux-x86-dynamic.tar.gz &&' + - 'tar -zxf phantomjs-1.5.0-linux-x86-dynamic.tar.gz'+ - './phantomjs/bin/phantomjs && ls'; + -child = exec(lScript, - function (error, stdout, stderr) { +exec('curl http://phantomjs.googlecode.com/files/phantomjs-1.5.0-linux-x86-dynamic.tar.gz',execFunctoin); +exec('tar -zxf phantomjs-1.5.0-linux-x86-dynamic.tar.gz',execFunctoin); +exec('./phantomjs/bin/phantomjs',execFunctoin); + +function execFunctoin(error, stdout, stderr) { console.log('stdout: ' + stdout); console.log('stderr: ' + stderr); + if (error !== null) { - console.log('exec error: ' + error); + console.log('exec error: ' + error); } -}); \ No newline at end of file +} \ No newline at end of file