$TestFileName
✖
$TestFileName
Details

- During the execution of TestReport[file], $TestFileName is set to the absolute file name of file.
- During interactive input, $TestFileName is "".
Examples
Basic Examples (3)Summary of the most common use cases
During interactive input, $TestFileName is "":

https://wolfram.com/xid/0bh2xx9glep752-jrcpoa

This test file prints $TestFileName when it is executed:

https://wolfram.com/xid/0bh2xx9glep752-pre11o
Execute the test file with TestReport:

https://wolfram.com/xid/0bh2xx9glep752-bxmo1l

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

https://wolfram.com/xid/0bh2xx9glep752-gyqgve

Open an example test notebook:

https://wolfram.com/xid/0bh2xx9glep752-bebmdd

Run the test report on the notebook:

https://wolfram.com/xid/0bh2xx9glep752-dqnw5g

Get the test that tests $TestFileName:

https://wolfram.com/xid/0bh2xx9glep752-fzd6wc

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

https://wolfram.com/xid/0bh2xx9glep752-evnbxp

Wolfram Research (2019), $TestFileName, Wolfram Language function, https://reference.wolfram.com/language/ref/$TestFileName.html.
Text
Wolfram Research (2019), $TestFileName, Wolfram Language function, https://reference.wolfram.com/language/ref/$TestFileName.html.
Wolfram Research (2019), $TestFileName, Wolfram Language function, https://reference.wolfram.com/language/ref/$TestFileName.html.
CMS
Wolfram Language. 2019. "$TestFileName." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$TestFileName.html.
Wolfram Language. 2019. "$TestFileName." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$TestFileName.html.
APA
Wolfram Language. (2019). $TestFileName. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$TestFileName.html
Wolfram Language. (2019). $TestFileName. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$TestFileName.html
BibTeX
@misc{reference.wolfram_2025_$testfilename, author="Wolfram Research", title="{$TestFileName}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/$TestFileName.html}", note=[Accessed: 21-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_$testfilename, organization={Wolfram Research}, title={$TestFileName}, year={2019}, url={https://reference.wolfram.com/language/ref/$TestFileName.html}, note=[Accessed: 21-June-2025
]}