Starting a project using TDD
Now that we’ve determined that a logging library is a good idea and is justified, it’s time to start a new project. Let’s start with the log
function from the previous section and create a new project. The log
function looks like this:
void log (std::string_view message)
{
std::fstream logFile("application.log", std::ios::app);
logFile << message << std::endl;
}
Where will we put this log
function, and what will the test project structure look like? In the earlier chapters, we tested the unit test library. This is the first time we’ll be using the unit test library as something outside the actual project we’re working on. The project structure will look like this:
MereMemo project root folder
MereTDD folder
Test.h
MereMemo folder
...