Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions 1_C++/suffix_count/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

CC = g++
CFLAGS = -std=c++14 -Werror -Wuninitialized -g

run: test
./test

test: catch_amalgamated.o src/*.h test-unit/test.cpp
$(CC) $(CFLAGS) -o test test-unit/test.cpp catch_amalgamated.o

catch_amalgamated.o: test-unit/catch/catch_amalgamated.cpp test-unit/catch/catch_amalgamated.hpp
$(CC) $(CFLAGS) -c -o catch_amalgamated.o test-unit/catch/catch_amalgamated.cpp

clean:
rm -f test catch_amalgamated.o
23 changes: 20 additions & 3 deletions 1_C++/suffix_count/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,26 @@ et tu, brute

## Unit test instructions

To run **unit tests**, open terminal and go to the `suffix_count` directory. At this directory, run the following command:
To run **unit tests**, open terminal and go to the `suffix_count` directory.

`g++ -std=c++14 -Werror -Wuninitialized -o test test-unit/test.cpp && ./test`
### With Make

This will show you which tests you pass. We encourage you to build your own tests.
If you have make installed, run this command:

`make`

If you installed gcc via the msys2 ucrt64 toolchain, you may need to run this command instead:

`mingw32-make`

### Without Make

If you do not have make, run this command once to build catch:

`g++ -std=c++14 -Werror -Wuninitialized -g -c test-unit/catch/catch_amalgamated.cpp -o catch_amalgamated.o`

Run this command to compile and run the tests (you do not need to run the previous command again):

`g++ -std=c++14 -Werror -Wuninitialized -g catch_amalgamated.o test-unit/test.cpp -o test; ./test`

This will show you which tests you pass. We encourage you to build your own tests.
Loading