@iamsergio/qttest-utils 2.1.0 → 2.1.1
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/CONTRIBUTING.md +1 -1
- package/Changelog +11 -0
- package/out/cmake.js +12 -2
- package/out/test.js +11 -0
- package/package.json +1 -1
package/CONTRIBUTING.md
CHANGED
|
@@ -29,6 +29,6 @@ cargo install git-cliff
|
|
|
29
29
|
- Get a version compatible with semver, run ` git cliff --bump | head -n 5`, replace NEW_VERSION
|
|
30
30
|
- export NEW_VERSION=v1.0.0
|
|
31
31
|
- Make sure Github Actions CI is green
|
|
32
|
-
- npm version $NEW_VERSION
|
|
32
|
+
- npm version $NEW_VERSION # ignore the error
|
|
33
33
|
- git cliff --tag $NEW_VERSION > Changelog
|
|
34
34
|
- git add Changelog package.json package-lock.json && git commit -m "chore: bump version" && git tag -a ${NEW_VERSION} -m "${NEW_VERSION}" && git push && git push --tags && npm publish
|
package/Changelog
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [2.1.1] - 2024-04-25
|
|
6
|
+
|
|
7
|
+
### 🐛 Bug Fixes
|
|
8
|
+
|
|
9
|
+
- Allow for backslashes in the cmake codemodel
|
|
10
|
+
|
|
11
|
+
### ⚙️ Miscellaneous Tasks
|
|
12
|
+
|
|
13
|
+
- Improve CONTRIBUTING.md
|
|
14
|
+
|
|
5
15
|
## [2.1.0] - 2024-04-25
|
|
6
16
|
|
|
7
17
|
### 🚀 Features
|
|
@@ -18,6 +28,7 @@
|
|
|
18
28
|
- Update CONTRIBUTING.md file
|
|
19
29
|
- Fix build on macOS
|
|
20
30
|
- Improve CONTRIBUTING.md
|
|
31
|
+
- Bump version
|
|
21
32
|
|
|
22
33
|
## [2.0.0] - 2024-04-24
|
|
23
34
|
|
package/out/cmake.js
CHANGED
|
@@ -73,11 +73,14 @@ class CMakeTests {
|
|
|
73
73
|
return tests;
|
|
74
74
|
}
|
|
75
75
|
/// Returns the cmake target name for the specified executable
|
|
76
|
+
/// codemodel should have a "projects" key at root.
|
|
76
77
|
targetNameForExecutable(executable, codemodel) {
|
|
77
78
|
// simplify:
|
|
78
79
|
if (executable.endsWith(".exe")) {
|
|
79
80
|
executable = executable.substring(0, executable.length - 4);
|
|
80
81
|
}
|
|
82
|
+
// replace backslashes with forward slashes
|
|
83
|
+
executable = executable.replace(/\\/g, "/");
|
|
81
84
|
let projects = codemodel["projects"];
|
|
82
85
|
if (!projects)
|
|
83
86
|
return undefined;
|
|
@@ -93,6 +96,8 @@ class CMakeTests {
|
|
|
93
96
|
if (artifact.endsWith(".exe")) {
|
|
94
97
|
artifact = artifact.substring(0, artifact.length - 4);
|
|
95
98
|
}
|
|
99
|
+
// replace backslashes with forward slashes
|
|
100
|
+
artifact = artifact.replace(/\\/g, "/");
|
|
96
101
|
if (artifact == executable) {
|
|
97
102
|
let name = target["name"];
|
|
98
103
|
if (name) {
|
|
@@ -105,13 +110,16 @@ class CMakeTests {
|
|
|
105
110
|
}
|
|
106
111
|
return undefined;
|
|
107
112
|
}
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
/// Returns the list of .cpp files for the specified executable
|
|
114
|
+
/// codemodel is the CMake codemodel JSON object
|
|
115
|
+
/// codemodel should have a "projects" key at root.
|
|
110
116
|
cppFilesForExecutable(executable, codemodel) {
|
|
111
117
|
// simplify:
|
|
112
118
|
if (executable.endsWith(".exe")) {
|
|
113
119
|
executable = executable.substring(0, executable.length - 4);
|
|
114
120
|
}
|
|
121
|
+
// replace backslashes with forward slashes
|
|
122
|
+
executable = executable.replace(/\\/g, "/");
|
|
115
123
|
let projects = codemodel["projects"];
|
|
116
124
|
if (!projects)
|
|
117
125
|
return [];
|
|
@@ -131,6 +139,8 @@ class CMakeTests {
|
|
|
131
139
|
if (artifact.endsWith(".exe")) {
|
|
132
140
|
artifact = artifact.substring(0, artifact.length - 4);
|
|
133
141
|
}
|
|
142
|
+
// replace backslashes with forward slashes
|
|
143
|
+
artifact = artifact.replace(/\\/g, "/");
|
|
134
144
|
if (artifact == executable) {
|
|
135
145
|
let fileGroups = target["fileGroups"];
|
|
136
146
|
if (!fileGroups)
|
package/out/test.js
CHANGED
|
@@ -132,6 +132,17 @@ function runCodeModelTests(codeModelFile) {
|
|
|
132
132
|
console.error("Expected test1, got " + targetName);
|
|
133
133
|
process.exit(1);
|
|
134
134
|
}
|
|
135
|
+
// test windows back slashes:
|
|
136
|
+
files = cmake.cppFilesForExecutable("/vscode-qttest/test/qt_test/build-dev/test2", codemodelJson);
|
|
137
|
+
if (files.length != 1) {
|
|
138
|
+
console.error("Expected 1 file, got " + files.length);
|
|
139
|
+
process.exit(1);
|
|
140
|
+
}
|
|
141
|
+
targetName = cmake.targetNameForExecutable("/vscode-qttest/test/qt_test/build-dev/test2", codemodelJson);
|
|
142
|
+
if (targetName != "test2") {
|
|
143
|
+
console.error("Expected test2, got " + targetName);
|
|
144
|
+
process.exit(1);
|
|
145
|
+
}
|
|
135
146
|
});
|
|
136
147
|
}
|
|
137
148
|
runTests("test/qt_test/build-dev/");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iamsergio/qttest-utils",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "API for listing QtTest executables from a build directory and which individual test slots each executable contains. Useful for a Text Explorer VSCode extension.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|