Coder Social home page Coder Social logo

xtofl / cpp11training Goto Github PK

View Code? Open in Web Editor NEW
26.0 6.0 15.0 9.24 MB

Make unit tests run to exercise your C++11 knowledge

CMake 1.47% C++ 90.38% C 0.83% Makefile 1.23% CSS 1.88% Shell 0.94% Python 2.99% Dockerfile 0.14% Batchfile 0.13%
training-materials cplusplus cplusplus-11 cplusplus-14 gtest

cpp11training's Introduction

cpp 11 training

Exercises to train your C++11/14/17 (and then some).

Build Status Build status Codacy Badge

Getting started

Linux

On Linux all you need is a compiler with C++17 support; gcc-7 and gcc-8 have it.

git clone [email protected]:xtofl/cpp11training
mkdir -p cpp11training/build
cd cpp11training/build
cmake ../src
make

Windows

Prerequisite: currently I have it up and running for Visual Studio 2017 Community edition. It relies on NuGet package manager, which should be installed explicitly (cf. stackoverflow)

Open the cpp11training/cpp11training.sln solution.

Docker host

If you don't want to litter your system with tools you don't trust, but you do trust Docker, you can build and run the docker container in docker. You may even be in luck and simply docker pull xtofl/cpp11training.

Then, clone the repository, and start a cpp11training container. Now you can follow the steps like in Linux.

(windows users may be happy to find a run_container.bat script to help)

Exercising

The project contains a bunch of failing unit tests. The idea is that you un-DISABLE each one of them, and make it pass (using C++11, obviously). (the gtest library by default ignores tests starting with DISABLED_.)

I tried to add a TODO: comment hinting what's expected from you to fulfill the exercise.

Once all tests pass, I have nothing more to teach you :)

cpp11training's People

Contributors

eliasvan avatar wvdschel avatar xtofl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cpp11training's Issues

Visual studio specifics should be generated by CMake

The current sources can be built with cmake. There is also a visual studio project and solution. However, the latter are maintenance heavy.

They should be replaced by a cmake generated solution.

Remove the .sln and .vcxproj files, and extend the instructions with cmake -> VS support.

Folder structure is confusing

When using the exercises, users end up with a directory structure like /home/x/cpp11training/cpp11training/cpp11training, which is absolutely confusing.

You should have just /home/x/cpp11training/ after the clone, and the exercises should be in the src subdir.

async exercises are tightly coupled

while going through the async exercises, solving subsequent exercises will break the previous ones. Rather decouple them: a simple technique would be to stow them in separate files.

Part of move-exercise is optimized-away

The exercise called 'speed_this_up_by_adding_move_support' has a duration call for a lambda that seems to be compiled away in release builds.

The expectation

    EXPECT_LT(consuming_objects, constructing_objects * 1.1)
        << "consuming: " << consuming_objects
        << " vs. constructing: " << constructing_objects

becomes impossible to meet (consuming: ~1500ms vs. constructing: ~13ms)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.