Skip to content

Commit 8a72a95

Browse files
committed
Avoid using jq in testing
1 parent 12d254f commit 8a72a95

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

testsuite/drivers/shell.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import os.path
2-
31
from e3.testsuite.result import TestStatus
2+
from e3.testsuite.process import check_call
43

54
from drivers import ALSTestDriver
65

@@ -16,10 +15,13 @@ def run(self, previous_values, slot):
1615
if self.should_skip():
1716
return False
1817

19-
index = os.path.abspath(os.path.join(self.test_env["test_dir"], "index.txt"))
20-
test_sh = os.path.join(self.env.repo_base, 'testsuite', 'shell', 'test.sh')
21-
p = self.run_and_log([test_sh, self.env.repo_base], cwd=self.env.working_dir)
22-
self.result.out += p.out
18+
# This takes care of failing the test in case the return code is
19+
# non-zero
20+
check_call(
21+
self,
22+
[self.working_dir("test.sh"), self.env.repo_base],
23+
parse_shebang=True
24+
)
2325

24-
self.result.set_status(TestStatus.PASS if p.status == 0 else TestStatus.FAIL)
26+
self.result.set_status(TestStatus.PASS)
2527
self.push_result()
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import sys
2+
import json
3+
4+
pkg = json.load(sys.stdin)
5+
settings = pkg["contributes"]["configuration"][0]["properties"].keys()
6+
print("\n".join(settings))

testsuite/shell/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
2-
jq -r '.contributes.configuration[].properties|keys[]' < $1/integration/vscode/ada/package.json | grep ^ada. > pkg.txt
2+
python3 get-extension-settings.py < $1/integration/vscode/ada/package.json | grep ^ada. | sort > pkg.txt
33
grep '^## ' $1/doc/settings.md |sed -e 's/.../ada./' | sort > doc.txt
44
diff -u pkg.txt doc.txt

0 commit comments

Comments
 (0)