2018-05-14 19:33:16 +02:00
|
|
|
/* eslint no-console: 0 */
|
|
|
|
|
|
|
|
/**
|
2018-05-17 17:11:34 +02:00
|
|
|
* Test Runner
|
2018-05-14 19:33:16 +02:00
|
|
|
*
|
|
|
|
* For running the tests in the test register.
|
|
|
|
*
|
|
|
|
* @author tlwr [toby@toby.codes]
|
|
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
|
|
* @copyright Crown Copyright 2017
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
import {
|
|
|
|
setLongTestFailure,
|
|
|
|
logTestReport,
|
2019-09-04 18:13:05 +02:00
|
|
|
} from "../lib/utils.mjs";
|
2018-05-14 19:33:16 +02:00
|
|
|
|
2019-07-09 13:23:59 +02:00
|
|
|
import TestRegister from "../lib/TestRegister.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/BCD.mjs";
|
|
|
|
import "./tests/BSON.mjs";
|
|
|
|
import "./tests/BaconCipher.mjs";
|
|
|
|
import "./tests/Base58.mjs";
|
|
|
|
import "./tests/Base64.mjs";
|
|
|
|
import "./tests/Base62.mjs";
|
|
|
|
import "./tests/BitwiseOp.mjs";
|
|
|
|
import "./tests/ByteRepr.mjs";
|
|
|
|
import "./tests/CartesianProduct.mjs";
|
|
|
|
import "./tests/CharEnc.mjs";
|
|
|
|
import "./tests/ChangeIPFormat.mjs";
|
|
|
|
import "./tests/Charts.mjs";
|
|
|
|
import "./tests/Checksum.mjs";
|
|
|
|
import "./tests/Ciphers.mjs";
|
|
|
|
import "./tests/Code.mjs";
|
|
|
|
import "./tests/Comment.mjs";
|
|
|
|
import "./tests/Compress.mjs";
|
|
|
|
import "./tests/ConditionalJump.mjs";
|
|
|
|
import "./tests/Crypt.mjs";
|
|
|
|
import "./tests/CSV.mjs";
|
|
|
|
import "./tests/DateTime.mjs";
|
|
|
|
import "./tests/ExtractEmailAddresses.mjs";
|
|
|
|
import "./tests/Fork.mjs";
|
|
|
|
import "./tests/FromDecimal.mjs";
|
2019-12-17 13:15:11 +01:00
|
|
|
import "./tests/Gzip.mjs";
|
2019-12-17 13:28:09 +01:00
|
|
|
import "./tests/Gunzip.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Hash.mjs";
|
|
|
|
import "./tests/HaversineDistance.mjs";
|
2020-01-18 01:21:15 +01:00
|
|
|
import "./tests/Hex.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Hexdump.mjs";
|
|
|
|
import "./tests/Image.mjs";
|
|
|
|
import "./tests/IndexOfCoincidence.mjs";
|
|
|
|
import "./tests/Jump.mjs";
|
|
|
|
import "./tests/JSONBeautify.mjs";
|
|
|
|
import "./tests/JSONMinify.mjs";
|
|
|
|
import "./tests/JSONtoCSV.mjs";
|
|
|
|
import "./tests/JWTDecode.mjs";
|
|
|
|
import "./tests/JWTSign.mjs";
|
|
|
|
import "./tests/JWTVerify.mjs";
|
|
|
|
import "./tests/MS.mjs";
|
|
|
|
import "./tests/Magic.mjs";
|
|
|
|
import "./tests/MorseCode.mjs";
|
|
|
|
import "./tests/NetBIOS.mjs";
|
2019-11-25 22:53:31 +01:00
|
|
|
import "./tests/NormaliseUnicode.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/OTP.mjs";
|
|
|
|
import "./tests/PGP.mjs";
|
|
|
|
import "./tests/PHP.mjs";
|
|
|
|
import "./tests/ParseIPRange.mjs";
|
|
|
|
import "./tests/ParseQRCode.mjs";
|
|
|
|
import "./tests/PowerSet.mjs";
|
|
|
|
import "./tests/Regex.mjs";
|
|
|
|
import "./tests/Register.mjs";
|
|
|
|
import "./tests/Rotate.mjs";
|
|
|
|
import "./tests/SeqUtils.mjs";
|
|
|
|
import "./tests/SetDifference.mjs";
|
|
|
|
import "./tests/SetIntersection.mjs";
|
|
|
|
import "./tests/SetUnion.mjs";
|
|
|
|
import "./tests/StrUtils.mjs";
|
|
|
|
import "./tests/SymmetricDifference.mjs";
|
|
|
|
import "./tests/TextEncodingBruteForce.mjs";
|
|
|
|
import "./tests/TranslateDateTimeFormat.mjs";
|
|
|
|
import "./tests/Magic.mjs";
|
|
|
|
import "./tests/ParseTLV.mjs";
|
|
|
|
import "./tests/Media.mjs";
|
|
|
|
import "./tests/ToFromInsensitiveRegex.mjs";
|
2019-01-15 17:24:29 +01:00
|
|
|
import "./tests/YARA.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/ConvertCoordinateFormat.mjs";
|
|
|
|
import "./tests/Enigma.mjs";
|
|
|
|
import "./tests/Bombe.mjs";
|
|
|
|
import "./tests/MultipleBombe.mjs";
|
|
|
|
import "./tests/Typex.mjs";
|
|
|
|
import "./tests/BLAKE2b.mjs";
|
|
|
|
import "./tests/BLAKE2s.mjs";
|
|
|
|
import "./tests/Protobuf.mjs";
|
|
|
|
import "./tests/ParseSSHHostKey.mjs";
|
|
|
|
import "./tests/DefangIP.mjs";
|
|
|
|
import "./tests/ParseUDP.mjs";
|
2019-10-31 15:17:07 +01:00
|
|
|
import "./tests/AvroToJSON.mjs";
|
2019-10-29 22:39:29 +01:00
|
|
|
import "./tests/Lorenz.mjs";
|
2020-02-26 11:55:15 +01:00
|
|
|
import "./tests/LuhnChecksum.mjs";
|
2020-03-05 16:25:10 +01:00
|
|
|
import "./tests/CipherSaber2.mjs";
|
2019-12-04 23:43:22 +01:00
|
|
|
import "./tests/Colossus.mjs";
|
2020-03-27 12:56:42 +01:00
|
|
|
import "./tests/ParseObjectIDTimestamp.mjs";
|
2020-08-19 11:55:29 +02:00
|
|
|
import "./tests/Unicode.mjs";
|
2021-02-01 20:15:32 +01:00
|
|
|
import "./tests/RSA.mjs";
|
2020-03-26 12:44:57 +01:00
|
|
|
import "./tests/CBOREncode.mjs";
|
2020-03-28 21:13:49 +01:00
|
|
|
import "./tests/CBORDecode.mjs";
|
2021-07-28 15:32:39 +02:00
|
|
|
import "./tests/TLSJA3Fingerprint.mjs";
|
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
|
2019-09-04 18:13:05 +02:00
|
|
|
// import "./tests/SplitColourChannels.mjs";
|
2021-02-01 20:15:32 +01:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
const testStatus = {
|
|
|
|
allTestsPassing: true,
|
|
|
|
counts: {
|
|
|
|
total: 0,
|
2018-05-14 19:33:16 +02:00
|
|
|
}
|
2017-05-03 01:40:39 +02:00
|
|
|
};
|
2018-05-14 19:33:16 +02:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
setLongTestFailure();
|
2018-05-14 19:33:16 +02:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
const logOpsTestReport = logTestReport.bind(null, testStatus);
|
2018-05-14 19:33:16 +02:00
|
|
|
|
2020-03-13 15:59:48 +01:00
|
|
|
(async function() {
|
|
|
|
const results = await TestRegister.runTests();
|
|
|
|
logOpsTestReport(results);
|
|
|
|
})();
|