Test the Demo Adaptor

Run Individual Tests

A collection of tests is available for testing functionality of the demo adaptor. These are all contained in the subfolders of matlabroot\toolbox\daq\daqsdk\tests\+daq\+sdk\+tests. Each test file name begins with the letter t and has the extension .m.

To get help and information on running an individual test, use the MATLAB® help command with the full package and test name. For example, to learn about the test defined in matlabroot\toolbox\daq\daqsdk\tests\+daq\+sdk\+tests\+workflow\tinputsinglescan.m, type:

help daq.sdk.tests.workflow.tinputsinglescan

As indicated in the display help, you can run this test with the following commands:

t = daq.sdk.tests.workflow.tinputsinglescan;
results = run(t);
Running daq.sdk.tests.workflow.tinputsinglescan
Done daq.sdk.tests.workflow.tinputsinglescan

                                   Name                                    Passed    Failed    Incomplete    Duration      Details   
    ___________________________________________________________________    ______    ______    __________    ________    ____________

    'daq.sdk.tests.workflow.tinputsinglescan/verifyInputSingleScan'        true      false     false         1.7093      [1×1 struct]
    'daq.sdk.tests.workflow.tinputsinglescan/verifyInputSingleScanLoop'    true      false     false         1.3631      [1×1 struct]


When modifying functionality in your custom adaptor, you should also modify the corresponding test. Be sure that the test runs as expected before moving on to your next modification.

Run a Test Suite

You can run all the tests in a package folder using the runtests function. For example, to run all the tests contained in daq\+sdk\+tests\+workflow, use the following commands:

results = runtests('daq.sdk.tests.workflow','Verbosity','Concise');
                                           Name                                           Passed    Failed    Incomplete    Duration      Details   
    __________________________________________________________________________________    ______    ______    __________    ________    ____________

    'daq.sdk.tests.workflow.tbackground/verifyAnalogInputSession'                         true      false     false           1.6622    [1×1 struct]
    'daq.sdk.tests.workflow.tbackground/verifyAnalogOutputSession'                        true      false     false         0.060079    [1×1 struct]
    'daq.sdk.tests.workflow.tbackground/verifyAnalogInputContinuous'                      true      false     false           5.0601    [1×1 struct]
    'daq.sdk.tests.workflow.tbackground/verifyAnalogOutputContinuous'                     true      false     false           5.1115    [1×1 struct]

To run a suite of tests that includes all subpackages of a specific package, use the 'IncludeSubpackages' option in the runtests function call. The following code runs all tests below the tests package:

results = runtests('daq.sdk.tests','IncludeSubpackages',true,'Verbosity','Concise');


Run your complete modified test suite when all your individual updates are implemented and built.

See Also


Related Topics