Unit tests for this project are managed by the googletest library which distributed under the BSD 3-Clause licence.
- Make sure that in the
lib/
directory thegoogletest
dependency is present. It should be downloaded as git submodule. If you've already cloned this repo simply run:
$ git submodule update --init --recursive
Alternatively, you can download all submodules during clone:
$ git clone --recursive git://github.com/pniewiejski/luhnjs.git
- Run the following commands:
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles"
$ make all
This should create build/bin
with executable luhncpp_test
.
- Execute
luhncpp_test
to run unit tests.
$ cd bin
$ ./luhncpp_test
Code formatting was done using clang-format
. I've created a simple bash script
(format-code.sh
) that runs the clang-format
command. clang-format
config
was generated using:
$ clang-format -style=google -dump-config > .clang-format
With time some exclusions were made. Please see #9 for more details.