4
function assert(condition, message) {
6
print("Assertion failed ", message);
7
throw new Error(message || "Assertion failed");
11
if(typeof process !== 'undefined')
13
console.log('running from nodejs');
14
console.log('path', process.env.NODE_PATH);
15
console.log("teste1");
18
assert(efl != null, "could not load efl node module");
22
print_error = function() {
23
if (process.argv.indexOf("--supress-errors") == -1)
24
console.error.apply(null, arguments);
26
print_info = function() {
27
if (process.argv.indexOf("--verbose") != -1)
28
console.info.apply(null, arguments);
30
exit = efl.Ecore.Mainloop.quit;
34
assert = function(test, message) { if (test !== true) throw message; };
35
print('running from libv8')
49
function start_test(test_name, test_func) {
50
print("[ RUN ] Ethumb.js_suite: " + test_name);
51
var test_result = true;
55
suite_success = false;
57
print_error("Error: ", e, e.stack);
59
print("[ " + (test_result ? "PASS" : "FAIL") + " ] Ethumb.js_suite: " + test_name);
63
suite_fail.push(test_name);
67
efl.Ethumb.initClient();
71
start_test('dummy test', function () {
75
efl.Ethumb.shutdownClient();
80
print ("[ Total tests run: %s ]", suite_ok + suite_fail.length);
81
print ("[ Total successful: %s ]", suite_ok);
82
print ("[ Total failures: %s ]", suite_fail.length);
83
print ("[ Tests failed: ]");
84
for (var i = 0; i < suite_fail.length; i++) {
85
print ("[ %s]", suite_fail[i]);
87
assert(false, "[ Test suite fail ]");
89
print ("[ Test execution with success ]");
90
print ("[ Total tests run: %s ]", suite_ok);