2017-12-28 19:17:38 +01:00
|
|
|
/* eslint no-console: 0 */
|
|
|
|
|
2017-02-25 00:50:17 +01:00
|
|
|
/**
|
2018-05-17 17:11:34 +02:00
|
|
|
* Test Runner
|
2017-02-25 00:50:17 +01:00
|
|
|
*
|
2017-03-21 23:41:44 +01:00
|
|
|
* For running the tests in the test register.
|
2017-02-25 00:50:17 +01:00
|
|
|
*
|
2017-02-28 18:08:36 +01:00
|
|
|
* @author tlwr [toby@toby.codes]
|
2017-03-21 23:41:44 +01:00
|
|
|
* @author n1474335 [n1474335@gmail.com]
|
2017-02-25 00:50:17 +01:00
|
|
|
* @copyright Crown Copyright 2017
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
2017-03-25 14:32:35 +01:00
|
|
|
import "babel-polyfill";
|
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
import {
|
|
|
|
setLongTestFailure,
|
|
|
|
logTestReport,
|
|
|
|
} from "../lib/utils";
|
|
|
|
|
2018-03-27 00:14:23 +02:00
|
|
|
// Define global environment functions
|
|
|
|
global.ENVIRONMENT_IS_WORKER = function() {
|
|
|
|
return typeof importScripts === "function";
|
|
|
|
};
|
|
|
|
global.ENVIRONMENT_IS_NODE = function() {
|
|
|
|
return typeof process === "object" && typeof require === "function";
|
|
|
|
};
|
|
|
|
global.ENVIRONMENT_IS_WEB = function() {
|
|
|
|
return typeof window === "object";
|
|
|
|
};
|
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
import TestRegister from "../lib/TestRegister";
|
2018-12-28 22:49:40 +01:00
|
|
|
import "./tests/BCD";
|
|
|
|
import "./tests/BSON";
|
|
|
|
import "./tests/Base58";
|
|
|
|
import "./tests/Base64";
|
|
|
|
import "./tests/Base62";
|
|
|
|
import "./tests/BitwiseOp";
|
|
|
|
import "./tests/ByteRepr";
|
|
|
|
import "./tests/CartesianProduct";
|
|
|
|
import "./tests/CharEnc";
|
|
|
|
import "./tests/Checksum";
|
|
|
|
import "./tests/Ciphers";
|
|
|
|
import "./tests/Code";
|
|
|
|
import "./tests/Comment";
|
|
|
|
import "./tests/Compress";
|
|
|
|
import "./tests/ConditionalJump";
|
|
|
|
import "./tests/Crypt";
|
|
|
|
import "./tests/CSV";
|
|
|
|
import "./tests/DateTime";
|
|
|
|
import "./tests/ExtractEmailAddresses";
|
|
|
|
import "./tests/Fork";
|
|
|
|
import "./tests/FromDecimal";
|
|
|
|
import "./tests/Hash";
|
|
|
|
import "./tests/HaversineDistance";
|
|
|
|
import "./tests/Hexdump";
|
|
|
|
import "./tests/Image";
|
|
|
|
import "./tests/Jump";
|
|
|
|
import "./tests/JSONBeautify";
|
|
|
|
import "./tests/JSONMinify";
|
|
|
|
import "./tests/JWTDecode";
|
|
|
|
import "./tests/JWTSign";
|
|
|
|
import "./tests/JWTVerify";
|
|
|
|
import "./tests/MS";
|
|
|
|
import "./tests/Magic";
|
|
|
|
import "./tests/MorseCode";
|
|
|
|
import "./tests/NetBIOS";
|
|
|
|
import "./tests/OTP";
|
|
|
|
import "./tests/PGP";
|
|
|
|
import "./tests/PHP";
|
|
|
|
import "./tests/ParseIPRange";
|
|
|
|
import "./tests/ParseQRCode";
|
|
|
|
import "./tests/PowerSet";
|
|
|
|
import "./tests/Regex";
|
|
|
|
import "./tests/Register";
|
|
|
|
import "./tests/RemoveDiacritics";
|
|
|
|
import "./tests/Rotate";
|
|
|
|
import "./tests/SeqUtils";
|
|
|
|
import "./tests/SetDifference";
|
|
|
|
import "./tests/SetIntersection";
|
|
|
|
import "./tests/SetUnion";
|
|
|
|
import "./tests/StrUtils";
|
|
|
|
import "./tests/SymmetricDifference";
|
|
|
|
import "./tests/TextEncodingBruteForce";
|
|
|
|
import "./tests/TranslateDateTimeFormat";
|
|
|
|
import "./tests/Magic";
|
|
|
|
import "./tests/ParseTLV";
|
|
|
|
import "./tests/Media";
|
2019-01-10 15:53:21 +01:00
|
|
|
import "./tests/ToFromInsensitiveRegex";
|
2019-01-15 17:24:29 +01:00
|
|
|
import "./tests/YARA.mjs";
|
2019-01-18 17:05:44 +01:00
|
|
|
import "./tests/ConvertCoordinateFormat";
|
2018-05-14 19:33:16 +02:00
|
|
|
|
2018-12-26 17:33:10 +01:00
|
|
|
// Cannot test operations that use the File type yet
|
2018-12-28 22:49:40 +01:00
|
|
|
//import "./tests/SplitColourChannels";
|
2017-03-23 18:52:20 +01:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
// import "./tests/nodeApi/nodeApi";
|
|
|
|
// import "./tests/nodeApi/ops";
|
2018-05-03 11:20:13 +02:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
const testStatus = {
|
|
|
|
allTestsPassing: true,
|
|
|
|
counts: {
|
|
|
|
total: 0,
|
2019-01-04 13:14:02 +01:00
|
|
|
}
|
2017-05-03 01:40:39 +02:00
|
|
|
};
|
2017-02-28 18:08:36 +01:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
setLongTestFailure();
|
2017-03-21 23:41:44 +01:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
const logOpsTestReport = logTestReport.bind(null, testStatus);
|
2018-08-16 19:14:02 +02:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
TestRegister.runTests()
|
|
|
|
.then(logOpsTestReport);
|
2018-05-03 11:20:13 +02:00
|
|
|
|