Current project includes shared library, unit tests based on "Catch" framework and main program for working with the input text file. Library supports 2 modes:
-
Finding the occurrences of the necessary word.
-
Calculation of the 32bit checksum based on algorithm: checksum = word1 + word2 + ... + wordN.
Framework for unit tests [Catch] (https://github.com/catchorg/Catch2)
Library includes classes for input parameters processing, input file processing and data processing.
/include/dataprocessor.h
/include/fileprocessor.h
/include/inputparameters.h
/src/dataprocessor.cpp
/src/fileprocessor.cpp
/src/inputparameters.cpp
Unit tests include "catch.hpp" header file and "catch_tests.cpp" source file
/libs/catch.hpp
/test/catch_tests.cpp
Main program includes "TextFileProcessor.cpp" source file
/program/TextFileProcessor.cpp
To build the project you should use cmake 3.16+ and GCC 6+.
You can build a separate shared library or you can build tests or main program which will use pre-built library.
To build the library only please run "cmake ~pwd" from "FileProcessor/src" folder. To build the tests + library please run "cmake ~pwd" from "FileProcessor/test" folder. To build the main program + library please run "cmake ~pwd" from "FileProcessor/program" folder.
To run the tests please run executable file "catch_tests".
Note: For correct calculation of the checksum on Linux, please use correct end of lines.