MCPcopy Create free account
hub / github.com/BaseXdb/basex / test

Method test

basex-core/src/main/java/org/basex/query/func/unit/Suite.java:38–61  ·  view source on GitHub ↗

Tests all test functions in the specified path. @param ctx database context @param root path to test modules @param job calling job @return resulting value @throws IOException I/O exception

(final IOFile root, final Context ctx, final Job job)

Source from the content-addressed store, hash-verified

36 * @throws IOException I/O exception
37 */
38 public FNode test(final IOFile root, final Context ctx, final Job job) throws IOException {
39 final ArrayList<IOFile> files = new ArrayList<>();
40
41 final Performance perf = new Performance();
42 final FBuilder suites = FElem.build(Q_TESTSUITES);
43 if(root.isDir()) {
44 for(final String path : root.descendants()) {
45 final IOFile file = new IOFile(root, path);
46 if(file.hasSuffix(IO.XQSUFFIXES)) files.add(file);
47 }
48 } else {
49 files.add(root);
50 }
51
52 for(final IOFile file : files) {
53 final Unit unit = new Unit(file, ctx, job);
54 unit.test(suites);
55 errors += unit.errors;
56 failures += unit.failures;
57 skipped += unit.skipped;
58 tests += unit.tests;
59 }
60 return suites.attr(Q_TIME, Unit.time(perf)).finish();
61 }
62}

Callers 1

runMethod · 0.95

Calls 9

buildMethod · 0.95
testMethod · 0.95
attrMethod · 0.95
timeMethod · 0.95
hasSuffixMethod · 0.80
addMethod · 0.65
isDirMethod · 0.45
descendantsMethod · 0.45
finishMethod · 0.45

Tested by 1

runMethod · 0.76