Skip to content

Commit a9a770f

Browse files
committed
add run0 parser test
This is a little suboptimal since it doesn't seem like we can execute run0 in GHA (at least on a hosted runner).
1 parent d3fbbf9 commit a9a770f

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- swap lesspipe for wgnord in broken cross test
1212
- add cross test for writeScript(Bin)
1313
- drop `bash -n` check from writeScript(Bin) that was breaking cross
14+
- Add run0 parser (#121)
1415

1516

1617
## v0.10.6 (Jun 21 2025)

nixpkgs/test.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
rlwrap,
2626
gnutar,
2727
bc,
28+
systemd,
2829
# override testing
2930
esh,
3031
getconf,
@@ -76,6 +77,9 @@ let
7677
gnutar
7778
bc
7879
msmtp
80+
]
81+
++ lib.optionals stdenv.hostPlatform.isLinux [
82+
systemd
7983
];
8084
in
8185
rec {
@@ -221,6 +225,8 @@ rec {
221225
INTERP = "${bash}/bin/bash";
222226

223227
checkPhase = ''
228+
echo removing parse tests matching no${stdenv.buildPlatform.uname.system}
229+
rm tests/parse_*no${stdenv.buildPlatform.uname.system}.sh || true # ok if none exist
224230
patchShebangs .
225231
mkdir empty_lore
226232
touch empty_lore/{execers,wrappers}

tests/helpers.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ norun(){
179179
}
180180

181181
parsers() {
182-
norun msmtp msmtpq > parsed.sh
182+
# msmtp(q) is temporary exclusion to unblock CI
183+
# run0, IIUC, just won't work in GHA unless we self-host a systemd runner?
184+
norun msmtp msmtpq run0 > parsed.sh
183185
cat parse_*.sh >> parsed.sh
184186
resholve --interpreter none --path "${PKG_PARSED}:${PKG_COREUTILS}" < parsed.sh > resolved.sh
185187
bash -xe resolved.sh

tests/parse_run0_noDarwin.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
run0 \
2+
-h --help \
3+
-V --version \
4+
--no-ask-password \
5+
--machine=CONTAINER \
6+
--unit=UNIT \
7+
--property=NAME=VALUE \
8+
--description=TEXT \
9+
--slice=SLICE \
10+
--slice-inherit \
11+
-u USER --user=USER \
12+
-g GROUP --group=GROUP \
13+
--nice=NICE \
14+
-D PATH --chdir=PATH \
15+
--setenv=NAME \
16+
--background=COLOR \
17+
--pty \
18+
--pipe \
19+
--shell-prompt-prefix=PREFIX \
20+
ls
21+
22+
run0 \
23+
-h --help \
24+
-V --version \
25+
--no-ask-password \
26+
--machine=CONTAINER \
27+
--unit=UNIT \
28+
--property=NAME=VALUE \
29+
--description=TEXT \
30+
--slice=SLICE \
31+
--slice-inherit \
32+
-u USER --user=USER \
33+
-g GROUP --group=GROUP \
34+
--nice=NICE \
35+
-D PATH --chdir=PATH \
36+
--setenv=NAME \
37+
--background=COLOR \
38+
--pty \
39+
--pipe \
40+
--shell-prompt-prefix=PREFIX \
41+
-- \
42+
ls
43+
44+
run0 -- run0 -- ls
45+
run0 run0 ls
46+
run0
47+
run0 -u ls ls

0 commit comments

Comments
 (0)