-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is not quite the test runner talked about in issue #26 but is the first step towards that. This should integrate with the new integration system which should mean we start running tests with every check-in
- Loading branch information
1 parent
0b6c2d6
commit bb2d8f5
Showing
2 changed files
with
65 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
var execFile = require('child_process').execFile, | ||
assert = require('assert'), | ||
vows = require('vows'), | ||
fs = require('fs-extra'), | ||
path = require('path'), | ||
|
||
FruitJSFile = path.resolve(__dirname, '../bin/cli'), | ||
OutputFolder = path.resolve(__dirname, 'test-output'), | ||
|
||
testManifestFiles = [ | ||
"Generation/Headers/uniqueid.manifest.json" | ||
, "Links/crosspage.multipage.manifest.json" | ||
, "Links/crosspage.singlepage.manifest.json" | ||
, "Menu/post.array.manifest.json" | ||
, "Menu/pre.array.manifest.json" | ||
, "Menu/post.object.manifest.json" | ||
, "Menu/pre.object.manifest.json" | ||
, "Menu/post.object.sub.manifest.json" | ||
, "Menu/pre.object.sub.manifest.json" | ||
, "Resources/automated.gathering.manifest.json" | ||
// , "Resources/folder.gathering.manifest.json" -- Failing; see issue #30 | ||
]; | ||
|
||
var execSuite = vows.describe('FruitJS Clean Execution'); | ||
|
||
function addTestFile(testFile, output) { | ||
var testObj = {}; | ||
|
||
testObj['Running FruitJS against '+testFile] = { | ||
topic: function () { | ||
if(fs.existsSync(output)) | ||
fs.removeSync(output); | ||
execFile('node', [FruitJSFile, testFile, '-o', output], {cwd: __dirname, timeout: 5000}, this.callback); | ||
}, | ||
'we should report success' : function (err, stdout) { | ||
assert.include(stdout.toString(), 'success'); | ||
}, | ||
'we should have the proper output folder': function () { | ||
assert(fs.existsSync(output)); | ||
}, | ||
'we should have nothing in stderr': function (err, stdout, stderr) { | ||
assert.isEmpty(stderr.toString()); | ||
}, | ||
teardown: function () { | ||
fs.removeSync(output); | ||
} | ||
}; | ||
|
||
execSuite.addBatch(testObj); | ||
} | ||
|
||
// For now we are simply going to run each and make sure we compile it properly without error. | ||
// We are not doing any output checking at the moment | ||
for(var t = 0, l = testManifestFiles.length; t < l; t++) { | ||
addTestFile(testManifestFiles[t], OutputFolder + '-' + t); | ||
} | ||
|
||
execSuite.export(module); |