NAME

Audio::MPD::Test - automate launching of fake mdp for testing purposes

SYNOPSIS

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

DESCRIPTION

General usage

This module will try to launch a new mpd server for testing purposes. This mpd server will then be used during 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 - and yes, we can redistribute them since it's only some random voice recordings :-)

Advanced usage

In case you want more control on the test mpd server, you can use the following public methods:

start_test_mpd()

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

stop_test_mpd()

Kill the fake mpd.

This might be useful when trying to test connections with mpd server.

COPYRIGHT AND LICENSE

Copyright (c) 2007 Jerome Quelin

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.