initial commit
This commit is contained in:
commit
4b60ece582
327 changed files with 28286 additions and 0 deletions
3
lorgar/test/CMakeLists.txt
Normal file
3
lorgar/test/CMakeLists.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
configure_file(test.js test.js)
|
73
lorgar/test/test.js
Normal file
73
lorgar/test/test.js
Normal file
|
@ -0,0 +1,73 @@
|
|||
"use strict";
|
||||
(function test_js() {
|
||||
var moduleName = "test/test";
|
||||
|
||||
var defineArray = [];
|
||||
defineArray.push("lib/utils/class");
|
||||
defineArray.push("lib/wTest/abstractmap");
|
||||
defineArray.push("lib/wTest/abstractlist");
|
||||
defineArray.push("lib/wTest/abstractorder");
|
||||
|
||||
define(moduleName, defineArray, function test_module() {
|
||||
var Class = require("lib/utils/class");
|
||||
var TAbstractMap = require("lib/wTest/abstractmap");
|
||||
var TAbstractList = require("lib/wTest/abstractlist");
|
||||
var TAbstractOrder = require("lib/wTest/abstractorder");
|
||||
|
||||
var Test = Class.inherit({
|
||||
"className": "Test",
|
||||
"constructor": function() {
|
||||
Class.fn.constructor.call(this);
|
||||
|
||||
this._s = 0;
|
||||
this._t = 0;
|
||||
this._tests = [];
|
||||
|
||||
this.addTest(new TAbstractList());
|
||||
this.addTest(new TAbstractMap());
|
||||
this.addTest(new TAbstractOrder());
|
||||
},
|
||||
"destructor": function() {
|
||||
for (var i = 0; i < this._tests.length; ++i) {
|
||||
this._tests[i].destructor();
|
||||
}
|
||||
|
||||
Class.fn.destructor.call(this);
|
||||
},
|
||||
"addTest": function(test) {
|
||||
test.on("start", this._onStart, this);
|
||||
test.on("end", this._onEnd, this);
|
||||
test.on("progress", this._onProgress, this);
|
||||
test.on("fail", this._onFail, this);
|
||||
|
||||
this._tests.push(test);
|
||||
},
|
||||
"run": function() {
|
||||
console.info("Starting tests");
|
||||
for (var i = 0; i < this._tests.length; ++i) {
|
||||
this._tests[i].run();
|
||||
}
|
||||
console.info("Testing complete. " + this._s + "/" + this._t);
|
||||
},
|
||||
"_onStart": function(name) {
|
||||
console.info("Testing " + name);
|
||||
},
|
||||
"_onEnd": function(name, s, t) {
|
||||
console.info("Finished " + name + ". " + s + "/" + t);
|
||||
|
||||
this._s += s;
|
||||
this._t += t;
|
||||
},
|
||||
"_onProgress": function(name, current, total) {
|
||||
|
||||
},
|
||||
"_onFail": function(name, current, error) {
|
||||
console.warn("Test failed! Action " + current + ".");
|
||||
console.warn("Error message:" + error.message);
|
||||
console.warn("Error stack: \n" + error.stack);
|
||||
}
|
||||
});
|
||||
|
||||
return Test;
|
||||
});
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue