<commit_before>var fs = require('fs'),
	path = require('path'),
	wrench = require('wrench'),
	TU = require('../lib/testUtils'),
	CONST = require('../../Alloy/common/constants'),
	_ = require('../../Alloy/lib/alloy/underscore')._;
	
var PLATFORMS = process.platform === 'darwin' ? 
		CONST.PLATFORMS :
		_.reject(CONST.PLATFORMS, function(p) { return p === 'ios'; }), 
		//['android','ios','mobileweb'] : ['android','mobileweb'],
	TIMEOUT_COMPILE = 10000,
	TIMEOUT_DEFAULT = 750;

var alloyRoot = path.join(__dirname,'..','..'),
	paths = {
		apps: path.join(alloyRoot,'test','apps'),
		harness: path.join(alloyRoot,'test','projects','Harness') 
	};

// The alloy command test suite
describe('alloy compile', function() {
	// Iterate through each test app and make sure it compiles for all platforms
	_.each(wrench.readdirSyncRecursive(paths.apps), function(file) {
		var indexXml = path.join(paths.apps,file,'views','index.xml');
		if (path.existsSync(indexXml)) {
			_.each(PLATFORMS, function(platform) {
				it('compiles "' + file + '" test app for platform [' + platform + ']', function() {
					var cmds = [
						'jake app:setup dir=' + file + ' quiet=1',
						'alloy compile ' + paths.harness + ' --config platform=' + platform
					];
					TU.asyncExecTest(cmds.join(' && '), {
						test: function() {
							var o = this.output;

							// Make sure there were no compile errors
							expect(o.error).toBeFalsy();
						},
						timeout: TIMEOUT_COMPILE
					});
				});
			});
		}
	});
});
<commit_msg>only setup test app once per compile test, doubles speed<commit_after>var fs = require('fs'),
	path = require('path'),
	wrench = require('wrench'),
	TU = require('../lib/testUtils'),
	CONST = require('../../Alloy/common/constants'),
	_ = require('../../Alloy/lib/alloy/underscore')._;
	
var TIMEOUT_COMPILE = 10000;

var alloyRoot = path.join(__dirname,'..','..'),
	paths = {
		apps: path.join(alloyRoot,'test','apps'),
		harness: path.join(alloyRoot,'test','projects','Harness') 
	};

// The alloy command test suite
describe('alloy compile', function() {
	// Iterate through each test app and make sure it compiles for all platforms
	_.each(wrench.readdirSyncRecursive(paths.apps), function(file) {
		var indexXml = path.join(paths.apps,file,'views','index.xml');
		if (path.existsSync(indexXml)) {
			it('preparing test app "' + file + '"', function() {
				TU.asyncExecTest('jake app:setup dir=' + file + ' quiet=1');
			});

			_.each(CONST.PLATFORMS, function(platform) {
				it('compiles "' + file + '" test app for platform [' + platform + ']', function() {
					TU.asyncExecTest('alloy compile ' + paths.harness + ' --config platform=' + platform, {
						test: function() {
							var o = this.output;

							// Make sure there were no compile errors
							expect(o.error).toBeFalsy();
						},
						timeout: TIMEOUT_COMPILE
					});
				});
			});
		}
	});
});

{'fraction_non_alphanumeric': 0.1886465905157494, 'fraction_numerical': 0.005192107995846314, 'mean_word_length': 3.453004622496148, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4700939', 'n_tokens_mistral': 1105, 'n_tokens_neox': 938, 'n_words': 204}