Qore QUnit Module Reference 0.4.3
Loading...
Searching...
No Matches
QUnit.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* QUnit.qm Copyright (C) 2013 - 2023 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
25
26
27
28
29
30
205namespace QUnit {}
206
209
210public:
211 string m_type;
212 *string m_subType;
213 auto m_value;
214 constructor(string type);
215
216 constructor(string type, string subType);
217
218 // test
219 abstract bool equals(AbstractTestResult r); abstract string toString();};
220
223
224public:
225 constructor() ;
226
227
230
231 string toString();
232};
233
236
237public:
238protected:
239 *string m_detail;
240
241public:
242
245
246
248 constructor(string s) ;
249
250
253
254 string toString();
255};
256
259
260public:
261 constructor(auto value) ;
262
263
266
267 string toString();
268};
269
272
273public:
274 constructor(hash<auto> value) ;
275
276
277 bool equals(QUnit::AbstractTestResult r);
278
279 string toString();
280};
281
284
285public:
288
290
293 constructor(string exceptionType) ;
294
295
297protected:
298 constructor(string exceptionType, string subType) ;
299public:
300
301
304
306 string toString();
307};
308
311
312public:
313protected:
314 string m_exceptionDetail;
315
316public:
317
319
322 constructor(string exceptionType, string exceptionDetail) ;
323
324
327
328 string toString();
329
330 string getDetail();
331
332};
333
336
337public:
338protected:
339 string m_exceptionRegexp;
340
341public:
342
343 constructor(string exceptionType, string exceptionRegexp) ;
344
345
348
349 string toString();
350};
351
354
355public:
356 constructor(string exceptionType, string exceptionSubstring) ;
357
358
359 string toString();
360};
361
364
365public:
366protected:
368 string m_name;
369
371 code m_code;
372
374 *list<auto> m_args;
375
377 int num_asserts = 0;
378
381
384
387
388public:
389
391 constructor(string name, code code, *softlist<auto> args);
392
393
396
397
398 static list<auto> getStackList(list stack, bool ok = False);
399
400 static string getPos(hash<auto> ex);
401
403 checkException(QUnit::Test test, hash<auto> e);
404
405
407 string getName();
408
409
410 incAssertions();
411
412
413 incAssertionsOk();
414
415
416 incAssertionsSkip();
417
418
419 int getAssertionCount();
420
421
422 int getAssertionOkCount();
423
424
425 int getAssertionSkipCount();
426
427
428 setupThread();
429
430
431 restoreThread();
432
433
435 rename(string n_name);
436
437};
438
441
442public:
443protected:
444 const PLAINQUIET = 0;
445 const PLAIN = 1;
446 const JUNIT = 2;
447
448 const OUT_TYPES = ...;
449
450
451 const RESULT_TYPE_DESCRIPTION = ...;
452
453
455 const OffsetColumn = 20;
456
458 hash<string, hash<string, code>> m_printMethods;
459
460 list<hash<auto>> m_results = ();
461 int m_output;
462 *string m_comment;
463
465
469 hash<auto> m_options;
470
472 string m_name;
474 string m_version;
475
477 int num_asserts = 0;
478
481
484
486 *list<auto> new_argv;
487
488public:
489
491 const Opts = ...;
492
493
494 const TEST_SUCCESS = 0;
495 const TEST_FAILURE = 1;
496 const TEST_ERROR = 2;
497 const TEST_SKIPPED = 3;
498
499protected:
500 printOption(string left, string right, int offset = OffsetColumn);
501public:
502
503
504protected:
505 usageIntern(int offset = OffsetColumn);
506public:
507
508
509protected:
510 usage();
511public:
512
513
514protected:
515 processOptions(reference<list<string>> p_argv);
516public:
517
518
520
525 constructor(string name, string version, reference<list<string>> p_argv, hash<auto> opts = Opts);
526
527
529
534 constructor(string name, string version, *list<auto> p_argv, hash<auto> opts = Opts);
535
536
538protected:
539 init(string name, string version, reference<list<string>> p_argv, hash<auto> opts = Opts);
540public:
541
542
543protected:
544 callPrinterFunction(string type, *softlist<auto> args);
545public:
546
547
548protected:
549 printHeader() { callPrinterFunction("header"); } printSummary() { callPrinterFunction("summary"); } printTestReport(hash testcase) { callPrinterFunction("testreport", testcase); }
550 printPlaintextHeader();
551
552 printPlaintextSummary();
553
554 printPlaintextOneTest(hash testcase);
555
556 printJunitSummary();
557
559 int errors();
560
561
563 int skipped();
564
565
568
569
571 addTestResult(TestCase tc, int success, *string error, *string pos, *string detail);
572
573};
574
577
578public:
579protected:
581 list<TestCase> testCases();
582
583 static QUnit::TestResultSuccess RESULT_SUCCESS = new QUnit::TestResultSuccess();
584 static QUnit::TestResultFailure RESULT_FAILURE = new QUnit::TestResultFailure();
585
586public:
587
588private:
590 const QUC_EQ = "eq";
592 const QUC_NEQ = "neq";
594 const QUC_GT = "gt";
596 const QUC_GE = "ge";
598 const QUC_LT = "lt";
600 const QUC_LE = "le";
602 const QUC_RE = "re";
604 const QUC_NRE = "nre";
605
607 const QUC_Map = ...;
608
609
611 const DEFAULT_EPSILON = 0.0000000001;
612
613public:
614
616 constructor(string name, string version, reference<list<string>> p_argv, *hash<auto> opts)
617 ;
618
619
621 constructor(string name, string version, *list<auto> p_argv, *hash<auto> opts)
622 ;
623
624
627
630
632 setUp() {}
633
636
638 *string getEnv(string key, *string def);
639
640
642
651 addTestCase(string name, code call, *softlist<auto> args);
652
653
655
663
664
665 string escapeSpecialChars(string str);
666
667 string escapeSpecialChars2(string str);
668
669 bool diffInSpecialCharsOnly(string a, string b);
670
672 string printUnexpectedData(auto exp, auto act, *bool neg, *bool soft_comparisons, *string comparitor);
673
674 string shorten(auto value);
675
676 compare(auto v1, auto v2, reference<list<string>> out, string path, *bool soft_comparisons);
677
678 compareHashes(hash h1, hash h2, reference<list<string>> out, string path = '', *bool soft_comparisons);
679
680 compareLists(list<auto> l1, list<auto> l2, reference<list<string>> out, string path = '', *bool soft_comparisons);
681
682//######## Assertions & test control functions
683
685
698 auto testAssertionValue(*string name, auto actual, auto expected);
699
701
712 auto testAssertionValue(*string name, number actual, number expected, number epsilon = DEFAULT_EPSILON);
713
715
726 auto testAssertionValue(*string name, float actual, float expected, float epsilon = DEFAULT_EPSILON);
728
737 assertRegex(string regex_pattern, string actual, *string name);
738
740
749 assertNRegex(string regex_pattern, string actual, *string name);
750
752
760 assertNothing(auto actual, *string name);
761
763
772 assertEqSoft(auto expected, auto actual, *string name);
773
775
784 assertNeqSoft(auto expected, auto actual, *string name);
785
787
796 assertEq(auto expected, auto actual, *string name);
797
799
808 assertNeq(auto expected, auto actual, *string name);
809
811
821 assertFloatEq(float expected, float actual, float epsilon = DEFAULT_EPSILON, *string name);
822
824
834 assertNumberEq(number expected, number actual, number epsilon = DEFAULT_EPSILON, *string name);
835
837
846 assertGtSoft(auto expected, auto actual, *string name);
847
849
858 assertGt(auto expected, auto actual, *string name);
859
861
870 assertGeSoft(auto expected, auto actual, *string name);
871
873
882 assertGe(auto expected, auto actual, *string name);
883
885
894 assertLtSoft(auto expected, auto actual, *string name);
895
897
906 assertLt(auto expected, auto actual, *string name);
907
909
918 assertLeSoft(auto expected, auto actual, *string name);
919
921
930 assertLe(auto expected, auto actual, *string name);
931
933 assertionOk(*string name);
934
936
944 assertTrue(auto actual, *string name);
945
947
955 assertFalse(auto actual, *string name);
956
958
970 public assertThrows(string expectedErr, *string expectedDesc, *hash<auto> arg, code theCode, *softlist<auto> args,
971 *string name) {
972 TestCase tc = getTestCase("assertEqThrows");
973 tc.incAssertions();
974 ++num_asserts;
975
976 string exp = sprintf("Exception: %s", expectedErr)
977 + (expectedDesc ? sprintf(": Detail '%s'", expectedDesc) : "")
978 + (arg ? sprintf(": exception arg: %y", arg) : "");
979 try {
980 call_function_args(theCode, args);
981 } catch (hash<ExceptionInfo> e) {
982 if (e.err == expectedErr && ((!exists expectedDesc) || e.desc.regex(expectedDesc))
983 && (!arg || comparePartialHash(arg, e.arg))) {
984 assertionOk(name);
985 return;
986 }
987 throw "TEST-EXCEPTION", printUnexpectedData(exp, get_exception_string(e));
988 }
989 throw "TEST-EXCEPTION", sprintf("Expected %s was not thrown", exp);
990 }
991
993
1004 assertThrows(string expectedErr, *string expectedDesc, code theCode, *softlist<auto> args, *string name);
1005
1007
1017 assertThrows(string expectedErr, code theCode, *softlist<auto> args, *string name);
1018
1020
1028 assertSkip (*string name);
1029
1031 TestCase getTestCase(string meth);
1032
1033
1035
1042 fail(*string msg);
1043
1045
1052 testNullAssertion(string name, code condition, *softlist<auto> args);
1053
1055
1063 auto testAssertion(string name, code condition, *softlist<auto> args, int expectedResultValue);
1064
1066
1074 auto testAssertion(string name, code condition, *softlist<auto> args, float expectedResultValue);
1075
1077
1085 auto testAssertion(string name, code condition, *softlist<auto> args, number expectedResultValue);
1086
1088
1096 auto testAssertion(string name, code condition, *softlist<auto> args, bool expectedResultValue);
1097
1099
1107 auto testAssertion(string name, code condition, *softlist<auto> args, string expectedResultValue);
1108
1110
1118 auto testAssertion(string name, code condition, *softlist<auto> args, date expectedResultValue);
1119
1121
1129 auto testAssertion(string name, code condition, *softlist<auto> args, binary expectedResultValue);
1130
1132
1140 auto testAssertion(string name, code condition, *softlist<auto> args, hash<auto> expectedResultValue);
1141
1143
1151 auto testAssertion(string name, code condition, *softlist<auto> args, list<auto> expectedResultValue);
1152
1154
1162 auto testAssertion(string name, code condition, *softlist<auto> args, QUnit::AbstractTestResult expectedResult = new QUnit::TestResultSuccess());
1163
1164 auto testAssertionIntern(TestCase tc, string name, QUnit::AbstractTestResult actualResult, QUnit::AbstractTestResult expectedResult, auto ret, *string pos);
1165
1167
1171 testSkip(string reason);
1172
1173//######## Test conditions passable to test assertions
1174
1176
1182 bool equals(auto a, auto b);
1183
1184
1186
1192 bool notEquals(auto a, auto b);
1193
1194
1196
1202 bool regexpMatches(string s, string regexp);
1203
1204
1206
1212 bool equalsIterated(AbstractIterator a, AbstractIterator b);
1213
1214
1215//######## Main function and test running helpers
1216
1218 int main();
1219
1220
1222 static string getAssertionName(*string name);
1223
1225 static bool comparePartialHash(hash<auto> expects, auto value);
1226};
1227
1230
1231public:
1232protected:
1235
1237 Program child;
1238
1240 hash<string, Program> modules;
1241
1243 static bool instantiated = False;
1244
1245public:
1246
1248 constructor(string name, string version, reference<list<string>> p_argv, *hash<auto> opts) ;
1249
1250
1252 constructor(string name, string version, *list<auto> p_argv, *hash<auto> opts) ;
1253
1254
1255 init();
1256
1259
1262
1265
1268
1270 Program createInjectedProgram(string path);
1271
1274
1276 injectClass(string class_name, *string new_name);
1277
1279 injectFunction(string func_name, *string new_name);
1280
1282
1284 injectUserModule(string module, *code custom_setup, *code custom_parsing);
1285
1287 int main();
1288
1289
1292
1294 setReloadedParseOptions(Program p, string file_data);
1295
1298
1302 abstract string getScriptPathImpl();};
1303
1304class QUnit::DependencyInjectedTestRunner : public QUnit::Test {
1305
1306public:
1307protected:
1308 // necessary to allow the original class to run with the injected runtime class
1309 Program child;
1310
1311public:
1312
1313 // dummethods never executed in the runtime class
1314 injectClass(string name, *string new_name) {} injectFunction(string name, *string new_name) {} injectUserModule(string module, *code custom_setup, *code custom_parsing) {}
1315 constructor(string name, string version, reference<list<string>> p_argv, *hash<auto> opts) ;
1316
1317
1318 constructor(string name, string version, *list<auto> p_argv, *hash<auto> opts) ;
1319
1320};
An abstract class representing test result interface.
Definition: QUnit.qm.dox.h:208
A class representing a test with injected dependencies.
Definition: QUnit.qm.dox.h:1229
hash< string, Program > modules
a hash of user modules subject to injections
Definition: QUnit.qm.dox.h:1240
abstract performInjectionsImpl()
implement this in subclasses to perform all injections
abstract string getScriptPathImpl()
implement this in subclasses to perform all injections
reloadSelf()
override to supply the source to the current test in case it's not available on the filesystem
static bool instantiated
a flag to ensure that injections are not performed recursively
Definition: QUnit.qm.dox.h:1243
Program createInjectedProgram(string path)
creates the Program object subject to injection
performCommonInjections(Program p)
override this method to perform injections common to the primary child logic container and all user m...
performInjections()
performs injections
createProgram()
creates the main child Program object subject to injection
int main()
creates the injected program, reloads the source into it, and executes the test
setReloadedParseOptions(Program p, string file_data)
override to optionally set parse options on the reloaded source
injectFunction(string func_name, *string new_name)
injects a function
int getParseOptions()
override this method to affect the parse options that Program objects subject to injection will get
injectClass(string class_name, *string new_name)
injects a class
injectUserModule(string module, *code custom_setup, *code custom_parsing)
performs all injections into the given user module
string getScriptPath()
Returns the path to the script to be tested.
string testedFile
the name of the script to run with injections
Definition: QUnit.qm.dox.h:1234
Program child
the child Program object subject to injections
Definition: QUnit.qm.dox.h:1237
constructor(string name, string version, *list< auto > p_argv, *hash< auto > opts)
creates the injected test object
constructor(string name, string version, reference< list< string > > p_argv, *hash< auto > opts)
creates the injected test object
reloadAndCommitProgram()
reloads the test source and finalizes and commits the injected child Program object
Class containing the configuration for a test case.
Definition: QUnit.qm.dox.h:363
checkException(QUnit::Test test, hash< auto > e)
handles exceptions raised while running the TestCase
auto saved_tc
any saved test case
Definition: QUnit.qm.dox.h:386
*list< auto > m_args
arguments to the above callable object
Definition: QUnit.qm.dox.h:374
code m_code
the body of the test case
Definition: QUnit.qm.dox.h:371
string m_name
the name of the test case
Definition: QUnit.qm.dox.h:368
string getName()
returns the test case name
int num_asserts_ok
number of successful assertions in current test case
Definition: QUnit.qm.dox.h:380
int num_asserts
number of assertions in current test case
Definition: QUnit.qm.dox.h:377
rename(string n_name)
renames the test case
constructor(string name, code code, *softlist< auto > args)
creates the TestCase object from the given arguments
run(QUnit::Test test)
runs the TestCase
int num_asserts_skip
number of skipped assertions in current test case
Definition: QUnit.qm.dox.h:383
Base class representing a simple test, implements an implicit main() function and all utility functio...
Definition: QUnit.qm.dox.h:576
const QUC_NRE
negative regex comparitor
Definition: QUnit.qm.dox.h:604
assertLe(auto expected, auto actual, *string name)
Tests that a value is less than or equal to an expected value with hard comparisons (types may not di...
int main()
Run the whole suite, report results.
const QUC_LE
greater than or equals comparitor
Definition: QUnit.qm.dox.h:600
fail(*string msg)
Fails the test unconditionally.
assertGt(auto expected, auto actual, *string name)
Tests that a value is greater than an expected value with hard comparisons (types may not differ)
bool regexpMatches(string s, string regexp)
Compare a string for match against a regexp.
assertNumberEq(number expected, number actual, number epsilon=DEFAULT_EPSILON, *string name)
Tests a number value for equality to an expected value with an allowed error.
auto testAssertion(string name, code condition, *softlist< auto > args, float expectedResultValue)
Tests for a single assertion for a call returning a floating-point value and returns the value genera...
tearDown()
Prototype function for cleaning up test environemnt. It will be called after each test has executed.
Definition: QUnit.qm.dox.h:635
assertionOk(*string name)
process an ok assertion
auto testAssertionValue(*string name, number actual, number expected, number epsilon=DEFAULT_EPSILON)
Tests a value for equality to an expected value of number type.
static bool comparePartialHash(hash< auto > expects, auto value)
Returns True if the keys given in the first hash match those in the second hash.
public assertThrows(string expectedErr, *string expectedDesc, *hash< auto > arg, code theCode, *softlist< auto > args, *string name)
Tests that a piece of code throws an exception with given description and exception arg keys.
Definition: QUnit.qm.dox.h:970
const QUC_NEQ
inequality comparitor
Definition: QUnit.qm.dox.h:592
auto testAssertion(string name, code condition, *softlist< auto > args, number expectedResultValue)
Tests for a single assertion for a call returning an arbitrary-precision numeric value and returns th...
globalSetUp()
global setup; will be called once before tests are run
Definition: QUnit.qm.dox.h:626
auto testAssertion(string name, code condition, *softlist< auto > args, binary expectedResultValue)
Tests for a single assertion for a call returning a binary value and returns the value generated.
auto testAssertion(string name, code condition, *softlist< auto > args, list< auto > expectedResultValue)
Tests for a single assertion for a call returning a list value and returns the value generated.
const DEFAULT_EPSILON
default epsilon for number/float comparison
Definition: QUnit.qm.dox.h:611
setUp()
Prototype function for setting up test environment. It will be called for each test individually.
Definition: QUnit.qm.dox.h:632
constructor(string name, string version, reference< list< string > > p_argv, *hash< auto > opts)
creates the object and sets the name of the test
auto testAssertion(string name, code condition, *softlist< auto > args, int expectedResultValue)
Tests for a single assertion for a call returning an integer value and returns the value generated.
auto testAssertion(string name, code condition, *softlist< auto > args, bool expectedResultValue)
Tests for a single assertion for a call returning a boolean value and returns the value generated.
testSkip(string reason)
Skips a given test, eg. because it may be missing some dependencies.
assertThrows(string expectedErr, *string expectedDesc, code theCode, *softlist< auto > args, *string name)
Tests that a piece of code throws an exception with given description.
assertSkip(*string name)
Skips assertion on purpose.
constructor(string name, string version, *list< auto > p_argv, *hash< auto > opts)
creates the object and sets the name of the test
globalTearDown()
global tear down; will be called once after all tests are run
Definition: QUnit.qm.dox.h:629
assertNRegex(string regex_pattern, string actual, *string name)
Tests that a test value does not pass a regular expression match.
TestCase getTestCase(string meth)
returns the current test case
bool equals(auto a, auto b)
Compare two values for equality.
auto testAssertion(string name, code condition, *softlist< auto > args, string expectedResultValue)
Tests for a single assertion for a call returning a string value and returns the value generated.
const QUC_LT
greater than comparitor
Definition: QUnit.qm.dox.h:598
bool notEquals(auto a, auto b)
Compare two values for inequality.
const QUC_GT
greater than comparitor
Definition: QUnit.qm.dox.h:594
auto testAssertionValue(*string name, float actual, float expected, float epsilon=DEFAULT_EPSILON)
Tests a value for equality to an expected value of float type.
auto testAssertion(string name, code condition, *softlist< auto > args, QUnit::AbstractTestResult expectedResult=new QUnit::TestResultSuccess())
Tests for a single assertion and returns the value generated.
bool equalsIterated(AbstractIterator a, AbstractIterator b)
Compare two iterables, item by item, for equality of each index.
assertFloatEq(float expected, float actual, float epsilon=DEFAULT_EPSILON, *string name)
Tests a float value for equality to an expected value with an allowed error.
assertGtSoft(auto expected, auto actual, *string name)
Tests that a value is greater than an expected value with soft comparisons (types may differ)
assertLt(auto expected, auto actual, *string name)
Tests that a value is less than an expected value with hard comparisons (types may not differ)
assertEq(auto expected, auto actual, *string name)
Tests a value for equality to an expected value with hard comparisons (types and values must be ident...
assertGe(auto expected, auto actual, *string name)
Tests that a value is greater than or equal to an expected value with hard comparisons (types may not...
assertThrows(string expectedErr, code theCode, *softlist< auto > args, *string name)
Tests that a piece of code throws an exception.
auto testAssertion(string name, code condition, *softlist< auto > args, hash< auto > expectedResultValue)
Tests for a single assertion for a call returning a hash value and returns the value generated.
assertGeSoft(auto expected, auto actual, *string name)
Tests that a value is greater than or equal to than an expected value with soft comparisons (types ma...
*string getEnv(string key, *string def)
facade for the system environment variables
assertNothing(auto actual, *string name)
Tests for no value.
assertTrue(auto actual, *string name)
Tests a boolean value.
const QUC_GE
greater than or equals comparitor
Definition: QUnit.qm.dox.h:596
const QUC_Map
comparitor info
Definition: QUnit.qm.dox.h:607
addTestCase(QUnit::TestCase tc)
adds a test case to run
list< TestCase > testCases()
list of test cases
assertEqSoft(auto expected, auto actual, *string name)
Tests a value for equality to an expected value with soft comparisons (types may differ)
assertNeq(auto expected, auto actual, *string name)
Tests a value for inequality to an expected value with hard comparisons (types and values must be ide...
auto testAssertion(string name, code condition, *softlist< auto > args, date expectedResultValue)
Tests for a single assertion for a call returning a date value and returns the value generated.
assertLeSoft(auto expected, auto actual, *string name)
Tests that a value is less than or equal to than an expected value with soft comparisons (types may d...
assertNeqSoft(auto expected, auto actual, *string name)
Tests a value for inequality to an expected value with soft comparisons (types may differ)
string printUnexpectedData(auto exp, auto act, *bool neg, *bool soft_comparisons, *string comparitor)
Helper function for printing out human-readable comparison of two values.
static string getAssertionName(*string name)
returns the assertion name for display purposes
const QUC_EQ
equality comparitor
Definition: QUnit.qm.dox.h:590
assertLtSoft(auto expected, auto actual, *string name)
Tests that a value is less than an expected value with soft comparisons (types may differ)
testNullAssertion(string name, code condition, *softlist< auto > args)
Tests for a single assertion for a call returning no value (for example, to ensure that the call does...
const QUC_RE
regex comparitor
Definition: QUnit.qm.dox.h:602
auto testAssertionValue(*string name, auto actual, auto expected)
Tests a value for equality to an expected value.
assertFalse(auto actual, *string name)
Tests a boolean value.
addTestCase(string name, code call, *softlist< auto > args)
adds a test case to run
assertRegex(string regex_pattern, string actual, *string name)
Tests that a test value passes a regular expression match.
Base class for collecting test results and reporting.
Definition: QUnit.qm.dox.h:440
int num_asserts_skip
total number of skipped assertions in script
Definition: QUnit.qm.dox.h:483
const OffsetColumn
the default column offset for printing options used in printOption() and usageIntern()
Definition: QUnit.qm.dox.h:455
int errors()
returns the number of errors encountered during test execution
int num_asserts
total number of assertions in script
Definition: QUnit.qm.dox.h:477
hash< string, hash< string, code > > m_printMethods
A map of print methods, categorised into three types: header, summary, testreport.
Definition: QUnit.qm.dox.h:458
constructor(string name, string version, reference< list< string > > p_argv, hash< auto > opts=Opts)
creates the object from the arguments
const Opts
default options for Qore::GetOpt::constructor()
Definition: QUnit.qm.dox.h:491
string m_name
test case name
Definition: QUnit.qm.dox.h:472
constructor(string name, string version, *list< auto > p_argv, hash< auto > opts=Opts)
creates the object from the arguments
int testCount()
returns the total number of test results
string m_version
test case version
Definition: QUnit.qm.dox.h:474
*list< auto > new_argv
new ARGV for languages that don't support lvalue references
Definition: QUnit.qm.dox.h:486
addTestResult(TestCase tc, int success, *string error, *string pos, *string detail)
adds a test result
hash< auto > m_options
the result of parsing command-line options with Qore::GetOpt::parse2()
Definition: QUnit.qm.dox.h:469
int skipped()
returns the number of tests skipped
int num_asserts_ok
total number of successful assertions in script
Definition: QUnit.qm.dox.h:480
init(string name, string version, reference< list< string > > p_argv, hash< auto > opts=Opts)
common constructor code
Class representing Exception of a particular type with a particular detail message.
Definition: QUnit.qm.dox.h:310
constructor(string exceptionType, string exceptionDetail)
creates the object from the exception arguments
bool equals(QUnit::AbstractTestResult r)
Equality operator.
string toString()
returns a string describing the exception type
Class representing Exception of a particular type and matching regexp for detail.
Definition: QUnit.qm.dox.h:335
string toString()
returns a string describing the exception type
bool equals(QUnit::AbstractTestResult r)
Equality operator.
Class representing Exception of a particular type and substring for detail.
Definition: QUnit.qm.dox.h:353
string toString()
returns a string describing the exception type
Class representing Exception of a particular type.
Definition: QUnit.qm.dox.h:283
constructor(string exceptionType)
creates the object from the exception arguments
string m_exceptionType
corresponds to the "err" key of ExceptionInfo (the first value of a throw statement)
Definition: QUnit.qm.dox.h:287
bool equals(QUnit::AbstractTestResult r)
Equality operator.
string toString()
returns a string describing the exception type
constructor(string exceptionType, string subType)
private constructor for subclasses
Class representing test function failure, both unspecific and with detail.
Definition: QUnit.qm.dox.h:235
constructor()
Instantiate an unspecific failure, no detail.
constructor(string s)
Instantiate an annotated failure, string detail.
bool equals(QUnit::AbstractTestResult r)
Equality operator.
Class representing a partial match of a hash value. Common keys have to be identical.
Definition: QUnit.qm.dox.h:271
Class representing boolean True.
Definition: QUnit.qm.dox.h:222
bool equals(QUnit::AbstractTestResult r)
Equality operator.
Class representing any non-boolean value.
Definition: QUnit.qm.dox.h:258
bool equals(QUnit::AbstractTestResult r)
Equality operator.
the main namespace for all public definitions in the QUnit module
Definition: QUnit.qm.dox.h:205