commit 4e9f69da92544c15f32f971793b9e35d86d1800f Author: Fabien Freling Date: Fri Feb 11 19:03:22 2022 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e929830 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.zip +packing diff --git a/README.md b/README.md new file mode 100644 index 0000000..94a84f0 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Netatmo technical test + +The subject is available here: [Test Algo](./test_algo.pdf) + +## Installation + +## Notes + +### Question 1 +### Question 2 +### Question 3 diff --git a/Tupfile.ini b/Tupfile.ini new file mode 100644 index 0000000..e69de29 diff --git a/justfile b/justfile new file mode 100644 index 0000000..02765a0 --- /dev/null +++ b/justfile @@ -0,0 +1,18 @@ +name := "freling_netatmo_algo" +exe := "./packing" +build_sh := "build.sh" + +build: + tup + +run: build + {{exe}} + +generate-build: + tup generate {{build_sh}} + +debug: build + lldb {{exe}} + +archive: generate-build + git archive --add-file={{build_sh}} --output={{name}}.zip --prefix={{name}}/ HEAD diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..7e20d6e --- /dev/null +++ b/shell.nix @@ -0,0 +1,10 @@ +{ pkgs ? import {} }: + +pkgs.mkShell { + buildInputs = with pkgs; [ + clang + just + tup + valgrind + ]; +} diff --git a/src/.clang-format b/src/.clang-format new file mode 100644 index 0000000..129aca1 --- /dev/null +++ b/src/.clang-format @@ -0,0 +1,3 @@ +--- +BasedOnStyle: Chromium +IndentWidth: 4 diff --git a/src/Tupfile b/src/Tupfile new file mode 100644 index 0000000..c9d07f1 --- /dev/null +++ b/src/Tupfile @@ -0,0 +1,9 @@ +CPPFLAGS_ = -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 +CPPFLAGS_ASAN = $(CPPFLAGS_) -fsanitize=address -fno-omit-frame-pointer +CPPFLAGS_THREAD = $(CPPFLAGS_) -fsanitize=thread +CPPFLAGS_MEM = $(CPPFLAGS_) -fsanitize=memory -fno-omit-frame-pointer +CPPFLAGS_UB = $(CPPFLAGS_) -fsanitize=undefined +CPPFLAGS = $(CPPFLAGS_) + +: foreach *.cpp |> clang++ -c %f -o %o $(CPPFLAGS) |> %B.o {objs} +: {objs} |> clang++ %f -o %o $(CPPFLAGS) -lpthread |> ../packing diff --git a/test_algo.pdf b/test_algo.pdf new file mode 100644 index 0000000..6359b41 Binary files /dev/null and b/test_algo.pdf differ