The shelltest migration was done in 1.4, but not completed - the
distcheck was still doing hard-coded manual tests, and as such, the
"check" target from the dist archive was not working. Sigh.
Now 'distcheck' is using 'check', and the archive is complete.
I spent 20 minutes trying to understand why lcov/gcov were complaining
about wrong coverage format/version, before I saw I had a 2 year old
file that was not overwritten nor removed…
The embedding of tests in the Makefile works only for that is there
today - a few `--version` and `stinit -p` calls. For expanding the
test coverage, as much as it can be done for `mt`, let's use a proper
shell test runner. `shelltestrunner` is available in Debian/Ubuntu, so
it's likely to be available in other distributions too, and as such
should not be a big barrier to contribution.
This needs lcov installed, but it's a good quick helper for local
runs. For history and pull requests, codecov keeps tracking.
Also tweak in the process gitignore to clean the noise.
This is the exact same mini-"tests" that are used in distcheck, but
separated so that the tests can be run with coverage tracking. Would
be good not to have duplicates - maybe use make check inside the
distcheck?
While fixing #14, what pointed me to check parsing validity (and not
local issues as I thought at first) was that `-v -v` was showing empty
mode definitions, despite claiming parse success. So let's add a test
that mode parsing does do things, not just empty claims.
The source code seems to have, over time, become less self-consistent
in style. In order to not have to keep this up manually, switch over
indenting to clang-format. A .clang-format file is provided to give
repeatable results.
The main difference is switching from tabs to non-tabs
usage. Otherwise the changes are mostly minor and leading to more
consistency. Contributions to the format style welcome!
Nota bene: this should have had no code impact. Any actual code
changes (beyond indenting) are bugs in the re-indent process.
This would have found earlier things such as issue #6, and since it's
only done in distcheck, doesn't impact normal users (for whom
`-Werror` is a bit too strict).
This patch reworks the directory-related variables to allow
installation of binaries under `/usr/[s]bin`, instead of directly
under `/[s]bin`. It also allows installing the man pages under a
different prefix (e.g. `/usr/local`).
Example:
$ make install EXEC_PREFIX=/usr
will install binaries under `/usr/bin`, respectively `/usr/sbin`. A
full "local" installation under `/usr/local` is accomplished by:
$ make install EXEC_PREFIX=/usr/local PREFIX=/usr/local
This patch points once again that an autoconf/automake conversion
would make a lot of sense…
Closes#3. Additionally, it fixes a previous bug with installation of
the manual pages.
Short of moving to autotools, this is the best that can be done:
- move the version from hardcoded in the .c files, to a
dynamically-built `version.h` file so that we only declare the
version in one place
- build a better dist file (.tar.gz) by explicitly selecting which
files to copy, instead of unbounded recursion from the source
directory
- ensure that the files being copied to the archive have a sane
user/group and mode
- add a distcheck target that simply reuses the archive to build and
run the programs, and then regenerate the archive from itself
autotools would solve all this by default, but still feels too
heavyweight for just two .c files.
Additionall, drop the .lsm file. It seems mostly useless these days;
I'll be happy to reinstate it however if anyone cares.
Commit 0ca6864 changed CFLAGS to be taken from the environment, but
without using any default value. This patch restores the old CFLAGS
value as the default one.