<commit_before>.. _unit-test-instructions:

***************************************
Detailed Notes on How to Run Unit Tests
***************************************

Finding a Specific Unit Test
============================

::

   cd path/to/your/drake-distro/drake/pod-build
   ctest -N

This will list all the available tests. You can pipe the output of the `ctest -N` command to `grep` if you have a clue about the unit test's name, which you can determine by looking at the `CMakeLists.txt` that included the unit test.

Running a Specific Test
=======================

Once you know the unit tests' name, you can run it by issuing a::

  ctest -VV -R name_of_the_test_as_output_from_ctest-N

where `name_of_the_test_as_output_from_ctest-N` is the name of the test exactly as printed out by `ctest -N` including, if any, the entire path to the test as printed out to the screen. 


Example: Find and run unit test named `cascade_system`
======================================================

Find test::

  cd path/to/your/drake-distro/drake/pod-build
  ctest -N | grep -i cascade

Run the test::

  ctest -VV -R cascade_system_test

<commit_msg>Added clarification on that the pod-build directory is for Mac and Linux only<commit_after>.. _unit-test-instructions:

***************************************
Detailed Notes on How to Run Unit Tests
***************************************

Finding a Specific Unit Test
============================

On Linux and Mac you first need to move to the default build directory and then find your unit test with `ctest -N` as so:

::

   cd path/to/your/drake-distro/drake/pod-build
   ctest -N

This will list all the available tests. You can pipe the output of the `ctest -N` command to `grep` if you have a clue about the unit test's name, which you can determine by looking at the `CMakeLists.txt` that included the unit test.

Running a Specific Test
=======================

Once you know the unit tests' name, you can run it by issuing a::

  ctest -VV -R name_of_the_test_as_output_from_ctest-N

where `name_of_the_test_as_output_from_ctest-N` is the name of the test exactly as printed out by `ctest -N` including, if any, the entire path to the test as printed out to the screen. 


Example: Find and run unit test named `cascade_system`
======================================================

Find test::

  cd path/to/your/drake-distro/drake/pod-build
  ctest -N | grep -i cascade

Run the test::

  ctest -VV -R cascade_system_test


{'fraction_non_alphanumeric': 0.20120481927710843, 'fraction_numerical': 0.0, 'mean_word_length': 4.427015250544662, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3616145', 'n_tokens_mistral': 748, 'n_tokens_neox': 697, 'n_words': 313}