5

I'm mainly a Windows guy, programming C#, but I often do use technologies that were intended for Linux machines like git, MySQL, perl scripts, memcached, php, etc... And therefore I am exposed to these tools.

I like looking at the code base of these tools every once in a while, and something I realized in many code bases is a folder called t with a bunch of files with the t extension.

What are these files?

How come the folder doesn't have a more descriptive name?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
gillyb
  • 153
  • 4

2 Answers2

1

From my experience, the t/ directory usually include automated tests.

Quoting from the Git t/README file

Core GIT Tests

This directory holds many test scripts for core GIT tools.

gertvdijk
  • 13,459
  • 7
  • 45
  • 59
1

What are these files?

The $PROJECT/t directory is the canonical place for a project to keep its automated unit tests.

How come the folder doesn't have a more descriptive name?

By adhering to what is basically a standard naming convention, it is perfectly descriptive of what files go into this directory.

Other programmers will expect to find a /t subdirectory containing unit tests. It would be confusing if they decided to call it something different.

I am not sure why this is a standard, but presumably it is because /t would not likely be used as a name for some other component of a project (whereas /test could feasibly refer to something different than unit tests in the context of a given project).

It is also faster to type ./t/check_something.

Charles Boyd
  • 527
  • 2
  • 8
  • 1
    Thanks. I think the problem is that we [programmers] got used to bad IDE's for too long. With nowadays' IDE's and technologies like Intellisense (Microsoft's term - don't know what it's called in other IDE's) there's no need for being cheap with naming. Not in code and not in the structure tree... :) – gillyb Dec 05 '12 at 10:26