# HG changeset patch # User ali # Date 1327914667 0 # Node ID f28ad45778632e54c13951f763cc9b26ccca8179 # Parent 6a13fe0fc19e2ae100e0986865f6538c60d81787 Update documentation diff -r 6a13fe0fc19e -r f28ad4577863 README --- a/README Mon Jan 30 00:36:31 2012 +0000 +++ b/README Mon Jan 30 09:11:07 2012 +0000 @@ -54,11 +54,56 @@ Mac --- -I think this should be quite similar to Linux, doing something like this: +The least intrusive means to build on a Mac is to use Homebrew: -% sudo port install gcc pkgconfig glib2-devel -% ./configure -% make -% sudo make install +http://mxcl.github.com/homebrew/ -It may also be possible to use fink instead of macports. +Install Homebrew according to its instructions. + +If you are building bookloupe for your own use, you can use dynamic linking +like this: + +$ brew install glib + +and then install bookloupe using: + +$ ./configure +$ make +$ make install + +If you want to build bookloupe for other people to use, you will probably +want to link staticly. To do this you need to edit the formula for glib +and each of its dependencies (gettext and libffi) using something like: + +$ brew edit gettext + +Each time find the args statement which includes --prefix and insert +--disable-shared,for example change: + +args = ["--disable-dependency-tracking", "--disable-rebuilds", + "--prefix=#{prefix}", + "--disable-dtrace"] + +to + +args = ["--disable-dependency-tracking", "--disable-rebuilds", + "--disable-shared", + "--prefix=#{prefix}", + "--disable-dtrace"] + +and then + +$ brew install glib + +before installing bookloupe as normal, but with the extra flag to configure: + +$ ./configure --disable-shared +$ make +$ make install + +Note that if you have previously used dynamic linking this may not work. +(Homebrew doesn't seem to create .la files in a form that libtool can use +when it is asked to prefer static libraries to dynamic ones.) Removing the +dynamic libraries first will solve this problem. + +It may also be possible to use fink or macports. diff -r 6a13fe0fc19e -r f28ad4577863 configure.ac --- a/configure.ac Mon Jan 30 00:36:31 2012 +0000 +++ b/configure.ac Mon Jan 30 09:11:07 2012 +0000 @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_INIT([bookloupe],[1.50],[ali@juiblex.co.uk]) +AC_INIT([bookloupe],[1.51],[ali@juiblex.co.uk]) AC_PREREQ(2.59) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_SRCDIR([bookloupe/bookloupe.c]) diff -r 6a13fe0fc19e -r f28ad4577863 doc/loupe-test.txt --- a/doc/loupe-test.txt Mon Jan 30 00:36:31 2012 +0000 +++ b/doc/loupe-test.txt Mon Jan 30 09:11:07 2012 +0000 @@ -63,6 +63,86 @@ tag, then loupe-test will consider that no expectation exists and won't check the output at all. -There is no support yet for non-ASCII testcases, embedded linefeeds, -passing command line options to bookloupe or for testcases which are -expected to fail. +Non-ASCII testcases +------------------- + +The testcase definitions (the .tst files) are always written in UTF-8 +which is a superset of ASCII. Since gutcheck does not understand UTF-8 +this causes a problem when it is desired to include characters that +are not in ASCII in a testcase. To solve this problem it is possible +to specify an encoding to use for the test. It is very important to +undertand that this specifies the encoding that loupe-test will use to +talk to bookloupe/gutcheck and _not_ the encoding of the .tst file +(which remains UTF-8). gutcheck understands Latin-1 (at least to a +limited extent), the canonical name for which is ISO-8859-1: + + ┌─────────────────────────────────────────────────────────────────┐ + │**************** ENCODING **************** │ + │ISO-8859-1 │ + │**************** INPUT **************** │ + │"Hello," he said, "I wanted to bave a tête-à-tête with you." │ + │**************** EXPECTED **************** │ + │ │ + │"Hello," he said, "I wanted to bave a tête-à-tête with you." │ + │ Line 1 column 31 - Query word bave - not reporting duplicates│ + └─────────────────────────────────────────────────────────────────┘ + +Embedded linefeeds +------------------ + +One of the tests that bookloupe/gutcheck need to do is check that all +lines are ended with CR NL (as required by PG) rather than the UNIX +standard NL. loupe-test deliberately ignores the line endings in testcase +definition files and always uses CR NL. Thus there is needed a means +to embed a linefeed (aka newline) character into the input to be sent +to bookloupe/gutcheck to test that it correctly identified the problem. +loupe-test recognises the unicode symbol for linefeed (U+240A): ␊ which +can be used for this purpose instead of a normal newline. + +Passing command line options +---------------------------- + +Some of bookloupe's functionality is only available using command line +options. loupe-test provides a means of specifying these with the +OPTIONS tag: + + ┌──────────────────────────────────────────┐ + │**************** OPTIONS **************** │ + │-m │ + │-d │ + │**************** INPUT **************** │ + │“He went thataway!” │ + │**************** EXPECTED ****************│ + └──────────────────────────────────────────┘ + +Extra input files +----------------- + +Under certain circumstances, bookloupe reads other input files than just +the ebook. These can be specified in the testcase definition file by +adding the name of the file to the INPUT tag: + + ┌───────────────────────────────────────────────────────────────┐ + │**************** OPTIONS **************** │ + │-u │ + │**************** INPUT(gutcheck.typ) **************** │ + │arid │ + │**************** INPUT **************** │ + │I am the very model of a modern Major-General, │ + │I've information vegetable, animal, and mineral, │ + │I know the kings of England, arid I quote the fights historical│ + │From Marathon to Waterloo, in order categorical; │ + │I'm very well acquainted, too, with matters mathematical, │ + │I understand equations, both the simple and quadratical, │ + │About binomial theorem I'm teeming with a lot o' news-- │ + │With many cheerful facts about the square of the hypotenuse. │ + │**************** EXPECTED **************** │ + │ │ + │I know the kings of England, arid I quote the fights historical│ + │ Line 3 column 29 - Query possible scanno arid │ + └───────────────────────────────────────────────────────────────┘ + +Caveats +------- + +There is no support yet for testcases which are expected to fail.