Make the list unambiguous and easy to consume by POSIX shell scripts.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Useful before committing something.
* `listfull.sh` lists tests that are run by `testfull.sh`.
It is used by other scripts but can be used by human to see what is tested.
+ Each path is quoted using apostrophes, with `'\''` escaping an apostrophe.
+ This syntax is compatible with `xargs` and the POSIX shell.
Currently, all files in `tests/`, `lib/` and `examples/` are executed, some of `contrib/` and the main programs of `src/`.
To update the list of tested files, just edit this script.
#!/bin/sh
-ls -1 -- "$@" \
+for module in "$@" \
../src/nit*.nit \
../src/test_*.nit \
../src/examples/*.nit \
../contrib/nitin/nitin.nit \
../contrib/nitiwiki/src/nitiwiki.nit \
*.nit \
- | grep -v ../lib/popcorn/examples/
+; do
+ case "${module}" in
+ ../lib/popcorn/examples/*)
+ continue
+ ;;
+ *)
+ # See [Rich’s sh (POSIX shell) tricks](http://www.etalabs.net/sh_tricks.html),
+ # section “Shell-quoting arbitrary strings”.
+ printf '%s\n' "${module}" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/'/"
+ ;;
+ esac
+done