Test::Corpus::Audio::MPD(3pm)

Test::Corpus::Audio::MPD3pm

Automate launching of fake mdp for testing purposes

Usage

    use Test::Corpus::Audio::MPD; # die if error
    [...]
    stop_test_mpd();

Version

version 1.120990

Overview

This module will try to launch a new mpd server for testing purposes. This mpd server will then be used during POE::Component::Client::MPD or Audio::MPD tests.

In order to achieve this, the module will create a fake mpd.conf file with the correct pathes (ie, where you untarred the module tarball). It will then check if some mpd server is already running, and stop it if the "MPD_TEST_OVERRIDE" environment variable is true (die otherwise). Last it will run the test mpd with its newly created configuration file.

Everything described above is done automatically when the module is "use"-d.

Once the tests are run, the mpd server will be shut down, and the original one will be relaunched (if there was one).

Note that the test mpd will listen to "localhost", so you are on the safe side. Note also that the test suite comes with its own ogg files. Those files are 2 seconds tracks recording my voice saying ok, and are freely redistributable under the same license as the code itself.

In case you want more control on the test mpd server, you can use the supplied public methods. This might be useful when trying to test connections with mpd server.

Methods

customize_test_mpd_configuration( [$port] );

Create a fake mpd configuration file, based on the file mpd.conf.template located in share subdir. The string PWD will be replaced by the real path (ie, where the tarball has been untarred), while TMP will be replaced by a new temp directory. The string PORT will be replaced by $port if specified, 6600 otherwise (MPD's default).

my $dir = playlist_dir();

Return the temp dir where the test playlists will be stored.

start_test_mpd();

Start the fake mpd, and die if there were any error.

stop_test_mpd();

Kill the fake mpd.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 3 times.

  1. 6.0
  2. 7–8
  3. 9–10
  4. 11–13

Author

Jerome Quelin

From libtest-corpus-audio-mpd-perl 1.120990-2.1 in Debian 13 (Trixie). Parsed by carta from the page's man source.