1 | #!/usr/bin/env bash
|
2 | #
|
3 | # Usage:
|
4 | # test/spec.sh <function name>
|
5 |
|
6 | set -o nounset
|
7 | set -o pipefail
|
8 | set -o errexit
|
9 | shopt -s strict:all 2>/dev/null || true # dogfood for OSH
|
10 |
|
11 | REPO_ROOT=$(cd "$(dirname $0)/.."; pwd)
|
12 |
|
13 | source test/common.sh
|
14 | source test/spec-common.sh
|
15 | source devtools/run-task.sh
|
16 |
|
17 | if test -z "${IN_NIX_SHELL:-}"; then
|
18 | source build/dev-shell.sh # to run 'dash', etc.
|
19 | fi
|
20 |
|
21 | # TODO: Just use 'dash bash' and $PATH
|
22 | readonly DASH=dash
|
23 | readonly BASH=bash
|
24 | readonly MKSH=mksh
|
25 | readonly ZSH=zsh
|
26 | readonly BUSYBOX_ASH=ash
|
27 |
|
28 | # ash and dash are similar, so not including ash by default. zsh is not quite
|
29 | # POSIX.
|
30 | readonly REF_SHELLS=($DASH $BASH $MKSH)
|
31 |
|
32 | check-survey-shells() {
|
33 | ### Make sure bash, zsh, OSH, etc. exist
|
34 |
|
35 | # Note: yash isn't here, but it is used in a couple tests
|
36 |
|
37 | test/spec-runner.sh shell-sanity-check "${REF_SHELLS[@]}" $ZSH $BUSYBOX_ASH $OSH_LIST
|
38 | }
|
39 |
|
40 | # TODO: remove this stub after we hollow out this file
|
41 |
|
42 | run-file() { test/spec-py.sh run-file "$@"; }
|
43 |
|
44 | #
|
45 | # Misc
|
46 | #
|
47 |
|
48 | # Really what I want is enter(func) and exit(func), and filter by regex?
|
49 | trace-var-sub() {
|
50 | local out=_tmp/coverage
|
51 | mkdir -p $out
|
52 |
|
53 | # This creates *.cover files, with line counts.
|
54 | #python -m trace --count -C $out \
|
55 |
|
56 | # This prints trace with line numbers to stdout.
|
57 | #python -m trace --trace -C $out \
|
58 | PYTHONPATH=. python -m trace --trackcalls -C $out \
|
59 | test/sh_spec.py spec/var-sub.test.sh $DASH $BASH "$@"
|
60 |
|
61 | ls -l $out
|
62 | head $out/*.cover
|
63 | }
|
64 |
|
65 | #
|
66 | # Individual tests.
|
67 | #
|
68 | # We configure the shells they run on and the number of allowed failures (to
|
69 | # prevent regressions.)
|
70 | #
|
71 |
|
72 | interactive-parse() {
|
73 | run-file interactive-parse "$@"
|
74 | }
|
75 |
|
76 | smoke() {
|
77 | run-file smoke "$@"
|
78 | }
|
79 |
|
80 | interactive() {
|
81 | run-file interactive "$@"
|
82 | }
|
83 |
|
84 | prompt() {
|
85 | run-file prompt "$@"
|
86 | }
|
87 |
|
88 | bugs() {
|
89 | run-file bugs "$@"
|
90 | }
|
91 |
|
92 | TODO-deprecate() {
|
93 | run-file TODO-deprecate "$@"
|
94 | }
|
95 |
|
96 | blog1() {
|
97 | sh-spec spec/blog1.test.sh \
|
98 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
99 | }
|
100 |
|
101 | blog2() {
|
102 | sh-spec spec/blog2.test.sh \
|
103 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
104 | }
|
105 |
|
106 | blog-other1() {
|
107 | sh-spec spec/blog-other1.test.sh \
|
108 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
109 | }
|
110 |
|
111 | alias() {
|
112 | run-file alias "$@"
|
113 | }
|
114 |
|
115 | comments() {
|
116 | sh-spec spec/comments.test.sh ${REF_SHELLS[@]} $OSH_LIST "$@"
|
117 | }
|
118 |
|
119 | word-split() {
|
120 | run-file word-split "$@"
|
121 | }
|
122 |
|
123 | word-eval() {
|
124 | sh-spec spec/word-eval.test.sh \
|
125 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
126 | }
|
127 |
|
128 | # These cases apply to many shells.
|
129 | assign() {
|
130 | run-file assign "$@"
|
131 | }
|
132 |
|
133 | # These cases apply to a few shells.
|
134 | assign-extended() {
|
135 | sh-spec spec/assign-extended.test.sh \
|
136 | $BASH $MKSH $OSH_LIST "$@"
|
137 | }
|
138 |
|
139 | # Corner cases that OSH doesn't handle
|
140 | assign-deferred() {
|
141 | sh-spec spec/assign-deferred.test.sh \
|
142 | $BASH $MKSH "$@"
|
143 | }
|
144 |
|
145 | # These test associative arrays
|
146 | assign-dialects() {
|
147 | run-file assign-dialects "$@"
|
148 | }
|
149 |
|
150 | background() {
|
151 | run-file background "$@"
|
152 | }
|
153 |
|
154 | subshell() {
|
155 | sh-spec spec/subshell.test.sh \
|
156 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
157 | }
|
158 |
|
159 | quote() {
|
160 | sh-spec spec/quote.test.sh \
|
161 | ${REF_SHELLS[@]} $BUSYBOX_ASH $OSH_LIST "$@"
|
162 | }
|
163 |
|
164 | loop() {
|
165 | sh-spec spec/loop.test.sh \
|
166 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
167 | }
|
168 |
|
169 | case_() {
|
170 | run-file case_ "$@"
|
171 | }
|
172 |
|
173 | if_() {
|
174 | sh-spec spec/if_.test.sh \
|
175 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
176 | }
|
177 |
|
178 | builtins() {
|
179 | run-file builtins "$@"
|
180 | }
|
181 |
|
182 | builtin-eval-source() {
|
183 | sh-spec spec/builtin-eval-source.test.sh \
|
184 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
185 | }
|
186 |
|
187 | builtin-io() {
|
188 | run-file builtin-io "$@"
|
189 | }
|
190 |
|
191 | nul-bytes() {
|
192 | run-file nul-bytes "$@"
|
193 | }
|
194 |
|
195 | # Special bash printf things like -v and %q. Portable stuff goes in builtin-io.
|
196 | builtin-printf() {
|
197 | run-file builtin-printf "$@"
|
198 | }
|
199 |
|
200 | builtins2() {
|
201 | run-file builtins2 "$@"
|
202 | }
|
203 |
|
204 | builtin-history() {
|
205 | run-file builtin-history "$@"
|
206 | }
|
207 |
|
208 | # dash and mksh don't implement 'dirs'
|
209 | builtin-dirs() {
|
210 | sh-spec spec/builtin-dirs.test.sh \
|
211 | $BASH $ZSH $OSH_LIST "$@"
|
212 | }
|
213 |
|
214 | builtin-vars() {
|
215 | run-file builtin-vars "$@"
|
216 | }
|
217 |
|
218 | builtin-getopts() {
|
219 | run-file builtin-getopts "$@"
|
220 | }
|
221 |
|
222 | builtin-bracket() {
|
223 | run-file builtin-bracket "$@"
|
224 | }
|
225 |
|
226 | builtin-trap() {
|
227 | sh-spec spec/builtin-trap.test.sh \
|
228 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
229 | }
|
230 |
|
231 | builtin-trap-bash() {
|
232 | run-file builtin-trap-bash "$@"
|
233 | }
|
234 |
|
235 | # Bash implements type -t, but no other shell does. For Nix.
|
236 | # zsh/mksh/dash don't have the 'help' builtin.
|
237 | builtin-bash() {
|
238 | run-file builtin-bash "$@"
|
239 | }
|
240 |
|
241 | builtin-type() {
|
242 | run-file builtin-type "$@"
|
243 | }
|
244 |
|
245 | builtin-type-bash() {
|
246 | run-file builtin-type-bash "$@"
|
247 | }
|
248 |
|
249 | vars-bash() {
|
250 | run-file vars-bash "$@"
|
251 | }
|
252 |
|
253 | vars-special() {
|
254 | run-file vars-special "$@"
|
255 | }
|
256 |
|
257 | builtin-completion() {
|
258 | run-file builtin-completion "$@"
|
259 | }
|
260 |
|
261 | builtin-special() {
|
262 | sh-spec spec/builtin-special.test.sh --oils-failures-allowed 4 \
|
263 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
264 | }
|
265 |
|
266 | builtin-times() {
|
267 | sh-spec spec/builtin-times.test.sh $BASH $ZSH $OSH_LIST "$@"
|
268 | }
|
269 |
|
270 | command-parsing() {
|
271 | sh-spec spec/command-parsing.test.sh ${REF_SHELLS[@]} $OSH_LIST "$@"
|
272 | }
|
273 |
|
274 | func-parsing() {
|
275 | sh-spec spec/func-parsing.test.sh ${REF_SHELLS[@]} $OSH_LIST "$@"
|
276 | }
|
277 |
|
278 | sh-func() {
|
279 | sh-spec spec/sh-func.test.sh --oils-failures-allowed 1 \
|
280 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
281 | }
|
282 |
|
283 | glob() {
|
284 | # Note: can't pass because it assumes 'bin' exists, etc.
|
285 | sh-spec spec/glob.test.sh --oils-failures-allowed 3 \
|
286 | ${REF_SHELLS[@]} $BUSYBOX_ASH $OSH_LIST "$@"
|
287 | }
|
288 |
|
289 | globignore() {
|
290 | run-file globignore "$@"
|
291 | }
|
292 |
|
293 | arith() {
|
294 | run-file arith "$@"
|
295 | }
|
296 |
|
297 | command-sub() {
|
298 | sh-spec spec/command-sub.test.sh \
|
299 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
300 | }
|
301 |
|
302 | command_() {
|
303 | sh-spec spec/command_.test.sh \
|
304 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
305 | }
|
306 |
|
307 | pipeline() {
|
308 | sh-spec spec/pipeline.test.sh \
|
309 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
310 | }
|
311 |
|
312 | explore-parsing() {
|
313 | sh-spec spec/explore-parsing.test.sh \
|
314 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
315 | }
|
316 |
|
317 | parse-errors() {
|
318 | sh-spec spec/parse-errors.test.sh --oils-failures-allowed 3 \
|
319 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
320 | }
|
321 |
|
322 | here-doc() {
|
323 | # NOTE: The last two tests, 31 and 32, have different behavior on my Ubuntu
|
324 | # and Debian machines.
|
325 | # - On Ubuntu, read_from_fd.py fails with Errno 9 -- bad file descriptor.
|
326 | # - On Debian, the whole process hangs.
|
327 | # Is this due to Python 3.2 vs 3.4? Either way osh doesn't implement the
|
328 | # functionality, so it's probably best to just implement it.
|
329 | sh-spec spec/here-doc.test.sh --range 0-31 \
|
330 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
331 | }
|
332 |
|
333 | redirect() {
|
334 | sh-spec spec/redirect.test.sh --oils-failures-allowed 2 \
|
335 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
336 | }
|
337 |
|
338 | redirect-multi() {
|
339 | run-file redirect-multi "$@"
|
340 | }
|
341 |
|
342 | posix() {
|
343 | sh-spec spec/posix.test.sh \
|
344 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
345 | }
|
346 |
|
347 | introspect() {
|
348 | run-file introspect "$@"
|
349 | }
|
350 |
|
351 | tilde() {
|
352 | run-file tilde "$@"
|
353 | }
|
354 |
|
355 | var-op-test() {
|
356 | run-file var-op-test "$@"
|
357 | }
|
358 |
|
359 | var-op-len() {
|
360 | sh-spec spec/var-op-len.test.sh \
|
361 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
362 | }
|
363 |
|
364 | var-op-patsub() {
|
365 | # 1 unicode failure, and [^]] which is a parsing divergence
|
366 | sh-spec spec/var-op-patsub.test.sh --oils-failures-allowed 2 \
|
367 | $BASH $MKSH $ZSH $OSH_LIST "$@"
|
368 | # TODO: can add $BUSYBOX_ASH
|
369 | }
|
370 |
|
371 | var-op-slice() {
|
372 | # dash doesn't support any of these operations
|
373 | sh-spec spec/var-op-slice.test.sh --oils-failures-allowed 1 \
|
374 | $BASH $MKSH $ZSH $OSH_LIST "$@"
|
375 | }
|
376 |
|
377 | var-op-bash() {
|
378 | run-file var-op-bash "$@"
|
379 | }
|
380 |
|
381 | var-op-strip() {
|
382 | sh-spec spec/var-op-strip.test.sh \
|
383 | ${REF_SHELLS[@]} $ZSH $BUSYBOX_ASH $OSH_LIST "$@"
|
384 | }
|
385 |
|
386 | var-sub() {
|
387 | # NOTE: ZSH has interesting behavior, like echo hi > "$@" can write to TWO
|
388 | # FILES! But ultimately we don't really care, so I disabled it.
|
389 | sh-spec spec/var-sub.test.sh \
|
390 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
391 | }
|
392 |
|
393 | var-num() {
|
394 | run-file var-num "$@"
|
395 | }
|
396 |
|
397 | var-sub-quote() {
|
398 | sh-spec spec/var-sub-quote.test.sh \
|
399 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
400 | }
|
401 |
|
402 | sh-usage() {
|
403 | run-file sh-usage "$@"
|
404 | }
|
405 |
|
406 | sh-options() {
|
407 | run-file sh-options "$@"
|
408 | }
|
409 |
|
410 | xtrace() {
|
411 | sh-spec spec/xtrace.test.sh --oils-failures-allowed 1 \
|
412 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
413 | }
|
414 |
|
415 | strict-options() {
|
416 | sh-spec spec/strict-options.test.sh \
|
417 | ${REF_SHELLS[@]} $OSH_LIST "$@"
|
418 | }
|
419 |
|
420 | exit-status() {
|
421 | run-file exit-status "$@"
|
422 | }
|
423 |
|
424 | errexit() {
|
425 | sh-spec spec/errexit.test.sh \
|
426 | ${REF_SHELLS[@]} $BUSYBOX_ASH $OSH_LIST "$@"
|
427 | }
|
428 |
|
429 | errexit-osh() {
|
430 | run-file errexit-osh "$@"
|
431 | }
|
432 |
|
433 | fatal-errors() {
|
434 | sh-spec spec/fatal-errors.test.sh \
|
435 | ${REF_SHELLS[@]} $ZSH $OSH_LIST "$@"
|
436 | }
|
437 |
|
438 | #
|
439 | # Non-POSIX extensions: arrays, brace expansion, [[, ((, etc.
|
440 | #
|
441 |
|
442 | # There as many non-POSIX arithmetic contexts.
|
443 | arith-context() {
|
444 | sh-spec spec/arith-context.test.sh \
|
445 | $BASH $MKSH $ZSH $OSH_LIST "$@"
|
446 | }
|
447 |
|
448 | array() {
|
449 | sh-spec spec/array.test.sh \
|
450 | $BASH $MKSH $OSH_LIST "$@"
|
451 | }
|
452 |
|
453 | array-compat() {
|
454 | run-file array-compat "$@"
|
455 | }
|
456 |
|
457 | type-compat() {
|
458 | run-file type-compat "$@"
|
459 | }
|
460 |
|
461 | # += is not POSIX and not in dash.
|
462 | append() {
|
463 | run-file append "$@"
|
464 | }
|
465 |
|
466 | # associative array -- mksh and zsh implement different associative arrays.
|
467 | assoc() {
|
468 | run-file assoc "$@"
|
469 | }
|
470 |
|
471 | # ZSH also has associative arrays
|
472 | assoc-zsh() {
|
473 | sh-spec spec/assoc-zsh.test.sh $ZSH "$@"
|
474 | }
|
475 |
|
476 | dbracket() {
|
477 | run-file dbracket "$@"
|
478 | }
|
479 |
|
480 | dparen() {
|
481 | sh-spec spec/dparen.test.sh --oils-failures-allowed 1 \
|
482 | $BASH $MKSH $ZSH $OSH_LIST "$@"
|
483 | }
|
484 |
|
485 | brace-expansion() {
|
486 | run-file brace-expansion "$@"
|
487 | }
|
488 |
|
489 | regex() {
|
490 | sh-spec spec/regex.test.sh --oils-failures-allowed 2 \
|
491 | $BASH $ZSH $OSH_LIST "$@"
|
492 | }
|
493 |
|
494 | process-sub() {
|
495 | # mksh and dash don't support it
|
496 | sh-spec spec/process-sub.test.sh \
|
497 | $BASH $ZSH $OSH_LIST "$@"
|
498 | }
|
499 |
|
500 | # This does file system globbing
|
501 | extglob-files() {
|
502 | sh-spec spec/extglob-files.test.sh --oils-failures-allowed 1 \
|
503 | $BASH $MKSH $OSH_LIST "$@"
|
504 | }
|
505 |
|
506 | # This does string matching.
|
507 | extglob-match() {
|
508 | sh-spec spec/extglob-match.test.sh \
|
509 | $BASH $MKSH $OSH_LIST "$@"
|
510 | }
|
511 |
|
512 | nocasematch-match() {
|
513 | run-file nocasematch-match "$@"
|
514 | }
|
515 |
|
516 | # ${!var} syntax -- oil should replace this with associative arrays.
|
517 | # mksh has completely different behavior for this syntax. Not worth testing.
|
518 | var-ref() {
|
519 | run-file var-ref "$@"
|
520 | }
|
521 |
|
522 | # declare / local -n
|
523 | # there is one divergence when combining -n and ${!ref}
|
524 | nameref() {
|
525 | sh-spec spec/nameref.test.sh --oils-failures-allowed 7 \
|
526 | $BASH $MKSH $OSH_LIST "$@"
|
527 | }
|
528 |
|
529 | let() {
|
530 | sh-spec spec/let.test.sh $BASH $MKSH $ZSH "$@"
|
531 | }
|
532 |
|
533 | for-expr() {
|
534 | sh-spec spec/for-expr.test.sh \
|
535 | $BASH $ZSH $OSH_LIST "$@"
|
536 | }
|
537 |
|
538 | empty-bodies() {
|
539 | sh-spec spec/empty-bodies.test.sh "${REF_SHELLS[@]}" $ZSH $OSH_LIST "$@"
|
540 | }
|
541 |
|
542 | # TODO: This is for the ANTLR grammars, in the oil-sketch repo.
|
543 | # osh has infinite loop?
|
544 | shell-grammar() {
|
545 | sh-spec spec/shell-grammar.test.sh $BASH $MKSH $ZSH "$@"
|
546 | }
|
547 |
|
548 | serialize() {
|
549 | run-file serialize "$@"
|
550 | }
|
551 |
|
552 | #
|
553 | # Smoosh
|
554 | #
|
555 |
|
556 | readonly SMOOSH_REPO=~/git/languages/smoosh
|
557 |
|
558 | sh-spec-smoosh-env() {
|
559 | local test_file=$1
|
560 | shift
|
561 |
|
562 | # - smoosh tests use $TEST_SHELL instead of $SH
|
563 | # - cd $TMP to avoid littering repo
|
564 | # - pass -o posix
|
565 | # - timeout of 1 second
|
566 | # - Some tests in smoosh use $HOME and $LOGNAME
|
567 |
|
568 | sh-spec $test_file \
|
569 | --sh-env-var-name TEST_SHELL \
|
570 | --posix \
|
571 | --env-pair "TEST_UTIL=$SMOOSH_REPO/tests/util" \
|
572 | --env-pair "LOGNAME=$LOGNAME" \
|
573 | --env-pair "HOME=$HOME" \
|
574 | --timeout 1 \
|
575 | --oils-bin-dir $REPO_ROOT/bin \
|
576 | --compare-shells \
|
577 | "$@"
|
578 | }
|
579 |
|
580 | # For speed, only run with one copy of OSH.
|
581 | readonly smoosh_osh_list=$OSH_CPYTHON
|
582 |
|
583 | smoosh() {
|
584 | ### Run case smoosh from the console
|
585 |
|
586 | # TODO: Use --oils-bin-dir
|
587 | # our_shells, etc.
|
588 |
|
589 | sh-spec-smoosh-env _tmp/smoosh.test.sh \
|
590 | ${REF_SHELLS[@]} $smoosh_osh_list \
|
591 | "$@"
|
592 | }
|
593 |
|
594 | smoosh-hang() {
|
595 | ### Run case smoosh-hang from the console
|
596 |
|
597 | # Need the smoosh timeout tool to run correctly.
|
598 | sh-spec-smoosh-env _tmp/smoosh-hang.test.sh \
|
599 | --timeout-bin "$SMOOSH_REPO/tests/util/timeout" \
|
600 | --timeout 1 \
|
601 | "$@"
|
602 | }
|
603 |
|
604 | _one-html() {
|
605 | local spec_name=$1
|
606 | shift
|
607 |
|
608 | local out_dir=_tmp/spec/smoosh
|
609 | local tmp_dir=_tmp/src-smoosh
|
610 | mkdir -p $out_dir $out_dir
|
611 |
|
612 | doctools/src_tree.py smoosh-file \
|
613 | _tmp/$spec_name.test.sh \
|
614 | $out_dir/$spec_name.test.html
|
615 |
|
616 | local out=$out_dir/${spec_name}.html
|
617 | set +o errexit
|
618 | # Shell function is smoosh or smoosh-hang
|
619 | time $spec_name --format html "$@" > $out
|
620 | set -o errexit
|
621 |
|
622 | echo
|
623 | echo "Wrote $out"
|
624 |
|
625 | # NOTE: This IGNORES the exit status.
|
626 | }
|
627 |
|
628 | # TODO:
|
629 | # - Put these tests in the CI
|
630 | # - Import smoosh spec tests into the repo, with 'test/smoosh.sh'
|
631 |
|
632 | smoosh-html() {
|
633 | ### Run by devtools/release.sh
|
634 | _one-html smoosh "$@"
|
635 | }
|
636 |
|
637 | smoosh-hang-html() {
|
638 | ### Run by devtools/release.sh
|
639 | _one-html smoosh-hang "$@"
|
640 | }
|
641 |
|
642 | html-demo() {
|
643 | ### Test for --format html
|
644 |
|
645 | local out=_tmp/spec/demo.html
|
646 | builtin-special --format html "$@" > $out
|
647 |
|
648 | echo
|
649 | echo "Wrote $out"
|
650 | }
|
651 |
|
652 | #
|
653 | # Hay is part of the YSH suite
|
654 | #
|
655 |
|
656 | hay() {
|
657 | run-file hay "$@"
|
658 | }
|
659 |
|
660 | hay-isolation() {
|
661 | run-file hay-isolation "$@"
|
662 | }
|
663 |
|
664 | hay-meta() {
|
665 | run-file hay-meta "$@"
|
666 | }
|
667 |
|
668 | #
|
669 | # YSH
|
670 | #
|
671 |
|
672 | ysh-convert() {
|
673 | run-file ysh-convert "$@"
|
674 | }
|
675 |
|
676 | ysh-completion() {
|
677 | run-file ysh-completion "$@"
|
678 | }
|
679 |
|
680 | ysh-stdlib() {
|
681 | run-file ysh-stdlib "$@"
|
682 | }
|
683 |
|
684 | ysh-stdlib-2() {
|
685 | run-file ysh-stdlib-2 "$@"
|
686 | }
|
687 |
|
688 | ysh-stdlib-args() {
|
689 | run-file ysh-stdlib-args "$@"
|
690 | }
|
691 |
|
692 | ysh-stdlib-testing() {
|
693 | run-file ysh-stdlib-testing "$@"
|
694 | }
|
695 |
|
696 | ysh-source() {
|
697 | run-file ysh-source "$@"
|
698 | }
|
699 |
|
700 | ysh-usage() {
|
701 | run-file ysh-usage "$@"
|
702 | }
|
703 |
|
704 | ysh-unicode() {
|
705 | run-file ysh-unicode "$@"
|
706 | }
|
707 |
|
708 | ysh-bin() {
|
709 | run-file ysh-bin "$@"
|
710 | }
|
711 |
|
712 | ysh-dict() {
|
713 | run-file ysh-dict "$@"
|
714 | }
|
715 |
|
716 | ysh-list() {
|
717 | run-file ysh-list "$@"
|
718 | }
|
719 |
|
720 | ysh-place() {
|
721 | run-file ysh-place "$@"
|
722 | }
|
723 |
|
724 | ysh-prompt() {
|
725 | run-file ysh-prompt "$@"
|
726 | }
|
727 |
|
728 | ysh-assign() {
|
729 | run-file ysh-assign "$@"
|
730 | }
|
731 |
|
732 | ysh-augmented() {
|
733 | run-file ysh-augmented "$@"
|
734 | }
|
735 |
|
736 | ysh-blocks() {
|
737 | run-file ysh-blocks "$@"
|
738 | }
|
739 |
|
740 | ysh-bugs() {
|
741 | run-file ysh-bugs "$@"
|
742 | }
|
743 |
|
744 | ysh-builtins() {
|
745 | run-file ysh-builtins "$@"
|
746 | }
|
747 |
|
748 | ysh-builtin-module() {
|
749 | run-file ysh-builtin-module "$@"
|
750 | }
|
751 |
|
752 | ysh-builtin-eval() {
|
753 | run-file ysh-builtin-eval "$@"
|
754 | }
|
755 |
|
756 | # Related to errexit-oil
|
757 | ysh-builtin-error() {
|
758 | run-file ysh-builtin-error "$@"
|
759 | }
|
760 |
|
761 | ysh-builtin-meta() {
|
762 | run-file ysh-builtin-meta "$@"
|
763 | }
|
764 |
|
765 | ysh-builtin-process() {
|
766 | run-file ysh-builtin-process "$@"
|
767 | }
|
768 |
|
769 | ysh-builtin-shopt() {
|
770 | run-file ysh-builtin-shopt "$@"
|
771 | }
|
772 |
|
773 | ysh-case() {
|
774 | run-file ysh-case "$@"
|
775 | }
|
776 |
|
777 | ysh-command-sub() {
|
778 | run-file ysh-command-sub "$@"
|
779 | }
|
780 |
|
781 | ysh-demo() {
|
782 | run-file ysh-demo "$@"
|
783 | }
|
784 |
|
785 | ysh-expr() {
|
786 | run-file ysh-expr "$@"
|
787 | }
|
788 |
|
789 | ysh-int-float() {
|
790 | run-file ysh-int-float "$@"
|
791 | }
|
792 |
|
793 | ysh-expr-bool() {
|
794 | run-file ysh-expr-bool "$@"
|
795 | }
|
796 |
|
797 | ysh-expr-arith() {
|
798 | run-file ysh-expr-arith "$@"
|
799 | }
|
800 |
|
801 | ysh-expr-compare() {
|
802 | run-file ysh-expr-compare "$@"
|
803 | }
|
804 |
|
805 | ysh-expr-sub() {
|
806 | run-file ysh-expr-sub "$@"
|
807 | }
|
808 |
|
809 | ysh-for() {
|
810 | run-file ysh-for "$@"
|
811 | }
|
812 |
|
813 | ysh-methods() {
|
814 | run-file ysh-methods "$@"
|
815 | }
|
816 |
|
817 | ysh-func() {
|
818 | run-file ysh-func "$@"
|
819 | }
|
820 |
|
821 | ysh-func-builtin() {
|
822 | run-file ysh-func-builtin "$@"
|
823 | }
|
824 |
|
825 | ysh-funcs-external() {
|
826 | run-file ysh-funcs-external "$@"
|
827 | }
|
828 |
|
829 | ysh-interactive() {
|
830 | run-file ysh-interactive "$@"
|
831 | }
|
832 |
|
833 | ysh-json() {
|
834 | run-file ysh-json "$@"
|
835 | }
|
836 |
|
837 | ysh-keywords() {
|
838 | run-file ysh-keywords "$@"
|
839 | }
|
840 |
|
841 | ysh-multiline() {
|
842 | run-file ysh-multiline "$@"
|
843 | }
|
844 |
|
845 | ysh-options() {
|
846 | run-file ysh-options "$@"
|
847 | }
|
848 |
|
849 | ysh-options-assign() {
|
850 | run-file ysh-options-assign "$@"
|
851 | }
|
852 |
|
853 | ysh-proc() {
|
854 | run-file ysh-proc "$@"
|
855 | }
|
856 |
|
857 | ysh-regex() {
|
858 | run-file ysh-regex "$@"
|
859 | }
|
860 |
|
861 | ysh-regex-api() {
|
862 | run-file ysh-regex-api "$@"
|
863 | }
|
864 |
|
865 | ysh-reserved() {
|
866 | run-file ysh-reserved "$@"
|
867 | }
|
868 |
|
869 | ysh-scope() {
|
870 | run-file ysh-scope "$@"
|
871 | }
|
872 |
|
873 | ysh-slice-range() {
|
874 | run-file ysh-slice-range "$@"
|
875 | }
|
876 |
|
877 | ysh-string() {
|
878 | run-file ysh-string "$@"
|
879 | }
|
880 |
|
881 | ysh-special-vars() {
|
882 | run-file ysh-special-vars "$@"
|
883 | }
|
884 |
|
885 | ysh-tuple() {
|
886 | run-file ysh-tuple "$@"
|
887 | }
|
888 |
|
889 | ysh-var-sub() {
|
890 | run-file ysh-var-sub "$@"
|
891 | }
|
892 |
|
893 | ysh-with-sh() {
|
894 | run-file ysh-with-sh "$@"
|
895 | }
|
896 |
|
897 | ysh-word-eval() {
|
898 | run-file ysh-word-eval "$@"
|
899 | }
|
900 |
|
901 | ysh-xtrace() {
|
902 | run-file ysh-xtrace "$@"
|
903 | }
|
904 |
|
905 | ysh-user-feedback() {
|
906 | run-file ysh-user-feedback "$@"
|
907 | }
|
908 |
|
909 | ysh-builtin-ctx() {
|
910 | run-file ysh-builtin-ctx "$@"
|
911 | }
|
912 |
|
913 | ysh-builtin-error() {
|
914 | run-file ysh-builtin-error "$@"
|
915 | }
|
916 |
|
917 | ysh-builtin-help() {
|
918 | run-file ysh-builtin-help "$@"
|
919 | }
|
920 |
|
921 | ysh-dev() {
|
922 | run-file ysh-dev "$@"
|
923 | }
|
924 |
|
925 |
|
926 | #
|
927 | # More OSH
|
928 | #
|
929 |
|
930 | nix-idioms() {
|
931 | run-file nix-idioms "$@"
|
932 | }
|
933 |
|
934 | ble-idioms() {
|
935 | sh-spec spec/ble-idioms.test.sh \
|
936 | $BASH $ZSH $MKSH $BUSYBOX_ASH $OSH_LIST "$@"
|
937 | }
|
938 |
|
939 | ble-features() {
|
940 | sh-spec spec/ble-features.test.sh \
|
941 | $BASH $ZSH $MKSH $BUSYBOX_ASH $DASH yash $OSH_LIST "$@"
|
942 | }
|
943 |
|
944 | toysh() {
|
945 | sh-spec spec/toysh.test.sh --oils-failures-allowed 3 \
|
946 | $BASH $MKSH $OSH_LIST "$@"
|
947 | }
|
948 |
|
949 | toysh-posix() {
|
950 | sh-spec spec/toysh-posix.test.sh --oils-failures-allowed 3 \
|
951 | ${REF_SHELLS[@]} $ZSH yash $OSH_LIST "$@"
|
952 | }
|
953 |
|
954 | run-task "$@"
|