PacletAssurance`
PacletAssurance`

TestFiles

TestFiles[symbol]

searches for test files associated with symbol.

TestFiles["symbol"]

searches for test files associated with the symbol named "symbol".

TestFiles[PacletObject[]]

searches for test files in the root directory associated with the specified paclet object.

TestFiles[{root,dir1,dir2,}]

searches for test files in the directory specified by root and subdirectories diri.

TestFiles[rootspec,lev]

searches for test files in the directories specified by rootspec and subdirectories down to level lev.

Details and Options

  • TestFiles returns a list of absolute filenames.
  • TestSummary and TestReport are typically applied to the list of test files returned by TestFiles.
  • TestFiles["symbol"] is equivalent to TestFiles[{PacletObject[], "symbol"}] where the paclet specifies the symbol's context and the root of the returned filename.
  • In TestFiles[{PacletObject[],"symbol"}] the implicit root associated with the paclet object is, by default, a TestFiles directory itself defined in PacletInfo.wl by including, in the Extensions key, the entry {"TestFiles", "Root""TestFiles"}.
  • TestFiles[PacletObject[]] is equivalent to TestFiles[PacletObject[], Infinity] and lists all test files in all sub-directories of the paclet's TestFiles directory.
  • The level specification lev takes the same form as that used in FileSystemMap, FileNames etc.
  • Whether test files with extensions .wlt or .nb or both are searched for is specified by the "TestFileExtension" option.
  • TestFiles[{"symbol","dir1",}] is equivalent to TestFiles["symbol/dir1/"].
  • TestFiles[{object, "dir1", }] is equivalent to TestFiles[{object, "dir1/"}].
  • The list of all implicit TestFiles directories defined by all paclets is returned by PacletManager`PacletResources["TestFiles"]
  • The following options can be given:
  • "TestFileExtension"Automaticspecifies the test file extension to search for
    "ExcludedTestFiles""FileSystemModify*"matched names of excluded test files
  • Possible settings for "TestFileExtension" include:
  • ".wlt"search only for test files with extension .wlt
    ".nb"search only for test files with extension .nb
    Allsearch for test files with extension .wlt or .nb
    Automaticequivalent to the setting ".wlt"
  • Possible settings for "ExcludedTestFiles" include a string pattern, list of string patterns or None.

Examples

Basic Examples  (1)

Find the main test files associated with TestFiles.

Generate an overall summary for all core unit tests for the TestFiles function.

Find the core test files of TestSummary.

Create a summary of the core test files of TestSummary

Find all the test files associated with TestSummary

Create summaries of all of TestSummary's tests broken down by what files they are stored in.

Create a summary of all of TestSummary's tests.

This summary includes all tests that performed exclusively in memory. Set the "ExcludeTestFiles"->None in order to see all available tests including those that modify files on the filesystem.

Tech Notes
  • Testing that Scales
  • Paclet Workflow
  • Using the Testing Framework