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?

2 Answers 2

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.

1
  • 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... :) Commented Dec 5, 2012 at 10:26
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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.