- This repo is a based on Jwasham's Coding Interview University
- I implement everything in C, C++ and C++ with builtin-types
- I've removed all the non-free links or those that I consider of little value
Note: Those are only required to run my code, not to do the course
- clone the repo
sudo git clone https://github.com/google/googletest.git /opt/gtest
- go into
/opt/gtest/googletest/make
cd /opt/gtest/googletest/make
- test the Makefile
sudo make
sudo chmod +x sample1_unittest
./sample1_unittest
- Gtest output should appear with tests passing, if so: you're all set!
- copy Makefile to a new project
- change locating variables, mine are:
GTEST_DIR = /opt/gtest/googletest
USER_DIR = .
- test copied Makefile again with sample self-written test, example:
#include "gtest/gtest.h"
TEST(Confirming_setup_ok, dummy)
{
// this should pass
}
TEST(Confirming_setup_ok, this_passes)
{
EXPECT_EQ(2 + 2, 4);
}
TEST(Confirming_setup_ok, this_fails)
{
EXPECT_TRUE(false);
}
- incorporate [and refactor!] that Makefile into your flow
sudo apt install valgrind
- See Jwasham's repo for great non-technical content related to this course
- Fork this repo
- Clone the repo
- Undo all checks
- Code
- Code unit fingers burn and your veins pump raw binary
- Then code some more
Code -> ./code
Chapter -> eg. data_structures
Case -> inside a chapter -> eg. arrays
Go inside course directory
cd code
Go inside chapter folder / create one
cd [chapter_name_underscores_plural_lowercase] / mkdir [chapter_name_underscores_plural_lowercase]
Trigger script with assignment name
../../new_case.py [assignment_name_underscores_singular_lowercase]