Blame INSTALL.md

Packit 209faa
Installation instructions
Packit 209faa
=========================
Packit 209faa
Packit 209faa
Kyua uses the GNU Automake, GNU Autoconf and GNU Libtool utilities as
Packit 209faa
its build system.  These are used only when compiling the application
Packit 209faa
from the source code package.  If you want to install Kyua from a binary
Packit 209faa
package, you do not need to read this document.
Packit 209faa
Packit 209faa
For the impatient:
Packit 209faa
Packit 209faa
    $ ./configure
Packit 209faa
    $ make
Packit 209faa
    $ make check
Packit 209faa
    Gain root privileges
Packit 209faa
    # make install
Packit 209faa
    Drop root privileges
Packit 209faa
    $ make installcheck
Packit 209faa
Packit 209faa
Or alternatively, install as a regular user into your home directory:
Packit 209faa
Packit 209faa
    $ ./configure --prefix ~/local
Packit 209faa
    $ make
Packit 209faa
    $ make check
Packit 209faa
    $ make install
Packit 209faa
    $ make installcheck
Packit 209faa
Packit 209faa
Packit 209faa
Dependencies
Packit 209faa
------------
Packit 209faa
Packit 209faa
To build and use Kyua successfully you need:
Packit 209faa
Packit 209faa
* A standards-compliant C and C++ complier.
Packit 209faa
* Lutok 0.4.
Packit 209faa
* pkg-config.
Packit 209faa
* SQLite 3.6.22.
Packit 209faa
Packit 209faa
To build the Kyua tests, you optionally need:
Packit 209faa
Packit 209faa
* The Automated Testing Framework (ATF), version 0.15 or greater.  This
Packit 209faa
  is required if you want to create a distribution file.
Packit 209faa
Packit 209faa
If you are building Kyua from the code on the repository, you will also
Packit 209faa
need the following tools:
Packit 209faa
Packit 209faa
* GNU Autoconf.
Packit 209faa
* GNU Automake.
Packit 209faa
* GNU Libtool.
Packit 209faa
Packit 209faa
Packit 209faa
Regenerating the build system
Packit 209faa
-----------------------------
Packit 209faa
Packit 209faa
This is not necessary if you are building from a formal release
Packit 209faa
distribution file.
Packit 209faa
Packit 209faa
On the other hand, if you are building Kyua from code extracted from the
Packit 209faa
repository, you must first regenerate the files used by the build
Packit 209faa
system.  You will also need to do this if you modify `configure.ac`,
Packit 209faa
`Makefile.am` or any of the other build system files.  To do this, simply
Packit 209faa
run:
Packit 209faa
Packit 209faa
    $ autoreconf -i -s
Packit 209faa
Packit 209faa
If ATF is installed in a different prefix than Autoconf, you will also
Packit 209faa
need to tell autoreconf where the ATF M4 macros are located.  Otherwise,
Packit 209faa
the configure script will be incomplete and will show confusing syntax
Packit 209faa
errors mentioning, for example, `ATF_CHECK_SH`.  To fix this, you have
Packit 209faa
to run autoreconf in the following manner, replacing `<atf-prefix>` with
Packit 209faa
the appropriate path:
Packit 209faa
Packit 209faa
    $ autoreconf -i -s -I <atf-prefix>/share/aclocal
Packit 209faa
Packit 209faa
Packit 209faa
General build procedure
Packit 209faa
-----------------------
Packit 209faa
Packit 209faa
To build and install the source package, you must follow these steps:
Packit 209faa
Packit 209faa
1. Configure the sources to adapt to your operating system.  This is
Packit 209faa
   done using the `configure` script located on the sources' top
Packit 209faa
   directory, and it is usually invoked without arguments unless you
Packit 209faa
   want to change the installation prefix.  More details on this
Packit 209faa
   procedure are given on a later section.
Packit 209faa
Packit 209faa
2. Build the sources to generate the binaries and scripts.  Simply run
Packit 209faa
   `make` on the sources' top directory after configuring them.  No
Packit 209faa
   problems should arise.
Packit 209faa
Packit 209faa
3. Check that the built programs work by running `make check`.  You do
Packit 209faa
   not need to be root to do this, but if you are not, some checks will
Packit 209faa
   be skipped.
Packit 209faa
Packit 209faa
4. Install the program by running `make install`.  You may need to
Packit 209faa
   become root to issue this step.
Packit 209faa
Packit 209faa
5. Issue any manual installation steps that may be required.  These are
Packit 209faa
   described later in their own section.
Packit 209faa
Packit 209faa
6. Check that the installed programs work by running `make
Packit 209faa
   installcheck`.  You do not need to be root to do this, but if you are
Packit 209faa
   not, some checks will be skipped.
Packit 209faa
Packit 209faa
Packit 209faa
Configuration flags
Packit 209faa
-------------------
Packit 209faa
Packit 209faa
The most common, standard flags given to `configure` are:
Packit 209faa
Packit 209faa
* `--prefix=directory`:
Packit 209faa
  **Possible values:** Any path.
Packit 209faa
  **Default:** `/usr/local`.
Packit 209faa
Packit 209faa
  Specifies where the program (binaries and all associated files) will
Packit 209faa
  be installed.
Packit 209faa
Packit 209faa
* `--sysconfdir=directory`:
Packit 209faa
  **Possible values:** Any path.
Packit 209faa
  **Default:** `/usr/local/etc`.
Packit 209faa
Packit 209faa
  Specifies where the installed programs will look for configuration
Packit 209faa
  files.  `/kyua` will be appended to the given path unless
Packit 209faa
  `KYUA_CONFSUBDIR` is redefined as explained later on.
Packit 209faa
Packit 209faa
* `--help`:
Packit 209faa
Packit 209faa
  Shows information about all available flags and exits immediately,
Packit 209faa
  without running any configuration tasks.
Packit 209faa
Packit 209faa
The following environment variables are specific to Kyua's `configure`
Packit 209faa
script:
Packit 209faa
Packit 209faa
* `GDB`:
Packit 209faa
  **Possible values:** empty, absolute path to GNU GDB.
Packit 209faa
  **Default:** empty.
Packit 209faa
Packit 209faa
  Specifies the path to the GNU GDB binary that Kyua will use to gather a
Packit 209faa
  stack trace of a crashing test program.  If empty, the configure script
Packit 209faa
  will try to find a suitable binary for you and, if not found, Kyua will
Packit 209faa
  attempt to do the search at run time.
Packit 209faa
Packit 209faa
* `KYUA_ARCHITECTURE`:
Packit 209faa
  **Possible values:** name of a CPU architecture (e.g. `x86_64`, `powerpc`).
Packit 209faa
  **Default:** autodetected; typically the output of `uname -p`.
Packit 209faa
Packit 209faa
  Specifies the name of the CPU architecture on which Kyua will run.
Packit 209faa
  This value is used at run-time to determine tests that are not
Packit 209faa
  applicable to the host system.
Packit 209faa
Packit 209faa
* `KYUA_CONFSUBDIR`:
Packit 209faa
  **Possible values:** empty, a relative path.
Packit 209faa
  **Default:** `kyua`.
Packit 209faa
Packit 209faa
  Specifies the subdirectory of the configuration directory (given by
Packit 209faa
  the `--sysconfdir` argument) under which Kyua will search for its
Packit 209faa
  configuration files.
Packit 209faa
Packit 209faa
* `KYUA_CONFIG_FILE_FOR_CHECK`:
Packit 209faa
  **Possible values:** none, an absolute path to an existing file.
Packit 209faa
  **Default:** none.
Packit 209faa
Packit 209faa
  Specifies the `kyua.conf` configuration file to use when running any
Packit 209faa
  of the `check`, `installcheck` or `distcheck` targets on this source
Packit 209faa
  tree.  This setting is exclusively used to customize the test runs of
Packit 209faa
  Kyua itself and has no effect whatsoever on the built product.
Packit 209faa
Packit 209faa
* `KYUA_MACHINE`:
Packit 209faa
  **Possible values:** name of a machine type (e.g. `amd64`, `macppc`).
Packit 209faa
  **Default:** autodetected; typically the output of `uname -m`.
Packit 209faa
Packit 209faa
  Specifies the name of the machine type on which Kyua will run.  This
Packit 209faa
  value is used at run-time to determine tests that are not applicable
Packit 209faa
  to the host system.
Packit 209faa
Packit 209faa
* `KYUA_TMPDIR`:
Packit 209faa
  **Possible values:** an absolute path to a temporary directory.
Packit 209faa
  **Default:** `/tmp`.
Packit 209faa
Packit 209faa
  Specifies the path that Kyua will use to create temporary directories
Packit 209faa
  in by default.
Packit 209faa
Packit 209faa
The following flags are specific to Kyua's `configure` script:
Packit 209faa
Packit 209faa
* `--enable-developer`:
Packit 209faa
  **Possible values:** `yes`, `no`.
Packit 209faa
  **Default:** `yes` in Git `HEAD` builds; `no` in formal releases.
Packit 209faa
Packit 209faa
  Enables several features useful for development, such as the inclusion
Packit 209faa
  of debugging symbols in all objects or the enforcement of compilation
Packit 209faa
  warnings.
Packit 209faa
Packit 209faa
  The compiler will be executed with an exhaustive collection of warning
Packit 209faa
  detection features regardless of the value of this flag.  However, such
Packit 209faa
  warnings are only fatal when `--enable-developer` is `yes`.
Packit 209faa
Packit 209faa
* `--with-atf`:
Packit 209faa
  **Possible values:** `yes`, `no`, `auto`.
Packit 209faa
  **Default:** `auto`.
Packit 209faa
Packit 209faa
  Enables usage of ATF to build (and later install) the tests.
Packit 209faa
Packit 209faa
  Setting this to `yes` causes the configure script to look for ATF
Packit 209faa
  unconditionally and abort if not found.  Setting this to `auto` lets
Packit 209faa
  configure perform the best decision based on availability of ATF.
Packit 209faa
  Setting this to `no` explicitly disables ATF usage.
Packit 209faa
Packit 209faa
  When support for tests is enabled, the build process will generate the
Packit 209faa
  test programs and will later install them into the tests tree.
Packit 209faa
  Running `make check` or `make installcheck` from within the source
Packit 209faa
  directory will cause these tests to be run with Kyua.
Packit 209faa
Packit 209faa
* `--with-doxygen`:
Packit 209faa
  **Possible values:** `yes`, `no`, `auto` or a path.
Packit 209faa
  **Default:** `auto`.
Packit 209faa
Packit 209faa
  Enables usage of Doxygen to generate documentation for internal APIs.
Packit 209faa
  This documentation is *not* installed and is only provided to help the
Packit 209faa
  developer of this package.  Therefore, enabling or disabling Doxygen
Packit 209faa
  causes absolutely no differences on the files installed by this
Packit 209faa
  package.
Packit 209faa
Packit 209faa
  Setting this to `yes` causes the configure script to look for Doxygen
Packit 209faa
  unconditionally and abort if not found.  Setting this to `auto` lets
Packit 209faa
  configure perform the best decision based on availability of Doxygen.
Packit 209faa
  Setting this to `no` explicitly disables Doxygen usage.  And, lastly,
Packit 209faa
  setting this to a path forces configure to use a specific Doxygen
Packit 209faa
  binary, which must exist.
Packit 209faa
Packit 209faa
Packit 209faa
Post-installation steps
Packit 209faa
-----------------------
Packit 209faa
Packit 209faa
Copy the `Kyuafile.top` file installed in the examples directory to the
Packit 209faa
root of your tests hierarchy and name it `Kyuafile`.  For example:
Packit 209faa
Packit 209faa
    # cp /usr/local/share/kyua/examples/Kyuafile.top \
Packit 209faa
         /usr/local/tests/Kyuafile
Packit 209faa
Packit 209faa
This will allow you to simply go into `/usr/tests` and run the tests
Packit 209faa
from there.
Packit 209faa
Packit 209faa
Packit 209faa
Run the tests!
Packit 209faa
--------------
Packit 209faa
Packit 209faa
Lastly, after a successful installation, you should periodically run the
Packit 209faa
tests from the final location to ensure things remain stable.  Do so as
Packit 209faa
follows:
Packit 209faa
Packit 209faa
    $ cd /usr/local/kyua && kyua test
Packit 209faa
Packit 209faa
The following configuration variables are specific to the 'kyua' test
Packit 209faa
suite and can be given to Kyua with arguments of the form
Packit 209faa
`-v test_suites.kyua.<variable_name>=<value>`:
Packit 209faa
Packit 209faa
* `run_coredump_tests`:
Packit 209faa
  **Possible values:** `true` or `false`.
Packit 209faa
  **Default:** `true`.
Packit 209faa
Packit 209faa
  Avoids running tests that crash subprocesses on purpose to make them
Packit 209faa
  dump core.  Such tests are particularly slow on macOS, and it is
Packit 209faa
  sometimes handy to disable them for quicker development iteration.
Packit 209faa
Packit 209faa
If you see any tests fail, do not hesitate to report them in:
Packit 209faa
Packit 209faa
    https://github.com/jmmv/kyua/issues/
Packit 209faa
Packit 209faa
Thank you!