@iamsergio/qttest-utils 2.2.1 → 2.2.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/Changelog CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
 
4
4
 
5
+ ## [2.2.2] - 2024-05-02
6
+
7
+ ### 🐛 Bug Fixes
8
+
9
+ - Filter out weird tests
10
+
11
+ ### ⚙️ Miscellaneous Tasks
12
+
13
+ - Code format cmake.ts
14
+
5
15
  ## [2.2.1] - 2024-05-02
6
16
 
7
17
  ### 🐛 Bug Fixes
@@ -18,6 +28,7 @@
18
28
 
19
29
  - Ran code format on tests
20
30
  - Run codeformat on qttest.ts
31
+ - Bump version
21
32
 
22
33
  ## [2.2.0] - 2024-04-25
23
34
 
package/out/cmake.js CHANGED
@@ -42,7 +42,9 @@ class CMakeTests {
42
42
  }
43
43
  return new Promise((resolve, reject) => {
44
44
  (0, qttest_1.logMessage)("Running ctest --show-only=json-v1 with cwd=" + this.buildDirPath);
45
- const child = (0, child_process_1.spawn)("ctest", ["--show-only=json-v1"], { "cwd": this.buildDirPath });
45
+ const child = (0, child_process_1.spawn)("ctest", ["--show-only=json-v1"], {
46
+ cwd: this.buildDirPath,
47
+ });
46
48
  let output = "";
47
49
  child.stdout.on("data", (chunk) => {
48
50
  output += chunk.toString();
@@ -70,6 +72,20 @@ class CMakeTests {
70
72
  test.cwd = testJSON.cwd;
71
73
  return test;
72
74
  });
75
+ // filter invalid tests:
76
+ tests = tests.filter((test) => {
77
+ // pretty print test
78
+ if (!test.command || test.command.length == 0)
79
+ return false;
80
+ let testExecutablePath = test.executablePath();
81
+ let baseName = path_1.default.basename(testExecutablePath).toLowerCase();
82
+ if (baseName.endsWith(".exe"))
83
+ baseName = baseName.substring(0, baseName.length - 4);
84
+ // People doing complicated things in add_test()
85
+ if (baseName == "ctest" || baseName === "cmake")
86
+ return false;
87
+ return true;
88
+ });
73
89
  return tests;
74
90
  }
75
91
  /// Returns the cmake target name for the specified executable
@@ -122,7 +138,7 @@ class CMakeTests {
122
138
  // files aren't equal!
123
139
  return false;
124
140
  }
125
- const fs = require('fs');
141
+ const fs = require("fs");
126
142
  if (fs.existsSync(file2)) {
127
143
  // It's a real file, not bogus.
128
144
  return false;
@@ -178,7 +194,8 @@ class CMakeTests {
178
194
  }
179
195
  }
180
196
  }
181
- (0, qttest_1.logMessage)("cppFilesForExecutable: Could not find cpp files for executable " + executable);
197
+ (0, qttest_1.logMessage)("cppFilesForExecutable: Could not find cpp files for executable " +
198
+ executable);
182
199
  return [];
183
200
  }
184
201
  }
package/out/qttest.js CHANGED
@@ -255,7 +255,12 @@ class QtTest {
255
255
  if (this.slots && this.slots.length > 0) {
256
256
  /// When running a QtTest executable, let's check which sub-tests failed
257
257
  /// (So VSCode can show some error icon for each fail)
258
- yield this.updateSubTestStates(cwdDir, slot);
258
+ try {
259
+ yield this.updateSubTestStates(cwdDir, slot);
260
+ }
261
+ catch (e) {
262
+ logMessage("Failed to update sub-test states: " + e);
263
+ }
259
264
  }
260
265
  if (code === 0) {
261
266
  resolve(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamsergio/qttest-utils",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
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",