@iamsergio/qttest-utils 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/cmake.d.ts +23 -23
- package/out/cmake.js +91 -91
- package/out/example.d.ts +1 -1
- package/out/example.js +45 -45
- package/out/index.d.ts +10 -10
- package/out/index.js +11 -11
- package/out/qttest.d.ts +60 -59
- package/out/qttest.js +291 -257
- package/out/utils.d.ts +1 -1
- package/out/utils.js +85 -85
- package/package.json +1 -1
- package/src/qttest.ts +1 -1
- package/out/ctest.d.ts +0 -23
- package/out/ctest.js +0 -88
- package/out/foo.d.ts +0 -0
- package/out/foo.js +0 -2
- package/out/runtests.d.ts +0 -1
- package/out/runtests.js +0 -26
package/out/cmake.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents tests added in cmake (Via add_test())
|
|
3
|
-
*
|
|
4
|
-
* Contains methods to discover Qt Tests via CMake
|
|
5
|
-
*/
|
|
6
|
-
export declare class CMakeTests {
|
|
7
|
-
readonly buildDirPath: string;
|
|
8
|
-
constructor(buildDirPath: string);
|
|
9
|
-
/**
|
|
10
|
-
* Invokes ctest.exe --show-only=json-v1
|
|
11
|
-
*
|
|
12
|
-
* @returns a promise with the list of tests
|
|
13
|
-
*/
|
|
14
|
-
tests(): Promise<CMakeTest[] | undefined>;
|
|
15
|
-
private ctestJsonToList;
|
|
16
|
-
}
|
|
17
|
-
export declare class CMakeTest {
|
|
18
|
-
command: string[];
|
|
19
|
-
cwd: string;
|
|
20
|
-
id(): string;
|
|
21
|
-
label(): string;
|
|
22
|
-
executablePath(): string;
|
|
23
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Represents tests added in cmake (Via add_test())
|
|
3
|
+
*
|
|
4
|
+
* Contains methods to discover Qt Tests via CMake
|
|
5
|
+
*/
|
|
6
|
+
export declare class CMakeTests {
|
|
7
|
+
readonly buildDirPath: string;
|
|
8
|
+
constructor(buildDirPath: string);
|
|
9
|
+
/**
|
|
10
|
+
* Invokes ctest.exe --show-only=json-v1
|
|
11
|
+
*
|
|
12
|
+
* @returns a promise with the list of tests
|
|
13
|
+
*/
|
|
14
|
+
tests(): Promise<CMakeTest[] | undefined>;
|
|
15
|
+
private ctestJsonToList;
|
|
16
|
+
}
|
|
17
|
+
export declare class CMakeTest {
|
|
18
|
+
command: string[];
|
|
19
|
+
cwd: string;
|
|
20
|
+
id(): string;
|
|
21
|
+
label(): string;
|
|
22
|
+
executablePath(): string;
|
|
23
|
+
}
|
package/out/cmake.js
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
|
3
|
-
// Author: Sergio Martins <sergio.martins@kdab.com>
|
|
4
|
-
// SPDX-License-Identifier: MIT
|
|
5
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.CMakeTest = exports.CMakeTests = void 0;
|
|
19
|
-
const child_process_1 = require("child_process");
|
|
20
|
-
const path_1 = __importDefault(require("path"));
|
|
21
|
-
/**
|
|
22
|
-
* Represents tests added in cmake (Via add_test())
|
|
23
|
-
*
|
|
24
|
-
* Contains methods to discover Qt Tests via CMake
|
|
25
|
-
*/
|
|
26
|
-
class CMakeTests {
|
|
27
|
-
constructor(buildDirPath) {
|
|
28
|
-
this.buildDirPath = buildDirPath;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Invokes ctest.exe --show-only=json-v1
|
|
32
|
-
*
|
|
33
|
-
* @returns a promise with the list of tests
|
|
34
|
-
*/
|
|
35
|
-
tests() {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
// TODO: Check if folder exists
|
|
38
|
-
if (this.buildDirPath.length == 0) {
|
|
39
|
-
console.error("Could not find out cmake build dir");
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
return new Promise((resolve, reject) => {
|
|
43
|
-
const child = (0, child_process_1.spawn)("ctest", ["--show-only=json-v1"], { "cwd": this.buildDirPath });
|
|
44
|
-
let output = "";
|
|
45
|
-
child.stdout.on("data", (chunk) => {
|
|
46
|
-
output += chunk.toString();
|
|
47
|
-
});
|
|
48
|
-
child.on("exit", (code) => {
|
|
49
|
-
if (code === 0) {
|
|
50
|
-
resolve(this.ctestJsonToList(output));
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
reject(new Error("Failed to run ctest"));
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
return undefined;
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
ctestJsonToList(json) {
|
|
61
|
-
let allJSON = JSON.parse(json);
|
|
62
|
-
if (!("tests" in allJSON)) {
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
65
|
-
let tests = allJSON.tests.map((testJSON) => {
|
|
66
|
-
let test = new CMakeTest();
|
|
67
|
-
test.command = testJSON.command;
|
|
68
|
-
test.cwd = testJSON.cwd;
|
|
69
|
-
return test;
|
|
70
|
-
});
|
|
71
|
-
return tests;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.CMakeTests = CMakeTests;
|
|
75
|
-
/// Represents an inividual CTest test
|
|
76
|
-
class CMakeTest {
|
|
77
|
-
constructor() {
|
|
78
|
-
this.command = [];
|
|
79
|
-
this.cwd = "";
|
|
80
|
-
}
|
|
81
|
-
id() {
|
|
82
|
-
return this.command.join(",");
|
|
83
|
-
}
|
|
84
|
-
label() {
|
|
85
|
-
return path_1.default.basename(this.executablePath());
|
|
86
|
-
}
|
|
87
|
-
executablePath() {
|
|
88
|
-
return this.command[0];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.CMakeTest = CMakeTest;
|
|
1
|
+
"use strict";
|
|
2
|
+
// SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
|
3
|
+
// Author: Sergio Martins <sergio.martins@kdab.com>
|
|
4
|
+
// SPDX-License-Identifier: MIT
|
|
5
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.CMakeTest = exports.CMakeTests = void 0;
|
|
19
|
+
const child_process_1 = require("child_process");
|
|
20
|
+
const path_1 = __importDefault(require("path"));
|
|
21
|
+
/**
|
|
22
|
+
* Represents tests added in cmake (Via add_test())
|
|
23
|
+
*
|
|
24
|
+
* Contains methods to discover Qt Tests via CMake
|
|
25
|
+
*/
|
|
26
|
+
class CMakeTests {
|
|
27
|
+
constructor(buildDirPath) {
|
|
28
|
+
this.buildDirPath = buildDirPath;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Invokes ctest.exe --show-only=json-v1
|
|
32
|
+
*
|
|
33
|
+
* @returns a promise with the list of tests
|
|
34
|
+
*/
|
|
35
|
+
tests() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
// TODO: Check if folder exists
|
|
38
|
+
if (this.buildDirPath.length == 0) {
|
|
39
|
+
console.error("Could not find out cmake build dir");
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
return new Promise((resolve, reject) => {
|
|
43
|
+
const child = (0, child_process_1.spawn)("ctest", ["--show-only=json-v1"], { "cwd": this.buildDirPath });
|
|
44
|
+
let output = "";
|
|
45
|
+
child.stdout.on("data", (chunk) => {
|
|
46
|
+
output += chunk.toString();
|
|
47
|
+
});
|
|
48
|
+
child.on("exit", (code) => {
|
|
49
|
+
if (code === 0) {
|
|
50
|
+
resolve(this.ctestJsonToList(output));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
reject(new Error("Failed to run ctest"));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return undefined;
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
ctestJsonToList(json) {
|
|
61
|
+
let allJSON = JSON.parse(json);
|
|
62
|
+
if (!("tests" in allJSON)) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
let tests = allJSON.tests.map((testJSON) => {
|
|
66
|
+
let test = new CMakeTest();
|
|
67
|
+
test.command = testJSON.command;
|
|
68
|
+
test.cwd = testJSON.cwd;
|
|
69
|
+
return test;
|
|
70
|
+
});
|
|
71
|
+
return tests;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.CMakeTests = CMakeTests;
|
|
75
|
+
/// Represents an inividual CTest test
|
|
76
|
+
class CMakeTest {
|
|
77
|
+
constructor() {
|
|
78
|
+
this.command = [];
|
|
79
|
+
this.cwd = "";
|
|
80
|
+
}
|
|
81
|
+
id() {
|
|
82
|
+
return this.command.join(",");
|
|
83
|
+
}
|
|
84
|
+
label() {
|
|
85
|
+
return path_1.default.basename(this.executablePath());
|
|
86
|
+
}
|
|
87
|
+
executablePath() {
|
|
88
|
+
return this.command[0];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.CMakeTest = CMakeTest;
|
package/out/example.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/out/example.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
|
3
|
-
// Author: Sergio Martins <sergio.martins@kdab.com>
|
|
4
|
-
// SPDX-License-Identifier: MIT
|
|
5
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const qttest_1 = require("./qttest");
|
|
19
|
-
const fs_1 = __importDefault(require("fs"));
|
|
20
|
-
function example() {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
const args = process.argv.slice(2);
|
|
23
|
-
if (args.length != 1) {
|
|
24
|
-
console.error("ERROR: Expected a single argument with the build-dir with cmake tests!");
|
|
25
|
-
process.exit(2);
|
|
26
|
-
}
|
|
27
|
-
let buildDirPath = args[0];
|
|
28
|
-
if (!fs_1.default.existsSync(buildDirPath)) {
|
|
29
|
-
console.error('Directory does not exist!');
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
let qt = new qttest_1.QtTests();
|
|
33
|
-
// Gather all tests that would be executed by CTest:
|
|
34
|
-
yield qt.discoverViaCMake(buildDirPath);
|
|
35
|
-
// Filter-out the ones that don't link to QtTest (doctests and such)
|
|
36
|
-
yield qt.removeNonLinking();
|
|
37
|
-
// Example of filtering out by regexp:
|
|
38
|
-
qt.removeMatching(/(tst_view|tst_window)/);
|
|
39
|
-
// Example of filtering out by regexp (inverted):
|
|
40
|
-
qt.maintainMatching(/(tst_docks|tst_qtwidgets|tst_multisplitter)/);
|
|
41
|
-
qt.dumpExecutablePaths();
|
|
42
|
-
qt.dumpTestSlots();
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
example();
|
|
1
|
+
"use strict";
|
|
2
|
+
// SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
|
3
|
+
// Author: Sergio Martins <sergio.martins@kdab.com>
|
|
4
|
+
// SPDX-License-Identifier: MIT
|
|
5
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const qttest_1 = require("./qttest");
|
|
19
|
+
const fs_1 = __importDefault(require("fs"));
|
|
20
|
+
function example() {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const args = process.argv.slice(2);
|
|
23
|
+
if (args.length != 1) {
|
|
24
|
+
console.error("ERROR: Expected a single argument with the build-dir with cmake tests!");
|
|
25
|
+
process.exit(2);
|
|
26
|
+
}
|
|
27
|
+
let buildDirPath = args[0];
|
|
28
|
+
if (!fs_1.default.existsSync(buildDirPath)) {
|
|
29
|
+
console.error('Directory does not exist!');
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
let qt = new qttest_1.QtTests();
|
|
33
|
+
// Gather all tests that would be executed by CTest:
|
|
34
|
+
yield qt.discoverViaCMake(buildDirPath);
|
|
35
|
+
// Filter-out the ones that don't link to QtTest (doctests and such)
|
|
36
|
+
yield qt.removeNonLinking();
|
|
37
|
+
// Example of filtering out by regexp:
|
|
38
|
+
qt.removeMatching(/(tst_view|tst_window)/);
|
|
39
|
+
// Example of filtering out by regexp (inverted):
|
|
40
|
+
qt.maintainMatching(/(tst_docks|tst_qtwidgets|tst_multisplitter)/);
|
|
41
|
+
qt.dumpExecutablePaths();
|
|
42
|
+
qt.dumpTestSlots();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
example();
|
package/out/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CMakeTests, CMakeTest } from "./cmake";
|
|
2
|
-
import { QtTests, QtTest, QtTestSlot } from "./qttest";
|
|
3
|
-
declare const qttest: {
|
|
4
|
-
QtTests: typeof QtTests;
|
|
5
|
-
QtTest: typeof QtTest;
|
|
6
|
-
QtTestSlot: typeof QtTestSlot;
|
|
7
|
-
CMakeTests: typeof CMakeTests;
|
|
8
|
-
CMakeTest: typeof CMakeTest;
|
|
9
|
-
};
|
|
10
|
-
export default qttest;
|
|
1
|
+
import { CMakeTests, CMakeTest } from "./cmake";
|
|
2
|
+
import { QtTests, QtTest, QtTestSlot } from "./qttest";
|
|
3
|
+
declare const qttest: {
|
|
4
|
+
QtTests: typeof QtTests;
|
|
5
|
+
QtTest: typeof QtTest;
|
|
6
|
+
QtTestSlot: typeof QtTestSlot;
|
|
7
|
+
CMakeTests: typeof CMakeTests;
|
|
8
|
+
CMakeTest: typeof CMakeTest;
|
|
9
|
+
};
|
|
10
|
+
export default qttest;
|
package/out/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
|
3
|
-
// Author: Sergio Martins <sergio.martins@kdab.com>
|
|
4
|
-
// SPDX-License-Identifier: MIT
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const cmake_1 = require("./cmake");
|
|
7
|
-
const qttest_1 = require("./qttest");
|
|
8
|
-
const qttest = {
|
|
9
|
-
QtTests: qttest_1.QtTests, QtTest: qttest_1.QtTest, QtTestSlot: qttest_1.QtTestSlot, CMakeTests: cmake_1.CMakeTests, CMakeTest: cmake_1.CMakeTest
|
|
10
|
-
};
|
|
11
|
-
exports.default = qttest;
|
|
1
|
+
"use strict";
|
|
2
|
+
// SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
|
3
|
+
// Author: Sergio Martins <sergio.martins@kdab.com>
|
|
4
|
+
// SPDX-License-Identifier: MIT
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const cmake_1 = require("./cmake");
|
|
7
|
+
const qttest_1 = require("./qttest");
|
|
8
|
+
const qttest = {
|
|
9
|
+
QtTests: qttest_1.QtTests, QtTest: qttest_1.QtTest, QtTestSlot: qttest_1.QtTestSlot, CMakeTests: cmake_1.CMakeTests, CMakeTest: cmake_1.CMakeTest
|
|
10
|
+
};
|
|
11
|
+
exports.default = qttest;
|
package/out/qttest.d.ts
CHANGED
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a single QtTest executable.
|
|
3
|
-
* Supports listing the individual test slots
|
|
4
|
-
*/
|
|
5
|
-
export declare class QtTest {
|
|
6
|
-
readonly filename: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
get
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
get
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Represents a single QtTest executable.
|
|
3
|
+
* Supports listing the individual test slots
|
|
4
|
+
*/
|
|
5
|
+
export declare class QtTest {
|
|
6
|
+
readonly filename: string;
|
|
7
|
+
readonly buildDirPath: string;
|
|
8
|
+
slots: QtTestSlot[] | null;
|
|
9
|
+
constructor(filename: string, buildDirPath: string);
|
|
10
|
+
get id(): string;
|
|
11
|
+
get label(): string;
|
|
12
|
+
/**
|
|
13
|
+
* Calls "./yourqttest -functions" and stores the results in the slots property.
|
|
14
|
+
*/
|
|
15
|
+
parseAvailableSlots(): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Returns whether this executable links to libQtTest.so.
|
|
18
|
+
*
|
|
19
|
+
* Useful for Qt autodetection, as some tests are doctest or so.
|
|
20
|
+
*
|
|
21
|
+
* Only implemented for Linux. Returns undefined on other platforms.
|
|
22
|
+
*/
|
|
23
|
+
linksToQtTestLib(): Promise<boolean> | undefined;
|
|
24
|
+
isQtTestViaHelp(): Promise<boolean | undefined>;
|
|
25
|
+
runTest(slotName?: string, cwd?: string): Promise<boolean>;
|
|
26
|
+
command(): {
|
|
27
|
+
label: string;
|
|
28
|
+
executablePath: string;
|
|
29
|
+
args: string[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Represents a single Qt test slot
|
|
34
|
+
*/
|
|
35
|
+
export declare class QtTestSlot {
|
|
36
|
+
name: string;
|
|
37
|
+
parentQTest: QtTest;
|
|
38
|
+
constructor(name: string, parent: QtTest);
|
|
39
|
+
get id(): string;
|
|
40
|
+
get absoluteFilePath(): string;
|
|
41
|
+
runTest(): Promise<boolean>;
|
|
42
|
+
command(): {
|
|
43
|
+
label: string;
|
|
44
|
+
executablePath: string;
|
|
45
|
+
args: string[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Represents the list of all QtTest executables in your project
|
|
50
|
+
*/
|
|
51
|
+
export declare class QtTests {
|
|
52
|
+
qtTestExecutables: QtTest[];
|
|
53
|
+
discoverViaCMake(buildDirPath: string): Promise<void>;
|
|
54
|
+
removeNonLinking(): Promise<void>;
|
|
55
|
+
removeByRunningHelp(): Promise<void>;
|
|
56
|
+
removeMatching(regex: RegExp): void;
|
|
57
|
+
maintainMatching(regex: RegExp): void;
|
|
58
|
+
dumpExecutablePaths(): void;
|
|
59
|
+
dumpTestSlots(): Promise<void>;
|
|
60
|
+
}
|