Commit Graph

89 Commits

Author SHA1 Message Date
Timothy Sample 87229e4b3a Add arithmetic expansion.
* gash/arithmetic.scm: New file.
* Makefile.am (SOURCES): Add it.
* gash/lexer.scm (get-arithmetic-expansion): New procedure.
(get-expansion): Check for "$((" and use the new procedure to read an
arithmetic expansion.
* gash/eval.scm (word->qword): Handle '<sh-arithmetic>'.
* tests/unit/eval.scm: Add tests.
* tests/spec/Makefile.am (TESTS): Add 'arith'.
* tests/spec/oil.scm: Patch seven of its tests and filter out fifteen
others.
* doc/gash.texi, doc/syntax.txt: Add '<sh-arithmetic>' syntax.
2021-05-26 13:16:50 -04:00
Timothy Sample d3244e0ec0 Move evaluation code from 'word' to 'eval'.
This adjustment paves the way for writing a compiler.

* gash/word.scm (eval-cmd-sub, string-not-null?, word->qword,
expand-word): Move these...
* gash/eval.scm: ...to this module.
* tests/unit/word.scm: Adjust qword tests to use 'expand-qword', and
move non-qword (evaluation) tests to...
* tests/unit/eval.scm: ...this new file, adjusting them to use
'eval-word'.
* Makefile.am (UNIT_TESTS): Add the new file.
2021-04-19 15:11:27 -04:00
Stephen J. Scheck 8f9b973264 Add a language specification.
* language/sh/spec.scm: New file.
* Makefile.am (SOURCES): Add it.
* doc/gash.texi (Using Gash from the Guile REPL): New section.
2020-08-21 15:49:24 -04:00
Timothy Sample 855e15f928 Add the wait built-in.
* gash/built-ins/wait.scm: New file.
* Makefile.scm (SOURCES): Add it.
* geesh/built-ins.scm (*built-ins*): Add 'wait'.
2020-03-17 17:57:01 -04:00
Timothy Sample 25cd5ac5af Use the configured system shell in tests.
* Makefile.am (AM_TESTS_ENVIRONMENT): New variable.
* tests/redirects.org (Files opened for redirect can be executed
immediately): Use an environment variable instead of hard-coding
'/bin/sh'.
2020-02-06 20:26:57 -05:00
Timothy Sample 6f598de23a Generate 'version.texi' reproducibly.
* Makefile.am ($(srcdir)/doc/version.texi): New rule (overriding one
provided by Automake).
2019-12-10 14:53:51 -05:00
Jan Nieuwenhuizen 45223e7d86 Allow 'make dist' in a Git worktree.
* Makefile.am (dist-hook, gen-ChangeLog): Test for mere existence of
.git instead of asserting a directory.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-12-09 14:01:24 -05:00
Timothy Sample a4cfff0641 Generate the ChangeLog reproducibly.
* build-aux/gitlog-to-changelog-repro.patch: New file.
* Makefile.am (EXTRA_DIST): Add it.
(build-aux/gitlog-to-changelog-repro): New rule.
(gen-ChangeLog): Use 'gitlog-to-changelog-repro'.
(DISTCLEANFILES): Add 'build-aux/gitlog-to-changelog-repro'.
2019-12-09 13:57:15 -05:00
Jan Nieuwenhuizen fda97e32ef Generate reproducible source tarballs.
* Makefile.am (dist-hook): Generate a '.tarball-timestamp' file.
(GZIP_ENV): Override, adding '--no-name'.
(am__tar): Override, adding flags to create reproducible source
tarballs.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-12-09 13:57:15 -05:00
Timothy Sample 82b6769285 Allow running 'make dist' from extracted tarball.
* Makefile (dist-hook): Check for '.git' before generating
'.tarball-manifest'.
2019-12-09 13:57:15 -05:00
Timothy Sample f005b1acbc Generate ChangeLog from Git.
* ChangeLog: Update Git log URL and add a copyright notice.
* Makefile.am (gen-ChangeLog): Use 'gitlog-to-changelog' to generate
the ChangeLog.
2019-12-09 13:57:15 -05:00
Timothy Sample 8135e19904 Implement asserting references.
* gash/word.scm (word->qword): Add an implementation for the
'<sh-ref-assert>' and '<sh-ref-assert*>' cases.
* tests/variable-operators.org: New file.
* Makefile.am (FULL_TESTS): Add it.
2019-12-08 12:18:31 -05:00
Timothy Sample 5fed1b0d87 Make 'read' handle input field splitting.
* gash/built-ins/read.scm (split-fields): New procedure.
(main): Use it to split the input into fields and assign each field to
its corresponding variable.
* tests/read.org: New file.
* Makefile.am (FULL_TESTS): Add it.
2019-12-08 12:18:18 -05:00
Timothy Sample 16ba8ca016 Use temporary assignments when calling functions.
* gash/environment.scm (save-variables-excursion): New procedure.
* gash/shell.scm (sh:exec-let): Use it to set up temporary assignments
during the extent of a function.
* tests/temporary-assignments.org: New file.
* Makefile.am (TESTS): Add it.
2019-11-24 17:13:54 -05:00
Timothy Sample 5a27fd59cc Implement pattern-based variable operators.
This commit adds an implementation for the '#', '##', '%', and '%%'
variable operators.

* gash/word.scm (word->qword): Add an implementation for the
'<sh-ref-except-min>', '<sh-ref-except-max>', '<sh-ref-skip-min>',
and '<sh-ref-skip-max>' cases.
2019-11-24 17:13:54 -05:00
Timothy Sample 7c8ddd7a43 Use a record type for patterns.
* gash/compat/srfi-43.scm: New file.
* Makefile.am: Add it.
* gash/pattern.scm (<pattern>): New record type.
(parse-part): New procedure.
(parse-pattern): Return a '<pattern>'.
(pattern-plain?, pattern-match?): Accept a '<pattern>'.
(string-starts-with-part, string-ends-with-part,
string-contains-part): Treat 'part' as a vector.
2019-11-24 17:13:54 -05:00
Timothy Sample 7d2298d15b Aggregate tests into test suites.
This is a big change, but it is conceptually quite simple.  In the old
system, the tests were specified each by multiple files ('.sh', '.exit',
'.stdout', and '.stderr'), and run with the 'test.sh' script.  In the
new system there are multiple tests per file ('.org') and these test
suite files are run with the 'tests/run-test-suite' script.

* tests/00-exit-0.sh,
tests/00-exit-1.exit,
tests/00-exit-1.sh,
tests/00-exit-2.exit,
tests/00-exit-2.sh,
tests/00-exit-error.exit,
tests/00-exit-error.sh,
tests/00-exit-var.exit,
tests/00-exit-var.sh,
tests/00-exit.sh: Delete files, moving their contents...
* tests/exiting.org: ...here.
* tests/01-script-arg-0.sh,
tests/01-script-arg-length.sh,
tests/01-script-arg-length.stdout,
tests/01-script-arg-list.sh,
tests/01-script-arg-list.stdout,
tests/01-script-backslash-space.sh,
tests/01-script-backslash-twice.exit,
tests/01-script-backslash-twice.sh,
tests/01-script-backslash.exit,
tests/01-script-backslash.sh,
tests/01-script-newline.exit,
tests/01-script-newline.sh,
tests/01-script-semi.exit,
tests/01-script-semi.sh,
tests/01-script-shift.sh,
tests/01-script-shift.stdout: Delete files, moving their contents...
* tests/arguments.org: ...here.
* tests/03-echo-brace.sh,
tests/03-echo-brace.stdout,
tests/03-echo-doublequotes.sh,
tests/03-echo-doublequotes.stdout,
tests/03-echo-escaped-doublequotes.sh,
tests/03-echo-escaped-doublequotes.stdout,
tests/03-echo-nesting.sh,
tests/03-echo-nesting.stdout,
tests/03-echo-quoted-doublequotes.sh,
tests/03-echo-quoted-doublequotes.stdout,
tests/03-echo.sh: Delete files, moving their contents...
* tests/words.org: ...here.
* tests/04-echo-equal.sh,
tests/04-echo-equal.stdout,
tests/04-echo-var.sh,
tests/04-echo-word-at-word.sh,
tests/04-echo-word-at-word.stdout,
tests/04-echo-word-at.sh,
tests/04-echo-word-at.stdout: Delete files, moving their contents...
* tests/variable-words.org: ...here.
* tests/05-assignment-backtick.sh,
tests/05-assignment-backtick.stdout,
tests/05-assignment-double-quote.sh,
tests/05-assignment-doublequoted-doublequotes.sh,
tests/05-assignment-doublequoted-doublequotes.stdout,
tests/05-assignment-echo.sh,
tests/05-assignment-echo.stdout,
tests/05-assignment-empty.sh,
tests/05-assignment-empty.stdout,
tests/05-assignment-singlequote.sh,
tests/05-assignment-variable-word.sh,
tests/05-assignment-variable-word.stdout,
tests/05-assignment-word-variable.sh,
tests/05-assignment-word-variable.stdout,
tests/05-assignment.sh: Delete files, moving their contents...
* tests/assignments.org: ...here.
* tests/06-command-compound-word.sh,
tests/06-command-compound-word.stdout,
tests/06-compound-word.sh,
tests/06-compound-word.stdout: Delete files, moving their contents...
* tests/compound-words.org: ...here.
* tests/07-variable-not-or.sh,
tests/07-variable-not-or.stdout,
tests/07-variable-or-doublequote.sh,
tests/07-variable-or-doublequote.stdout,
tests/07-variable-or-empty.sh,
tests/07-variable-or-empty.stdout,
tests/07-variable-or-slash.sh,
tests/07-variable-or-variable.sh,
tests/07-variable-or-variable.stdout,
tests/07-variable-or.sh,
tests/07-variable-or.stdout: Delete files, moving their contents...
* tests/variable-or.org: ...here.
* tests/08-variable-and.sh,
tests/08-variable-and.stdout,
tests/08-variable-not-and.sh,
tests/08-variable-not-and.stdout: Delete files, moving their contents...
* tests/variable-and.org: ...here.
* tests/10-else-multiple.sh,
tests/10-else.multiple.stdout,
tests/10-if-bracket-false.sh,
tests/10-if-bracket.sh,
tests/10-if-elif.sh,
tests/10-if-else.sh,
tests/10-if-false.sh,
tests/10-if-line.sh,
tests/10-if-multiple.sh,
tests/10-if-multiple.stdout,
tests/10-if-redirect.sh,
tests/10-if-test-false.sh,
tests/10-if-test.sh,
tests/10-if-word-variable.sh,
tests/10-if.sh: Delete files, moving their contents...
* tests/conditionals.org: ...here.
* tests/11-for-done-subshell.sh,
tests/11-for-done-subshell.stdout,
tests/11-for-split-sequence.sh,
tests/11-for-split-sequence.stdout,
tests/11-for.sh,
tests/11-for.stdout: Delete files, moving their contents...
* tests/loops.org: ...here.
* tests/20-and.exit,
tests/20-and.sh,
tests/20-exec.sh,
tests/20-or.sh,
tests/20-pipe-exit-0.sh,
tests/20-pipe-exit-1.exit,
tests/20-pipe-exit-1.sh,
tests/20-pipe-sed-cat.sh,
tests/20-pipe-sed-cat.stdout,
tests/20-pipe-sed.sh,
tests/20-pipe-sed.stdout,
tests/20-semi.exit,
tests/20-semi.sh: Delete files, moving their contents...
* tests/pipes-and-booleans.org: ...here.
* tests/30-for-substitution.sh,
tests/30-for-substitution.stdout,
tests/30-substitution-assignment-at.sh,
tests/30-substitution-assignment-at.stdout,
tests/30-substitution-assignment.sh,
tests/30-substitution-assignment.stdout,
tests/30-substitution-backtick.sh,
tests/30-substitution-backtick.stdout,
tests/30-substitution-redirect.sh,
tests/30-substitution-redirect.stdout,
tests/30-substitution-word.sh,
tests/30-substitution-word.stdout,
tests/30-substitution.sh,
tests/30-substitution.stdout: Delete files, moving their contents...
* tests/command-substitution.org: ...here.
* tests/40-assignment-eval-echo.sh,
tests/40-assignment-eval-echo.stdout,
tests/40-eval-echo-variable.sh,
tests/40-eval-echo-variable.stdout,
tests/40-eval.sh,
tests/40-eval.stdout: Delete files, moving their contents...
* tests/eval.org: ...here.
* tests/41-dot.sh,
tests/41-dot.stdout: Delete files, moving their contents...
* tests/dot.org: ...here.
* tests/42-export-new.sh,
tests/42-export-new.stdout,
tests/42-sh-export-new.sh,
tests/42-sh-export-new.stdout,
tests/42-sh-export.sh,
tests/42-sh-export.stdout,
tests/42-sh.sh,
tests/42-sh.stdout: Delete files, moving their contents...
* tests/exporting.org: ...here.
* tests/data/42-export-new.sh: New file (copied from
'tests/42-export-new.sh').
* tests/43-trap-subshell.sh,
tests/43-trap-subshell.stdout: Delete files, moving their contents...
* tests/signals.org: ...here.
* tests/50-iohere-builtin.sh,
tests/50-iohere.sh,
tests/50-iohere.stdout,
tests/50-redirect-append.sh,
tests/50-redirect-append.stdout,
tests/50-redirect-clobber.sh,
tests/50-redirect-clobber.stdout,
tests/50-redirect-in-out.sh,
tests/50-redirect-in-out.stdout,
tests/50-redirect-in.sh,
tests/50-redirect-merge.sh,
tests/50-redirect-merge.stdout,
tests/50-redirect-pipe.sh,
tests/50-redirect-pipe.stdout,
tests/50-redirect-sed.sh,
tests/50-redirect-sed.stdout,
tests/50-redirect-space.sh,
tests/50-redirect-space.stdout,
tests/50-redirect.sh,
tests/50-redirect.stdout: Delete files, moving their contents...
* tests/redirects.org: ...here.
* tests/60-function-at.sh,
tests/60-function-at.stdout,
tests/60-function.sh,
tests/60-function.stdout,
tests/60-subst.sh: Delete files, moving their contents...
* tests/functions.org: ...here.
* tests/70-hash-hash.sh,
tests/70-hash-hash.stdout,
tests/70-hash.sh,
tests/70-hash.stdout,
tests/70-percent-percent.sh,
tests/70-percent-percent.stdout,
tests/70-percent-space.sh,
tests/70-percent-space.stdout,
tests/70-percent.sh,
tests/70-percent.stdout,
tests/70-slash-string-slash.sh,
tests/70-slash-string.sh,
tests/70-slash-string.stdout,
tests/70-slash.sh,
tests/70-slash.stdout: Delete files, moving their contents...
* tests/variable-patterns.org: ...here.
* tests/100-bracket-file.sh,
tests/100-cd-foo.exit,
tests/100-cd-foo.sh,
tests/100-cd.sh,
tests/100-cd.stdout,
tests/100-test-false.sh,
tests/100-test-file.sh,
tests/100-test.sh: Delete files.
* tests/README: Move this...
* tests/data/README: ...here and adapt to the new directory.
* test.sh: Delete file.
* tests/run-test-suite.in: New file.
* configure.ac: Configure it.
* Makefile.am (TEST_EXTENSIONS): Replace '.sh' with '.org'.
(SH_LOG_COMPILER): Delete variable.
(ORG_LOG_COMPILER): New variable.
(FULL_TESTS, XFAIL_TESTS): Replace '.sh' tests with '.org' tests.
(BROKEN_TESTS): Delete variable.
(TEST_DATA_FILES): Remove '.exit' and '.stdout' files; add
tests/data/42-export-new.sh.
(EXTRA_DIST): Add tests/data/README; remove tests/README,
BROKEN_TESTS, and test.sh.
* .gitignore: Adjust accordingly.
2019-06-14 20:27:33 -04:00
Timothy Sample 453d48d850 Add a THANKS file.
* THANKS: New file.
* Makefile.am: Distribute it.
2019-06-01 11:09:29 -04:00
Timothy Sample 490878443b Further clarify test copyrights.
* tests/COPYRIGHT: Rename this...
* tests/README: ...to this and make it much more explicit.
* Makefile.am (EXTRA_DIST): Update name.
2019-05-24 14:15:22 -04:00
Timothy Sample fe42975cc2 Distribute a ChangeLog stub for the first release.
* Makefile.am (gen-ChangeLog): Do not generate the ChangeLog from Git.
2019-05-24 13:00:17 -04:00
Timothy Sample 2fe190e497 Clarify the copyrights of the integration tests.
* tests/COPYRIGHT: New file.
* Makefile.am (EXTRA_DIST): Add it.
2019-05-22 00:44:39 -04:00
Timothy Sample 597a6bcfb1 Touch up metadata and copyright notices.
* build-aux/gitlab-ci.yml,
build-aux/pre-inst-env.in,
configure.ac,
test.sh,
tests/spec/Makefile.am,
tests/spec/check-spec: Add copyright notices and GPLv3+ license notice.
* guix.scm: Add a "special exception" permissive license notice.
* doc/syntax.txt: Add title, introduction, copyright notice, and a
simple all-permissive license.
* COPYING.CC0: New file.
* NEWS: Reformat and add CC0 license notice.
* README: Add CC0 license notice.
* Makefile.am: Add copyright notices and GPLv3+ license notice.
(EXTRA_DIST): Add COPYING.CC0.
2019-05-22 00:44:39 -04:00
Timothy Sample eaf8b5da61 Make sure that the tarball has everything.
* Makefile.am (distcheck-hook): New target.
2019-05-22 00:44:39 -04:00
Timothy Sample a4efd9359e Use Automake recipes from Guile.
* build-aux/guile-rules.am: Delete file.
* build-aux/guile.am: New file.
* .gitignore: Do not ignore it.
* Makefile.am: Adapt variable names to the new file.
2019-05-22 00:44:39 -04:00
Timothy Sample ad73b36116 Fix 'make distclean'.
* Makefile.am (distclean-local): Run 'make distclean' for the
specification tests.
2019-05-22 00:44:33 -04:00
Timothy Sample 95545c9269 Fix building from an external directory.
* Makefile.am (scripts/gash): Make sure the 'scripts' directory exists
in the build tree.
(SH_LOG_COMPILER): Call 'test.sh' from the source tree.
* test.sh: Change the default test shell from 'scripts/gash' to
'gash'; export a 'TEST_TMP' variable that tells tests where to store
temporary files; and make sure all output is written to the build
directory.
tests/50-redirect-append.sh: Use the 'TEST_TMP' variable.
tests/60-subst.sh: Ditto.
2019-05-20 18:07:47 -04:00
Timothy Sample 0c57fc9ef9 Move 'textual-ports' under 'compat'.
* gash/textual-ports.scm: Move this...
* gash/compat/textual-ports.scm: ...here.
* Makefile.am, gash/lexer.scm, gash/parser.scm, gash/shell.scm,
tests/unit/shell.scm: Update references.
2019-05-20 18:07:47 -04:00
Timothy Sample 878b9c3dca Add support for Guile 2.0.9.
* gash/compat.scm: New file.
* gash/compat/hash-table.scm: New file.
* Makefile.am: Add them.
* .dir-locals.scm: Add indentation for 'if-guile-version-below'.
* guix.scm (guile-2.0.9): New variable.
* gash/built-ins/echo.scm (escape->control): Use '#\esc'.
* gash/environment.scm: Use '(gash compat hash-table)'.
* gash/built-ins/break.scm,
gash/built-ins/cd.scm,
gash/built-ins/command.scm,
gash/built-ins/continue.scm,
gash/built-ins/dot.scm,
gash/built-ins/exec.scm,
gash/built-ins/exit.scm,
gash/built-ins/pwd.scm,
gash/built-ins/return.scm,
gash/built-ins/set.scm,
gash/built-ins/shift.scm,
gash/built-ins/trap.scm,
gash/built-ins/type.scm,
gash/built-ins/umask.scm,
gash/eval.scm,
tests/unit/automake.scm: Use '(gash compat)'.

squash! Add support for Guile 2.0.9.
2019-05-20 18:07:47 -04:00
Timothy Sample c61b1d6fef Make the Guix package work without Git.
This commit generates a '.tarball-manifest' file that gets placed in
the distribution tarball and simply lists all the files that are in
the Git tree.  It is used to determine which files should be
considered source files when building the package using Guix.

* guix.scm (make-select): Fall back on reading from
'.tarball-manifest' if a Git repository is not available.
2019-05-20 18:07:47 -04:00
Timothy Sample 511dae3577 Add missing files to the distribution tarball.
* Makefile.am (EXTRA_DIST): Add various scripts, metadata, helpful
files, and tests.
2019-05-20 18:07:47 -04:00
Timothy Sample fcf32d1cad Setup documentation generation.
* Makefile.am (info_TEXINFOS, gash_TEXINFOS): New targets.
* guix.scm: Add 'texinfo' to build inputs.
* doc/gash.info: Delete file.
* .gitignore: Ignore generated documentation files.
2019-05-20 18:07:47 -04:00
Timothy Sample 2e51c3f9ab Add missing tests to the Makefile.
* Makefile.am (FULL_TESTS): Add tests/05-assignment-backtick.sh,
tests/10-if-line.sh, tests/10-if-redirect.sh, and
tests/20-pipe-sed-cat.sh.
2019-05-20 18:07:47 -04:00
Timothy Sample ea7266e8f1 Add missing '.PHONY' indicator to Makefile.
* Makefile.am (test-list): Mark as phony.
2019-05-20 18:07:32 -04:00
Timothy Sample 0f6eb40f44 Reorder Makefile and add section comments.
* Makefile.am: Reorder rules and add section header comments to
make the structure clear.
2019-05-20 01:18:54 -04:00
Timothy Sample 315815bbd6 Factor out and update the usual Guile rules.
* build-aux/guile-rules.am: New file.
* .gitignore: Do not ignore it.
* Makefile.am: Include it, remove the rules it replaces, update
changed variable names, and use appending for 'EXTRA_DIST' and
'CLEANFILES'.
2019-05-20 01:18:54 -04:00
Timothy Sample 7c1c3ad5c8 Setup ChangeLog generation.
Use the 'gitlog-to-changelog' script from Gnulib to generate a
ChangeLog from the Git commit log when creating the distribution
tarball.

* build-aux/gitlog-to-changelog: New file.
* .gitignore: Do not ignore it.
* Makefile.am (gen-ChangeLog): New target.
(dist-hook): Depend on it.
* ChangeLog: New file.
2019-05-20 01:18:54 -04:00
Timothy Sample 55ba522d38 Delete test output files when cleaning.
* Makefile.am (CLEANFILES): Include the '.1' and '.2' output files
from the integration tests.
2019-05-20 01:18:54 -04:00
Timothy Sample e39abd1566 Stop 'make clean' from deleting tests.
* Makefile.am (CLEANFILES): Fix the string replacements so that useful
tests do not get deleted.
2019-05-20 01:18:54 -04:00
Timothy Sample ff34039b62 Remove unused modules.
* gash/builtins.scm,
gash/io.scm,
gash/job.scm,
gash/pipe.scm,
gash/script.scm,
gash/shell-utils.scm,
gash/util.scm: Delete files.
* Makefile.am: Remove them.
* gash/gash.scm (main, prompt): Remove calls to deleted job control
procedures.
2019-05-20 01:18:54 -04:00
Timothy Sample df43ca7215 Add support for Guile 2.0.
* configure.ac (GUILE_PKG): Add 2.0.
* gash/textual-ports.scm: New file.
* Makefile.am: Add it.
* gash/lexer.scm, gash/parser.scm, gash/shell.scm: Use it in place of
'(ice-9 textual-ports)'.
* tests/unit/shell.scm: Use it in place of '(ice-9 textual-ports)';
replace '(ice-9 textual-ports)' with '(rnrs io ports)' in sub-scripts;
and add a shim for 'setvbuf'.
2019-05-20 01:18:54 -04:00
Timothy Sample 10400ed2ad Remove PEG modules and the PEG-based parser.
* gash/grammar.scm,
gash/peg.scm,
gash/peg/cache.scm,
gash/peg/codegen.scm,
gash/peg/simplify-tree.scm,
gash/peg/string-peg.scm,
gash/peg/using-parsers.scm: Delete files.
Makefile.am: Remove them.
2019-05-20 01:18:54 -04:00
Timothy Sample 874d165b11 Remove the unused 'geesh' module.
* gash/geesh.scm: Delete file.
* Makefile.am: Do not compile it.
* gash/gash.scm (%geesh-parser?): Remove unused variable.
(parse, parse-string, file-to-ast): Remove unused procedures.
2019-05-20 01:18:54 -04:00
Jan Nieuwenhuizen 5b74c6426a echo: Implement escapes.
* gash/built-ins/echo.scm (escape->control): New function.
(echo): Support '-e' and '-E' options even when clumped.
* Makefile.am (XFAIL_TESTS): Remove tests/20-pipe-sed.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:18:48 -04:00
Jan Nieuwenhuizen 18aefdda18 tests: Add 100-test-false.sh.
* tests/100-test-false.sh: New file.
* Makefile.am (FULL_TESTS): Add it.
2019-05-20 01:18:48 -04:00
Jan Nieuwenhuizen 06099ddead tests: Add 43-trap-subshell.sh.
* tests/43-trap-subshell.sh: New file.
* tests/43-trap-subshell.stdout: New file.
* Makefile.am (FULL_TESTS): Add tests/43-trap-subshell.sh.
2019-05-20 01:18:48 -04:00
Jan Nieuwenhuizen 7640a09382 Support redirects with empty commands.
* gash/eval.scm (exp->thunk): Return 'noop' if 'exp' is '#f'.
* tests/50-redirect-clobber.sh: New file.
* tests/50-redirect-clobber.stdout: New file.
* Makefile.am (FULL_TESTS): Add tests/50-redirect-clobber.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:18:36 -04:00
Jan Nieuwenhuizen 13f43973f5 Do not export unset variables.
* gash/environment.scm (get-environ): Filter out unset variables.
* tests/42-sh-export-new.sh: New file.
* tests/42-sh-export-new.stdout: New file.
* Makefile.am (FULL_TESTS): Add tests/42-sh-export-new.sh.
(XFAIL_TESTS): Remove tests/42-export-new.sh and tests/42-sh-export.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:18:22 -04:00
Jan Nieuwenhuizen 2e4e078975 Fix some environment-dependent tests.
* gash/environment.scm (initial-variables): Add 'SHELL' and 'SHELLOPTS'.
* tests/100-cd.sh, tests/100-cd.stdout: Use '/tmp' instead of '/bin'.
* tests/50-redirect-in-out.sh, tests/50-redirect-space.sh,
tests/50-redirect.sh: Use '/tmp' and PID for temporary files.
* tests/50-redirect-sed.sh: Make sure 'DESTDIR' is unset and use
'/bin/GASH' in place of '/bin/gash'.
* tests/50-redirect-sed.stdout, tests/data/diff.scm: Use '/bin/GASH' in
place of '/bin/gash'.
* Makefile.am (FULL_TESTS): Add tests/50-redirect-sed.sh,
tests/50-redirect-space.sh, and tests/100-cd.sh; remove
tests/50-redirect-merge.sh.
(BROKEN_TESTS): Remove tests/10-if-redirect.sh,
tests/50-redirect-sed.sh, tests/50-redirect-space.sh, and
tests/100-cd.sh; add tests/50-redirect-merge.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:18:07 -04:00
Jan Nieuwenhuizen 56610b0669 Add export test.
* tests/42-export-new.sh: New file.
* tests/42-export-new.stdout: New file.
* Makefile.am (FULL_TESTS, XFAIL_TESTS): Add 42-export-new.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:17:57 -04:00
Timothy Sample 1bd92e2893 Remove (almost) all references to Geesh.
gash/environment.scm: Remove file.
geesh/*: Move these files into the 'gash' folder and replace all
instances of the word 'geesh'.
scripts/geesh.in: Remove file.
HACKING, INSTALL, Makefile.am, configure.ac, guix.scm,
tests/bootstrap/bash-without-bash.scm, tests/spec/Makefile.am,
tests/spec/check-spec, tests/spec/oil.scm, tests/unit/*,
tools/coverage.in: Replace all instances of the word 'geesh'.

Co-authored-by: Jan Nieuwenhuizen <janneke@gnu.org>
2019-05-20 01:17:40 -04:00