summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* Expand ~ in DOTFILES_DIRSGravatar Rebecca Meritz2017-10-27
| | | | | Hat tip to fgatham for the `eval echo` tip. This means both `~` and e.g. `~dmr` work correctly.
* rcup: handle directory names containing whitespaceGravatar Florian Tham2017-03-10
| | | | This commit fixes #197.
* Handle spaces in dotfile nameGravatar Mike Burns and Eric Collins2016-12-26
| | | | | | | | | | | | | | | | | In mkrc, separate the list of files with newlines instead of spaces. Change the `$IFS` when iterating to handle this. We hand the file off to rcup, which encodes the file name by replacing spaces with the bell character (`\a`). rcup then sends the file name off to lsrc, which decodes the bell back into a space. The test makes sure an `a` character is in the filename, in case some encoding goes wrong. We use tr(1) instead of sed(1) because tr(1) handles `\a`. Shoutout to Sublime Text 3 for forcing this issue.
* Fix relative exclude globsGravatar Mike Burns and Eric Collins2016-12-26
| | | | | | | Pass the dotfiles subdir along with the file to `is_excluded` so that we can match against it. Preserve single-file compatibility by looping twice.
* Run hooks in a defined orderGravatar David Alexander2016-11-12
| | | | | | | Run the hooks in alphabetical order so that people can more predictably manage their hooks. While here, clean up the NEWS.md.in.
* Symlink identical files if they are not yet linkedGravatar Graham Bennett2015-11-27
| | | | | Edge case: a file is a copy of a dotfile but is not linked. In this case we should link it.
* Non-recursive MakefileGravatar Mike Burns2015-11-07
| | | | | Instead of a complex graph, process everything from one Makefile. Simplify, simplify.
* Fix hooks so that they are run in the directory where they are locatedGravatar Jarkko Kniivilä2015-11-01
| | | | | | | | | | | | Calls `find(1)` with the `-exec` action just like before but instead of `run_hooks()` letting `find` execute the hook directly it is wrapped in a shell one-liner which changes to the hook's directory and executes the hook with "./" prepended to its basename. These changes allow hooks to refer to dotfiles with relative paths. For instance we can call a Makefile two directories up simply with `make -C ../..`. Also make sure we are compatible with Solaris' Bourne shell and `find(1)`. Closes #150. Closes #149.
* Do not depend on readlink(1) or -qGravatar Jarkko Kniivilä2015-11-01
| | | | | | | | | | | | | | | | | Solaris 10 lacks readlink(1). Additionally, its different grep(1) and diff(1) do not take a `-q` flag. Use a Perl one-liner instead of readlink(1) which is missing on Solaris 10. Also because /usr/bin/grep and diff(1) don't understand the `-q` option, make them go quiet by redirecting stdout to `/dev/null` instead. The Perl dependency only exists in the test suite, so it does not incur a runtime penalty for end users. This is to work around the fact that readlink(1) is missing on Solaris. The tradeoff is: on Solaris, installing third-party software (readlink) is a pain, whereas on e.g. FreeBSD installing third-party software (Perl) is simple and common.
* Changes the priority to: hosts->tags->defaultGravatar Christian Höltje2015-06-05
| | | | | | | | | | This changes the order that things are pulled in so that: 1. Hosts take priority over everything. 2. Tags take priority over default. 3. Default takes priority over nothing. Closes #94
* Run hooks on rcdn as indicated by the manpageGravatar Ben Turrubiates2015-01-07
| | | | | | - Make sure IFS in rcup and rcdn isn't left in an incorrect state when the output of lsrc is empty. - Add tests to check that hooks run on rcdn and rcup by default.
* Add test helper to the check taskGravatar Mike Burns2014-11-19
| | | | | | The `helper.sh` was not being distributed, which caused `make distcheck` to fail. Add it as data so that it's not processed but still distributed.
* Support rc files without leading dotsGravatar Christopher Koch2014-11-19
| | | | | | | | | | | This adds the `-U` option to lsrc(1), rcup(1), and rcdn(1) commands; its argument is an exclusion pattern. Any file matching this pattern is symlinked without the leading dot. There is also a `-u` option to undo a `-U`. The `UNDOTTED` setting in rcrc(5) can be used to set it permanently. The mkrc(1) command has `-U` and `-u` flags. They take no argument.
* Only use the host's name in the testGravatar Mike Burns2014-11-19
| | | | | | | | | | | | The test uses `$(hostname)`, which can produce the FQDN; however, the code only uses the host name portion of that. Modify the test to do the same by defining a `hostname` function that calls the hostname(1) binary then pipes it through sed(1). Use command instead of hardcoding the path. OS X uses `$HOSTNAME` instead of the result of hostname(1). In the test suite, use `$HOSTNAME` first, falling back to hostname(1).
* Manually resolve symlinks in test helpersGravatar Melissa Xie2014-11-17
| | | | | | | | | | | | Mac OS X's `readlink` command does not support the same options as GNU, FreeBSD, and other operating systems, nor does it support canonicalizing symlink resolutions. In place of `readlink`, we're going to borrow [this] suggested implementation from the community. [this]: http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
* Update usage messagesGravatar Mike Burns2014-11-14
| | | | | | | | Various flags were missing from usage messages across the system; `-g` and `-s` were the most notable ones. Add them to the appropriate usage messages. Spotted by Christopher Koch.
* Generate an installation scriptGravatar Mike Burns2014-08-26
| | | | | | | | | | | | | | | | | | This commit adds a `-g` flag to rcup(1) to generate a standalone shell script. This shell script can then be run again, even on different computers, to recreate the symlinks. This allows people to recreate the "download my dotfiles and run ./install.sh" instructions, but with generated code that they do not need to maintain. This provides us more freedom with lsrc(1): since rcm can be used to generate a universal shell script, lsrc(1) now can be harder to install -- it can depend on a compiler, for example -- because you only need to install it on one machine. The generated script is rather limited; this can be improved in future commits, as desired.
* Allow the user to override SYMLINK_DIRS with -sGravatar Mike Burns2014-07-09
| | | | | | | | This adds a `-s` that can be used to override the `SYMLINK_DIRS` config, or the `-S` flag, to lsrc(1), mkrc(1), rcup(1), and rcdn(1). The `-s` flag is the opposite of -S: any argument, if it is a directory, is not symlinked but instead recurred down.
* On bad args, show usage and exitGravatar Mike Burns2014-05-30
| | | | | | | | | | | | The lsrc(1), mkrc(1), rcup(1), and rcdn(1) commands will now print a usage message and exit immediately (with 64, `EX_USAGE`) when given an option it does not understand. This includes `--version` and `--help`. Normal `-h` will print usage and exit successfully, as normal. Closes #59.
* Make the tests run againGravatar Mike Burns2014-05-30
| | | | | | | | The `check` target was broken because of `dist_TESTS`; it _must_ be just `TESTS`, not distributed. Use `dist_check_SCRIPTS` instead so that they can be packaged as scripts for checking the system.
* Distribute the tests with the tarballGravatar Mike Burns2014-05-09
| | | | | People who download the tarball should be able to run the tests themselves, so distribute the tests as part of the tarball.
* Update documentation on usageGravatar Mike Burns2014-05-09
| | | | | | | | | | | | | | | | | New flags have accumulated without proper care for the usage instructions or man pages. I manually went through each program and verified its usage instruction against its `getopts`, then I alphabeticalized the usage message. Based on the usage message, I then verified the synposis in the manpage. Then, based on the synposis, I alphabeticalized the detailed listing of the arguments and filled in the missing pieces. The `-h` and `-V` arguments were missing from all manpages. In the future we will need to be more careful about this. It would be good to automate a checker that refuses to build unless the docs have all the flags mentioned.
* Add a hostname overrideGravatar Mike Burns2014-05-07
| | | | | | | | | | | | | | | | | | | Based on issue #82, we now provide `-B` to override the hostname. In particular: - `mkrc -B foo` will enable `-o` but with the hostname set up `foo`. - `lsrc -B foo` will work like normal `lsrc` except it treats `host-foo` as the host-specific directory. - `rcup -B foo` will run a normal `rcup` except `host-foo` is the host-specific directory. - `rcdn -B foo` is just like normal `rcdn`, but with `host-foo` as the host-specific directory. The `HOSTNAME` can also be set in the rcrc(5), and this is overridden by the aforementioned `-B`. While making this change: The `test/Makefile.am` used a mix of tabs and spaces. Since it's a Makefile, replace it all with tabs.
* Bugfix: do not break out of the for loopGravatar Mike Burns2014-05-06
| | | | | | | | A `break` anywhere inside a `for` loop (even inside a `case`) will exit from the innermost loop. Replace the `break` with a `:` to get the desired effect. Spotted by Pat Brisin.
* mkrc with relative filenames inside dotted dirGravatar Pablo Olmos de Aguilera Corradini2014-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | This is best explained with an example. If I want to track a file like `~/.bundle/config`, the correct way would be: ~$ mkrc ~/.bundle/config --> ~/.dotfiles/bundle/config But if you are already inside the directory, say: ~/.bundle $ and you ran: ~/.bundle $ mkrc con<TAB> # for autocomplete ~/.bundle $ mkrc config --> ~/.dotfiles/.config Which is obviously not what you meant. This basically checks first if the file exists in the current working directory and if it is, it's expand the full path. ~/.bundle $ mkrc config --> ~/.dotfiles/bundle/config
* An integration test suiteGravatar patrick brisbin2014-04-08
This test suite uses cram to run integration tests through `/bin/sh`. The tests are all high-level acceptance tests; they should work regardless of the implemention code. To run them, you must first install cram: sudo pip install cram Then the `check` target will run them: make check Failure output should be printed clearly to stdout, but in general: full test output is in `test/test-suite.log` and output specific to a test named `foo.t` is in `foo.t.log`. Tests are now encouraged in `CONTRIBUTING.md` as part of the normal pull request process. This is a TAP-enabled test suite.