Skip to content

Commit 78ebdc9

Browse files
author
Andy C
committed
[headless] Can run the demo against osh-cpp
And put it in the CI!
1 parent 6d15985 commit 78ebdc9

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

client/headless_demo.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def main(argv):
7979
p.add_option(
8080
'--stderr-file', dest='stderr_file', default='/dev/stderr',
8181
help='Where the server should send child stdout')
82+
p.add_option(
83+
'--sh-binary', dest='sh_binary', default='bin/osh',
84+
help='Which shell binary to launch')
8285

8386
# Use a terminal instead
8487
p.add_option(
@@ -97,7 +100,7 @@ def main(argv):
97100
os.set_inheritable(left.fileno(), True)
98101
os.set_inheritable(right.fileno(), True)
99102

100-
child_argv = ['bin/osh', '--headless']
103+
child_argv = [opts.sh_binary, '--headless']
101104

102105
ret = os.fork()
103106
if ret < 0:

client/run.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ set -o nounset
77
set -o pipefail
88
set -o errexit
99

10-
demo() {
11-
echo mystdin | client/headless_demo.py
10+
py-demo() {
11+
echo mystdin | client/headless_demo.py --sh-binary bin/osh
12+
}
13+
14+
cpp-demo() {
15+
local bin=_bin/cxx-dbg/osh
16+
ninja $bin
17+
echo mystdin | client/headless_demo.py --sh-binary $bin
1218
}
1319

1420
errors() {
@@ -32,13 +38,17 @@ demo-pty() {
3238
echo mystdin | client/headless_demo.py --to-new-pty
3339
}
3440

35-
soil-run() {
36-
demo
41+
soil-run-py() {
42+
py-demo
3743
echo
3844

3945
errors
4046
echo
4147
}
4248

49+
soil-run-cpp() {
50+
cpp-demo
51+
}
52+
4353

4454
"$@"

soil/worker.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ oil-large ysh/run.sh soil-run -
9494
tea-large tea/run.sh soil-run -
9595
link-busybox-ash test/spec-bin.sh link-busybox-ash -
9696
osh-minimal test/spec-py.sh osh-minimal _tmp/spec/osh-minimal/index.html
97-
headless client/run.sh soil-run -
97+
headless client/run.sh soil-run-py -
9898
EOF
9999
}
100100

@@ -181,6 +181,7 @@ build-minimal build/py.sh minimal -
181181
ninja-config soil/worker.sh ninja-config -
182182
cpp-unit test/cpp-unit.sh soil-run _test/cpp-unit.html
183183
oils-cpp-smoke build/native.sh soil-run -
184+
headless client/run.sh soil-run-cpp -
184185
asan test/asan.sh soil-run -
185186
ltrace test/ltrace.sh soil-run -
186187
line-counts metrics/source-code.sh write-reports _tmp/metrics/line-counts/index.html

0 commit comments

Comments
 (0)