$TestFileName

$TestFileName

gives the absolute file name of the currently executing test file.

Details

Examples

Basic Examples  (3)

During interactive input, $TestFileName is "":

In[1]:=
Click for copyable input
Out[1]=

This test file prints $TestFileName when it is executed:

In[1]:=
Click for copyable input

Execute the test file with TestReport:

In[2]:=
Click for copyable input
Out[2]=

After the TestReport is complete, $TestFileName is "" again:

In[3]:=
Click for copyable input
Out[3]=

Open an example test notebook:

In[1]:=
Click for copyable input
Out[1]=

Run the test report on the notebook:

In[2]:=
Click for copyable input
Out[2]=

Get the test that tests $TestFileName:

In[3]:=
Click for copyable input
Out[3]=

Show the input, expected output and actual output for the test result:

In[4]:=
Click for copyable input
Out[4]=
Introduced in 2019
(12.0)