Test suite¶
The Dragonfly library contains tests to verify its functioning and assure its quality. These tests come in two distinct types:
See the links below for tests of both types.
Tests in doctests format:
Tests based on the unittest framework reside in the dragonfly.test
package.
Running the test suite¶
This section contains instructions on how to run dragonfly’s test suite with the SR engine backends.
Most tests were written with an English model andvocabulary in mind, so they will not pass if English words are not in the SR engine’s vocabulary. The only exception to this is the text-input (“text”) backend.
Using DNS¶
Follow the following steps to run the test suite for the DNS backend:
Start DNS. (And ensure that NatLink is also automatically started.)
Extract the Dragonfly source code in a directory
<dir>
.Run the follow commands to install test requirements:
cd <dir> pip install -r test_requirements.txtRun the tests with the following command:
python setup.py test --test-suite=natlink
Different tests need to be run for different DNS versions. The natlink test suite will attempt to run the correct tests for the version of DNS you are using.
These tests may fail with certain DNS versions, models and/or vocabularies.
It is possible for the test suite to fail even though everything still
works in command modules loaded by natlinkmain
. This is a natlink issue.
It is not feasible to test dragonfly with all DNS configurations.
Please get in touch if the tests fail for you and specific dragonfly
functionality doesn’t work in natlink command modules (i.e. .py
files in
the MacroSystem
folder).
Using WSR¶
Follow the following steps to run the test suite for the WSR backend:
Start WSR.
Wake WSR up, so that it is not in sleeping state, and then turn the microphone off. (It is important to wake the microphone up first, because otherwise it’ll be off and sleeping at the same time. This causes all recognitions to fail. Weird, huh?)
Extract the Dragonfly source code in a directory
<dir>
.Run the follow commands to install test requirements:
cd <dir> pip install -r test_requirements.txtRun the tests with the following command:
python setup.py test --test-suite=sapi5
You can also run the test suite for the in process engine class. It has no GUI for the moment. Run the tests with the following command:
python setup.py test --test-suite=sapi5inproc
Some SAPI5 engine tests will fail intermittently, particularly with the
shared process engine class ("sapi5"
/ "sapi5shared"
). There is not
much we can do about this.
Using the Kaldi engine¶
Follow the following steps to run the test suite for the Kaldi backend:
Extract the Dragonfly source code in a directory
<dir>
.Follow the set up and install instructions for the Kaldi engine on this page.
Run the following commands to install the Kaldi engine and test dependencies:
cd <dir> pip install -e '.[kaldi]' pip install -r test_requirements.txtRun the tests with the following command:
python setup.py test --test-suite=kaldi
Using the CMU Pocket Sphinx engine¶
Follow the following steps to run the test suite for the Sphinx backend:
Extract the Dragonfly source code in a directory
<dir>
.Run the following commands to install the Sphinx engine and test dependencies:
cd <dir> pip install -e '.[sphinx]' pip install -r test_requirements.txtRun the tests with the following command:
python setup.py test --test-suite=sphinx
Using the text-input engine¶
Follow the following steps to run the test suite for the “text” backend:
Extract the Dragonfly source code in a directory
<dir>
.Run the follow commands to install test requirements:
cd <dir> pip install -r test_requirements.txtRun the tests with the following commands:
cd <dir> python setup.py test
This is the default test suite for dragonfly and has no additional
dependencies. The --test-suite
argument does not need to be specified
in this case.