<commit_before>/* jshint node:true */
/* global phantom, console */

// PhantomJS driver for loading enyo-amf tests and checking for failures
var page = require('webpage').create();

page.settings.localToRemoteUrlAccessEnabled = true;

page.onConsoleMessage = function (msg) {
	console.log("JS: " + msg);
	if (msg === "TEST RUNNER FINISHED") {
		var pass = page.evaluate(function() {
			return (document.querySelector(".enyo-amf-testcase-failed") === null);
		});
		if (pass) {
			console.log("enyo-amf tests passed!");
			phantom.exit(0);
		} else {
			console.log("enyo-amf tests failed. :(");
			phantom.exit(1);
		}
	}
};

page.onError = function(msg, trace) {
	phantom.exit(1);
};

page.open("tools/test/amfx/index.html", function(status) {
	if (status !== "success") {
		console.log("Error loading page, status: " + status);
		phantom.exit(1);
	}
});

setTimeout(function() {
	console.log("timed out after 1 minute");
	phantom.exit(1);
}, 60 * 1000);<commit_msg>phatomjs script exit codes<commit_after>/* jshint node:true */
/* global phantom, console */

// PhantomJS driver for loading enyo-amf tests and checking for failures
var page = require('webpage').create();

page.settings.localToRemoteUrlAccessEnabled = true;

page.onConsoleMessage = function (msg) {
	console.log("JS: " + msg);
	if (msg === "TEST RUNNER FINISHED") {
		var pass = page.evaluate(function() {
			return (document.querySelector(".enyo-amf-testcase-failed") === null);
		});
		if (pass) {
			console.log("enyo-amf tests passed.");
			phantom.exit(0);
		} else {
			console.log("enyo-amf tests failed.");
			phantom.exit(1);
		}
	}
};

page.onError = function(msg, trace) {
	phantom.exit(2);
};

page.open("tools/test/amfx/index.html", function(status) {
	if (status !== "success") {
		console.log("error loading page, status: " + status);
		phantom.exit(3);
	}
});

setTimeout(function() {
	console.log("timed out after 1 minute");
	phantom.exit(4);
}, 60 * 1000);
{'fraction_non_alphanumeric': 0.18088386433710174, 'fraction_numerical': 0.012332990750256937, 'mean_word_length': 4.178191489361702, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '908801', 'n_tokens_mistral': 737, 'n_tokens_neox': 666, 'n_words': 146}