@iamsergio/qttest-utils 1.0.0 โ†’ 1.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 CHANGED
@@ -27,11 +27,12 @@ cargo install git-cliff
27
27
 
28
28
  (Replace 1.0.0 with actual version used)
29
29
 
30
+ export NEW_VERSION=v1.0.0
30
31
  - Make sure Github Actions CI is green
31
32
  - Optional: To get a version compatible with semver, run `git cliff --bump`
32
33
  - Increase version in package.json and package-lock.json.
33
- - git cliff --tag 1.0.0 > Changelog
34
+ - git cliff --tag $NEW_VERSION > Changelog
34
35
  - git add Changelog package.json package-lock.json && git commit -m "chore: bump version"
35
- - git tag -a v1.0.0 -m 'v1.0.0'
36
- - git push --tags
36
+ - git tag -a ${NEW_VERSION} -m "${NEW_VERSION}"
37
+ - git push && git push --tags
37
38
  - npm publish
package/Changelog CHANGED
@@ -2,6 +2,43 @@
2
2
 
3
3
 
4
4
 
5
+ ## [1.1.1] - 2024-04-07
6
+
7
+ ### ๐Ÿ› Bug Fixes
8
+
9
+ - Verbose logging not appearing in vscode
10
+
11
+ ### โš™๏ธ Miscellaneous Tasks
12
+
13
+ - Improve CONTRIBUTING.md
14
+
15
+ ## [1.1.0] - 2024-04-07
16
+
17
+ ### ๐Ÿš€ Features
18
+
19
+ - Added QtTest.verbose property
20
+
21
+ ### ๐Ÿงช Testing
22
+
23
+ - Add a QBENCHMARK
24
+ - Fix tests on windows
25
+ - Fix more cases of wrong slashes
26
+ - Test linksToQtTestLib too
27
+
28
+ ### โš™๏ธ Miscellaneous Tasks
29
+
30
+ - Minor readme comment
31
+ - Update .npmignore
32
+ - Fix typo in README
33
+ - Fix badge urls in README
34
+ - Mention the vscode extension in the README
35
+ - Remove duplicate vscode workspace file
36
+ - Add macOS and Windows to CI
37
+ - Make npm install be verose
38
+ - Trying fixing the path for tsc on macos
39
+ - Update packages
40
+ - Bump version
41
+
5
42
  ## [1.0.0] - 2024-04-04
6
43
 
7
44
  ### ๐Ÿงช Testing
@@ -30,6 +67,8 @@
30
67
  - Bump to version 1.0.0
31
68
  - Regenerate out/
32
69
  - Add a CONTRIBUTING.md file
70
+ - Update changelog
71
+ - Add ci badges to readme
33
72
 
34
73
  ## [0.4.9] - 2023-04-06
35
74
 
package/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # nodejs qttest-utils
2
2
 
3
- ![Build Status](https://github.com/qttest-utils/actions/workflows/ci.yml/badge.svg
4
- ![Pre-commit](https://github.com/qttest-utils/actions/workflows/pre-commit.yml/badge.svg
3
+ ![Build Status](https://github.com/KDAB/qttest-utils/actions/workflows/ci.yml/badge.svg)
4
+ ![Pre-commit](https://github.com/KDAB/qttest-utils/actions/workflows/pre-commit.yml/badge.svg)
5
5
 
6
6
  A [nodejs](https://www.npmjs.com/package/@iamsergio/qttest-utils) module for listing Qt Test executables and their individual test slots from a CMake build directory.
7
7
 
8
8
  To be used by vscode extensions that implement the `Testing API`, but can also be used standalone for whatever reason ;).
9
9
 
10
+ Used by [vscode-qttest](https://github.com/KDAB/vscode-qttest) extension.
11
+
10
12
  ## Installation
11
13
 
12
14
  ```bash
package/out/qttest.d.ts CHANGED
@@ -7,6 +7,7 @@ export declare function logMessage(message: string): void;
7
7
  export declare class QtTest {
8
8
  readonly filename: string;
9
9
  readonly buildDirPath: string;
10
+ verbose: boolean;
10
11
  vscodeTestItem: any | undefined;
11
12
  slots: QtTestSlot[] | null;
12
13
  lastExitCode: number;
package/out/qttest.js CHANGED
@@ -56,6 +56,8 @@ exports.logMessage = logMessage;
56
56
  */
57
57
  class QtTest {
58
58
  constructor(filename, buildDirPath) {
59
+ /// If true, will print more verbose output
60
+ this.verbose = false;
59
61
  /// The list of individual runnable test slots
60
62
  this.slots = null;
61
63
  /// Set after running
@@ -70,8 +72,13 @@ class QtTest {
70
72
  return path_1.default.basename(this.filename);
71
73
  }
72
74
  relativeFilename() {
73
- let current_dir = process.cwd();
74
- return this.filename.replace(current_dir + "/", "");
75
+ let result = path_1.default.relative(process.cwd(), this.filename);
76
+ // strip .exe, as we only use this for tests
77
+ if (result.endsWith(".exe"))
78
+ result = result.slice(0, -4);
79
+ // normalize slashes
80
+ result = result.replace(/\\/g, "/");
81
+ return result;
75
82
  }
76
83
  /**
77
84
  * Calls "./yourqttest -functions" and stores the results in the slots property.
@@ -83,7 +90,7 @@ class QtTest {
83
90
  let err = "";
84
91
  yield new Promise((resolve, reject) => {
85
92
  if (!fs.existsSync(this.filename)) {
86
- reject(new Error("File doesn't exit: " + this.filename));
93
+ reject(new Error("qttest: File doesn't exit: " + this.filename));
87
94
  return;
88
95
  }
89
96
  const child = (0, child_process_1.spawn)(this.filename, ["-functions"], { cwd: this.buildDirPath });
@@ -108,7 +115,7 @@ class QtTest {
108
115
  resolve(slotNames);
109
116
  }
110
117
  else {
111
- reject(new Error("Failed to run -functions, stdout=" + output + "; stderr=" + err + "; code=" + code));
118
+ reject(new Error("qttest: Failed to run -functions, stdout=" + output + "; stderr=" + err + "; code=" + code));
112
119
  }
113
120
  });
114
121
  });
@@ -136,13 +143,15 @@ class QtTest {
136
143
  result = true;
137
144
  }
138
145
  }
146
+ if (this.verbose)
147
+ console.log(chunk.toString());
139
148
  });
140
149
  child.on("exit", (code) => {
141
150
  if (code === 0) {
142
151
  resolve(result);
143
152
  }
144
153
  else {
145
- reject(new Error("Failed to run ldd"));
154
+ reject(new Error("qttest: Failed to run ldd"));
146
155
  }
147
156
  });
148
157
  });
@@ -183,8 +192,8 @@ class QtTest {
183
192
  return undefined;
184
193
  }
185
194
  /// Runs this test
186
- runTest(slot_1) {
187
- return __awaiter(this, arguments, void 0, function* (slot, cwd = "") {
195
+ runTest(slot, cwd = "") {
196
+ return __awaiter(this, void 0, void 0, function* () {
188
197
  let args = [];
189
198
  if (slot) {
190
199
  // Runs a single Qt test instead
package/out/test.js CHANGED
@@ -28,6 +28,7 @@ function runTests(buildDirPath) {
28
28
  console.error("Expected 3 executables, got " + qt.qtTestExecutables.length);
29
29
  process.exit(1);
30
30
  }
31
+ yield qt.removeNonLinking();
31
32
  // 1. Test that the executable test names are correct:
32
33
  var i = 0;
33
34
  for (var executable of qt.qtTestExecutables) {
@@ -70,6 +71,12 @@ function runTests(buildDirPath) {
70
71
  console.error("Expected test to pass: " + executable.filename);
71
72
  process.exit(1);
72
73
  }
74
+ if (process.platform === "linux") {
75
+ if (!executable.linksToQtTestLib()) {
76
+ console.error("Expected test to link to QtTest: " + executable.filename);
77
+ process.exit(1);
78
+ }
79
+ }
73
80
  i++;
74
81
  }
75
82
  // 4. Run individual slots:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamsergio/qttest-utils",
3
- "version": "1.0.0",
3
+ "version": "1.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",
@@ -21,6 +21,6 @@
21
21
  "devDependencies": {
22
22
  "@types/node": "^18.15.0",
23
23
  "ts-node": "^10.9.1",
24
- "typescript": "^4.9.5"
24
+ "typescript": "^5.4.4"
25
25
  }
26
- }
26
+ }