Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

implemented windows compatible test-runner

  • Loading branch information...
commit 8b8932ff684602ab5b45b1ea88d510ee81c07ba4 1 parent 488500e
@schaermu schaermu authored
View
7 build.bat
@@ -0,0 +1,7 @@
+@echo off
+set REPORTER="list"
+
+:test
+ setx NODE_ENV "test"
+ node_modules\.bin\mocha.cmd -u bdd --require should --reporter "%REPORTER%"
+ setx NODE_ENV "production"
View
2  examples/progress.js
@@ -16,4 +16,4 @@ var proc = new ffmpeg({ source: infs, nolog: true })
})
.saveToFile('/path/to/your_target.flv', function(stdout, stderr, err) {
console.log('done processing input stream');
- });
+ });
View
3  lib/debug.js
@@ -1,4 +1,3 @@
-
exports = module.exports = function Debug(command) {
this.getCommand = function(outputmethod, callback) {
var self = this;
@@ -43,4 +42,4 @@ exports = module.exports = function Debug(command) {
return this.buildFfmpegArgs(true, null);
}
};
-};
+};
View
2  lib/fluent-ffmpeg.js
@@ -312,4 +312,4 @@ exports.Metadata = require('./metadata');
exports.Calculate = require('./calculate');
exports.CONSTANT_BITRATE = 1;
-exports.VARIABLE_BITRATE = 2;
+exports.VARIABLE_BITRATE = 2;
View
7 test/args.test.js
@@ -1,6 +1,7 @@
var Ffmpeg = require('../index'),
path = require('path'),
- exec = require('child_process').exec;
+ exec = require('child_process').exec,
+ testhelper = require('./helpers');
describe('Command', function() {
before(function(done) {
@@ -9,8 +10,8 @@ describe('Command', function() {
this.testfilewide = __dirname + '/assets/testvideo-169.avi';
var self = this;
- exec('which ffmpeg', function(err, stdout, stderr) {
- if (stdout !== '') {
+ exec(testhelper.getFfmpegCheck(), function(err, stdout, stderr) {
+ if (!err) {
// check if file exists
path.exists(self.testfile, function(exists) {
if (exists) {
View
7 test/debug.test.js
@@ -1,6 +1,7 @@
var Ffmpeg = require('../index'),
path = require('path'),
- exec = require('child_process').exec;
+ exec = require('child_process').exec
+ testhelper = require('./helpers');
describe('Debug', function() {
before(function(done) {
@@ -9,8 +10,8 @@ describe('Debug', function() {
this.testfilewide = __dirname + '/assets/testvideo-169.avi';
var self = this;
- exec('which ffmpeg', function(err, stdout, stderr) {
- if (stdout !== '') {
+ exec(testhelper.getFfmpegCheck(), function(err, stdout, stderr) {
+ if (!err) {
// check if file exists
path.exists(self.testfile, function(exists) {
if (exists) {
View
13 test/helpers.js
@@ -0,0 +1,13 @@
+exports = module.exports = TestHelpers = {
+ getFfmpegCheck: function() {
+ var platform = require('os').platform();
+
+ if (!platform.match(/win(32|64)/)) {
+ // linux/mac, use which
+ return 'which ffmpeg';
+ } else {
+ // windows, use where (> windows server 2003 / windows 7)
+ return 'where /Q ffmpeg';
+ }
+ }
+}
View
7 test/processor.test.js
@@ -3,7 +3,8 @@ var Ffmpeg = require('../index'),
fs = require('fs'),
assert = require('assert'),
os = require('os').platform(),
- exec = require('child_process').exec;
+ exec = require('child_process').exec,
+ testhelper = require('./helpers');
describe('Processor', function() {
before(function(done) {
@@ -13,8 +14,8 @@ describe('Processor', function() {
this.testfileEscaped = __dirname + '/assets/te[s]t audio \' " .ogg';
var self = this;
- exec('which ffmpeg', function(err, stdout, stderr) {
- if (stdout !== '') {
+ exec(testhelper.getFfmpegCheck(), function(err, stdout, stderr) {
+ if (!err) {
// check if file exists
path.exists(self.testfile, function(exists) {
if (exists) {
Please sign in to comment.
Something went wrong with that request. Please try again.