Tests: allowing to define own test function per test suite.
diff --git a/test/webcrypto/aes.js b/test/webcrypto/aes.js
index 1b8219f..85577fc 100644
--- a/test/webcrypto/aes.js
+++ b/test/webcrypto/aes.js
@@ -2,7 +2,7 @@
     crypto = require('crypto').webcrypto;
 }
 
-async function run(tlist, T, prepare_args) {
+async function run(tlist) {
     function validate(t, r, i) {
         if (r.status == "fulfilled" && !t[i].exception) {
             return r.value === "SUCCESS";
@@ -22,7 +22,7 @@
 
     for (let k = 0; k < tlist.length; k++) {
         let ts = tlist[k];
-        let results = await Promise.allSettled(ts.tests.map(t => T(prepare_args(t, ts.opts))));
+        let results = await Promise.allSettled(ts.tests.map(t => ts.T(ts.prepare_args(t, ts.opts))));
         let r = results.map((r, i) => validate(ts.tests, r, i));
 
         console.log(`${ts.name} ${r.every(v=>v == true) ? "SUCCESS" : "FAILED"}`);
@@ -77,6 +77,8 @@
 
 let aes_tsuite = {
     name: "AES encoding/decoding",
+    T: test,
+    prepare_args: p,
     opts: {
         iv: "44556677445566774455667744556677",
         key: "00112233001122330011223300112233",
@@ -120,4 +122,4 @@
         { name: "AES-CBC", data: "aabbccdd".repeat(5), iv: "ffffffffffffffffffffffffffffffff" },
 ]};
 
-run([aes_tsuite], test, p);
+run([aes_tsuite]);
diff --git a/test/webcrypto/aes_decoding.js b/test/webcrypto/aes_decoding.js
index 3b4dfe7..d518856 100644
--- a/test/webcrypto/aes_decoding.js
+++ b/test/webcrypto/aes_decoding.js
@@ -4,7 +4,7 @@
     crypto = require('crypto').webcrypto;
 }
 
-async function run(tlist, T, prepare_args) {
+async function run(tlist) {
     function validate(t, r, i) {
         if (r.status == "fulfilled" && !t[i].exception) {
             return r.value === "SUCCESS";
@@ -24,7 +24,7 @@
 
     for (let k = 0; k < tlist.length; k++) {
         let ts = tlist[k];
-        let results = await Promise.allSettled(ts.tests.map(t => T(prepare_args(t, ts.opts))));
+        let results = await Promise.allSettled(ts.tests.map(t => ts.T(ts.prepare_args(t, ts.opts))));
         let r = results.map((r, i) => validate(ts.tests, r, i));
 
         console.log(`${ts.name} ${r.every(v=>v == true) ? "SUCCESS" : "FAILED"}`);
@@ -79,6 +79,8 @@
 
 let aes_tsuite = {
     name: "AES decoding",
+    T: test,
+    prepare_args: p,
     opts: {
         key: "00112233001122330011223300112233",
         iv: "44556677445566774455667744556677",
@@ -113,4 +115,4 @@
           expected: "AES-CBC-256-SECRET-TEXT" },
 ]};
 
-run([aes_tsuite], test, p);
+run([aes_tsuite]);
diff --git a/test/webcrypto/derive.js b/test/webcrypto/derive.js
index e2f6917..8c87c01 100644
--- a/test/webcrypto/derive.js
+++ b/test/webcrypto/derive.js
@@ -2,7 +2,7 @@
     crypto = require('crypto').webcrypto;
 }
 
-async function run(tlist, T, prepare_args) {
+async function run(tlist) {
     function validate(t, r, i) {
         if (r.status == "fulfilled" && !t[i].exception) {
             return r.value === "SUCCESS";
@@ -26,7 +26,7 @@
 
     for (let k = 0; k < tlist.length; k++) {
         let ts = tlist[k];
-        let results = await Promise.allSettled(ts.tests.map(t => T(prepare_args(t, ts.opts))));
+        let results = await Promise.allSettled(ts.tests.map(t => ts.T(ts.prepare_args(t, ts.opts))));
         let r = results.map((r, i) => validate(ts.tests, r, i));
 
         console.log(`${ts.name} ${r.every(v=>v == true) ? "SUCCESS" : "FAILED"}`);
@@ -96,6 +96,8 @@
 
 let derive_tsuite = {
     name: "derive",
+    T: test,
+    prepare_args: p,
     opts: {
         text: "secReT",
         pass: "passW0rd",
@@ -146,4 +148,4 @@
           expected: "e089c7491711306c69e077aa19fae6bfd2d4a6d240b0d37317d50472d7291a3e" },
 ]};
 
-run([derive_tsuite], test, p);
+run([derive_tsuite]);
diff --git a/test/webcrypto/digest.js b/test/webcrypto/digest.js
index 4eed191..77d6ad1 100644
--- a/test/webcrypto/digest.js
+++ b/test/webcrypto/digest.js
@@ -2,7 +2,7 @@
     crypto = require('crypto').webcrypto;
 }
 
-async function run(tlist, T, prepare_args) {
+async function run(tlist) {
     function validate(t, r, i) {
         if (r.status == "fulfilled" && !t[i].exception) {
             return r.value === "SUCCESS";
@@ -22,7 +22,7 @@
 
     for (let k = 0; k < tlist.length; k++) {
         let ts = tlist[k];
-        let results = await Promise.allSettled(ts.tests.map(t => T(prepare_args(t, ts.opts))));
+        let results = await Promise.allSettled(ts.tests.map(t => ts.T(ts.prepare_args(t, ts.opts))));
         let r = results.map((r, i) => validate(ts.tests, r, i));
 
         console.log(`${ts.name} ${r.every(v=>v == true) ? "SUCCESS" : "FAILED"}`);
@@ -54,6 +54,8 @@
 
 let digest_tsuite = {
     name: "SHA digest",
+    T: test,
+    prepare_args: p,
     opts: { },
 
     tests: [
@@ -85,4 +87,4 @@
           expected: "cdea58919606ea9ae078f7595b192b84446f2189" },
 ]};
 
-run([digest_tsuite], test, p);
+run([digest_tsuite]);
diff --git a/test/webcrypto/rsa.js b/test/webcrypto/rsa.js
index 36744d8..42d68d0 100644
--- a/test/webcrypto/rsa.js
+++ b/test/webcrypto/rsa.js
@@ -4,7 +4,7 @@
     crypto = require('crypto').webcrypto;
 }
 
-async function run(tlist, T, prepare_args) {
+async function run(tlist) {
     function validate(t, r, i) {
         if (r.status == "fulfilled" && !t[i].exception) {
             return r.value === "SUCCESS";
@@ -24,7 +24,7 @@
 
     for (let k = 0; k < tlist.length; k++) {
         let ts = tlist[k];
-        let results = await Promise.allSettled(ts.tests.map(t => T(prepare_args(t, ts.opts))));
+        let results = await Promise.allSettled(ts.tests.map(t => ts.T(ts.prepare_args(t, ts.opts))));
         let r = results.map((r, i) => validate(ts.tests, r, i));
 
         console.log(`${ts.name} ${r.every(v=>v == true) ? "SUCCESS" : "FAILED"}`);
@@ -79,6 +79,8 @@
 
 let rsa_tsuite = {
     name: "RSA-OAEP encoding/decoding",
+    T: test,
+    prepare_args: p,
     opts: {
         spki: "rsa.spki",
         spki_hash: "SHA-256",
@@ -103,4 +105,4 @@
         { data: "aabbcc", spki: "rsa2.spki", exception: "Error: EVP_PKEY_decrypt() failed" },
 ]};
 
-run([rsa_tsuite], test, p);
+run([rsa_tsuite]);
diff --git a/test/webcrypto/rsa_decoding.js b/test/webcrypto/rsa_decoding.js
index c5e0f65..4ebdd0f 100644
--- a/test/webcrypto/rsa_decoding.js
+++ b/test/webcrypto/rsa_decoding.js
@@ -4,7 +4,7 @@
     crypto = require('crypto').webcrypto;
 }
 
-async function run(tlist, T, prepare_args) {
+async function run(tlist) {
     function validate(t, r, i) {
         if (r.status == "fulfilled" && !t[i].exception) {
             return r.value === "SUCCESS";
@@ -24,7 +24,7 @@
 
     for (let k = 0; k < tlist.length; k++) {
         let ts = tlist[k];
-        let results = await Promise.allSettled(ts.tests.map(t => T(prepare_args(t, ts.opts))));
+        let results = await Promise.allSettled(ts.tests.map(t => ts.T(ts.prepare_args(t, ts.opts))));
         let r = results.map((r, i) => validate(ts.tests, r, i));
 
         console.log(`${ts.name} ${r.every(v=>v == true) ? "SUCCESS" : "FAILED"}`);
@@ -70,6 +70,8 @@
 
 let rsa_tsuite = {
     name: "RSA-OAEP decoding",
+    T: test,
+    prepare_args: (v) => v,
     opts: { },
 
     tests: [
@@ -78,4 +80,4 @@
         { pem: "rsa.pkcs8.broken", src: "text.base64.rsa-oaep.enc", exception: "Error: d2i_PKCS8_PRIV_KEY_INFO_bio() failed" },
 ]};
 
-run([rsa_tsuite], test, (v) => v);
+run([rsa_tsuite]);
diff --git a/test/webcrypto/sign.js b/test/webcrypto/sign.js
index 0473d2a..60f5fa7 100644
--- a/test/webcrypto/sign.js
+++ b/test/webcrypto/sign.js
@@ -3,7 +3,7 @@
     crypto = require('crypto').webcrypto;
 }
 
-async function run(tlist, T, prepare_args) {
+async function run(tlist) {
     function validate(t, r, i) {
         if (r.status == "fulfilled" && !t[i].exception) {
             return r.value === "SUCCESS";
@@ -23,7 +23,7 @@
 
     for (let k = 0; k < tlist.length; k++) {
         let ts = tlist[k];
-        let results = await Promise.allSettled(ts.tests.map(t => T(prepare_args(t, ts.opts))));
+        let results = await Promise.allSettled(ts.tests.map(t => ts.T(ts.prepare_args(t, ts.opts))));
         let r = results.map((r, i) => validate(ts.tests, r, i));
 
         console.log(`${ts.name} ${r.every(v=>v == true) ? "SUCCESS" : "FAILED"}`);
@@ -160,6 +160,8 @@
 
 let hmac_tsuite = {
     name: "HMAC sign",
+    T: test,
+    prepare_args: p,
     opts: {
         text: "TExt-T0-SiGN",
         sign_key: { key: "secretKEY", fmt: "raw" },
@@ -193,6 +195,8 @@
 
 let rsassa_pkcs1_v1_5_tsuite = {
     name: "RSASSA-PKCS1-v1_5 sign",
+    T: test,
+    prepare_args: p,
     opts: {
         text: "TExt-T0-SiGN",
         sign_key: { key: "rsa.pkcs8", fmt: "pkcs8" },
@@ -221,6 +225,8 @@
 
 let rsa_pss_tsuite = {
     name: "RSA-PSS sign",
+    T: test,
+    prepare_args: p,
     opts: {
         text: "TExt-T0-SiGN",
         sign_key: { key: "rsa.pkcs8", fmt: "pkcs8" },
@@ -250,6 +256,8 @@
 
 let ecdsa_tsuite = {
     name: "ECDSA sign",
+    T: test,
+    prepare_args: p,
     opts: {
         text: "TExt-T0-SiGN",
         sign_key: { key: "ec.pkcs8", fmt: "pkcs8" },
@@ -279,4 +287,4 @@
     rsassa_pkcs1_v1_5_tsuite,
     rsa_pss_tsuite,
     ecdsa_tsuite
-], test, p);
+]);
diff --git a/test/webcrypto/verify.js b/test/webcrypto/verify.js
index a969e3b..6ae24d0 100644
--- a/test/webcrypto/verify.js
+++ b/test/webcrypto/verify.js
@@ -4,7 +4,7 @@
     crypto = require('crypto').webcrypto;
 }
 
-async function run(tlist, T, prepare_args) {
+async function run(tlist) {
     function validate(t, r, i) {
         if (r.status == "fulfilled" && !t[i].exception) {
             return r.value === "SUCCESS";
@@ -24,7 +24,7 @@
 
     for (let k = 0; k < tlist.length; k++) {
         let ts = tlist[k];
-        let results = await Promise.allSettled(ts.tests.map(t => T(prepare_args(t, ts.opts))));
+        let results = await Promise.allSettled(ts.tests.map(t => ts.T(ts.prepare_args(t, ts.opts))));
         let r = results.map((r, i) => validate(ts.tests, r, i));
 
         console.log(`${ts.name} ${r.every(v=>v == true) ? "SUCCESS" : "FAILED"}`);
@@ -108,6 +108,8 @@
 
 let hmac_tsuite = {
     name: "HMAC verify",
+    T: test,
+    prepare_args: p,
     opts: {
         text: "SigneD-TExt",
         key: { fmt: "raw", file: "aabbcc" },
@@ -130,6 +132,8 @@
 
 let rsassa_pkcs1_v1_5_tsuite = {
     name: "RSASSA-PKCS1-v1_5 verify",
+    T: test,
+    prepare_args: p,
     opts: {
         text: "SigneD-TExt",
         key: { fmt: "spki", file: "rsa.spki" },
@@ -152,6 +156,8 @@
 
 let rsa_pss_tsuite = {
     name: "RSA-PSS verify",
+    T: test,
+    prepare_args: p,
     opts: {
         text: "SigneD-TExt",
         key: { fmt: "spki", file: "rsa.spki" },
@@ -179,6 +185,8 @@
 
 let ecdsa_tsuite = {
     name: "ECDSA verify",
+    T: test,
+    prepare_args: p,
     opts: {
         text: "SigneD-TExt",
         key: { fmt: "spki", file: "ec.spki" },
@@ -204,4 +212,4 @@
     rsassa_pkcs1_v1_5_tsuite,
     rsa_pss_tsuite,
     ecdsa_tsuite,
-], test, p);
+]);