diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index b164dc9795c3a98ba36b7f1bf4f4976d4bc8a14d..4faaef076b7ad97949078c919b09dd19338d6a8c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -19,54 +19,93 @@ jobs:
         include:
           - name: Linux GCC
             os: ubuntu-latest
-            compiler: g++-9
-            test: true
+            compiler: gcc
+            gcov_executable: gcov
 
           - name: Linux Clang
             os: ubuntu-latest
-            compiler: clang++
-            test: true
+            compiler: llvm
+            gcov_executable: "llvm-cov gcov"
 
           - name: MacOS clang
             os: macos-latest
-            compiler: clang++
-            test: true
+            compiler: llvm
+            gcov_executable: "llvm-cov gcov"
 
           - name: Windows MSVC
             os: windows-latest
             compiler: cl
-            test: false
 
     runs-on: ${{ matrix.os }}
     steps:
       - name: "Checkout repository"
         uses: actions/checkout@v2
 
-      - name: "Enable MSVC command prompt"
-        if: matrix.os == 'windows-latest'
-        uses: ilammy/msvc-dev-cmd@v1
-
-      - name: "Install cmake"
-        uses: lukka/get-cmake@latest
-
-      - name: "Build debug mode"
+      - name: "Setup Cpp"
+        uses: aminya/setup-cpp@v1
+        with:
+          compiler: ${{ matrix.compiler }}
+          vcvarsall: ${{ contains(matrix.os, 'windows' )}}
+          cmake: true
+          ninja: true
+          clangtidy: true
+          cppcheck: false
+          gcovr: true
+          opencppcoverage: true
+
+      # make sure coverage is only enabled for Debug builds, since it sets -O0
+      # to make sure coverage has meaningful results
+      - name: "Configure CMake"
         run: >
-          mkdir build;
-          cd build;
-          cmake ..
-          -DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
-          -DFTXUI_BUILD_DOCS=OFF
-          -DFTXUI_BUILD_EXAMPLES=ON
-          -DFTXUI_BUILD_TESTS=ON
-          -DFTXUI_BUILD_TESTS_FUZZER=OFF
-          -DFTXUI_ENABLE_INSTALL=ON ;
-          cmake --build . --config Debug;
+          cmake -S .
+          -B ./build
+          -DCMAKE_BUILD_TYPE:STRING=Debug
+          -DFTXUI_ENABLE_COVERAGE:BOOL=ON
+          -DFTXUI_BUILD_DOCS:BOOL=OFF
+          -DFTXUI_BUILD_EXAMPLES:BOOL=ON
+          -DFTXUI_BUILD_TESTS:BOOL=ON
+          -DFTXUI_BUILD_TESTS_FUZZER:BOOL=OFF
+          -DFTXUI_ENABLE_INSTALL:BOOL=ON ;
+
+      - name: "Build"
+        run: >
+          cmake
+          --build ./build
 
-      - name: "Run tests"
-        if: matrix.test
+      - name: Unix - Test and coverage
+        if: runner.os != 'Windows'
+        working-directory: ./build
         run: >
-          cd build;
-          ./tests
+          ctest -C Debug;
+          gcovr
+          -j ${{env.nproc}}
+          --delete
+          --root ../
+          --exclude "../examples"
+          --exclude ".*google.*"
+          --print-summary
+          --xml-pretty
+          --xml
+          coverage.xml
+          .
+          --gcov-executable '${{ matrix.gcov_executable }}';
+
+      - name: Windows - Test and coverage
+        if: runner.os == 'Windows'
+        working-directory: ./build
+        run: >
+          OpenCppCoverage.exe
+          --export_type cobertura:coverage.xml
+          --cover_children
+          --
+          ctest -C Debug
+
+      - name: Publish to codecov
+        uses: codecov/codecov-action@v2
+        with:
+          flags: ${{ runner.os }}
+          name: ${{ runner.os }}-coverage
+          files: ./build/coverage.xml
 
   # Create a release on new v* tags
   release:
@@ -117,7 +156,7 @@ jobs:
           -DFTXUI_BUILD_TESTS=OFF
           -DFTXUI_BUILD_TESTS_FUZZER=OFF
           -DFTXUI_ENABLE_INSTALL=ON;
-          cmake --build . --config Release --target package;
+          cmake --build . --target package;
       - uses: shogo82148/actions-upload-release-asset@v1
         with:
           upload_url: ${{ needs.release.outputs.upload_url }}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b5ce5669483dc3517d8914fe39eecbc15692bb25..4d2d1c3e0235a0f831a4217786226223fd909f29 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,7 @@ option(FTXUI_BUILD_TESTS "Set to ON to build tests" OFF)
 option(FTXUI_BUILD_TESTS_FUZZER "Set to ON to enable fuzzing" OFF)
 option(FTXUI_ENABLE_INSTALL "Generate the install target" ON)
 option(FTXUI_CLANG_TIDY "Execute clang-tidy" OFF)
+option(FTXUI_ENABLE_COVERAGE "Execute code coverage" OFF)
 
 set(FTXUI_MICROSOFT_TERMINAL_FALLBACK_HELP_TEXT "On windows, assume the \
 terminal used will be one of Microsoft and use a set of reasonnable fallback \
@@ -139,6 +140,11 @@ ftxui_set_options(screen)
 ftxui_set_options(dom)
 ftxui_set_options(component)
 
+include(cmake/ftxui_coverage.cmake)
+ftxui_check_coverage(screen)
+ftxui_check_coverage(dom)
+ftxui_check_coverage(component)
+
 if (FTXUI_BUILD_TESTS AND ${CMAKE_VERSION} VERSION_GREATER "3.11.4")
   include(cmake/ftxui_test.cmake)
 endif()
diff --git a/cmake/ftxui_benchmark.cmake b/cmake/ftxui_benchmark.cmake
index 07404764faf1ab73893656c9a4e61695a42e9557..79670f0697b9c7e5829df38e11b436595c144e5c 100644
--- a/cmake/ftxui_benchmark.cmake
+++ b/cmake/ftxui_benchmark.cmake
@@ -2,12 +2,19 @@ if (NOT WIN32)
   FetchContent_Declare(googlebenchmark
     GIT_REPOSITORY "https://github.com/google/benchmark"
     GIT_TAG 62937f91b5c763a8e119d0c20c67b87bde8eff1c 
+    GIT_PROGRESS TRUE
   )
 
   FetchContent_GetProperties(googlebenchmark)
+  set (BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE INTERNAL "")
+  set (BENCHMARK_ENABLE_TESTING OFF CACHE INTERNAL "")
   if(NOT googlebenchmark_POPULATED)
     FetchContent_Populate(googlebenchmark)
-    add_subdirectory(${googlebenchmark_SOURCE_DIR} ${googlebenchmark_BINARY_DIR} EXCLUDE_FROM_ALL)
+    add_subdirectory(
+      ${googlebenchmark_SOURCE_DIR}
+      ${googlebenchmark_BINARY_DIR}
+      EXCLUDE_FROM_ALL
+    )
   endif()
 
   add_executable(ftxui_benchmark
diff --git a/cmake/ftxui_coverage.cmake b/cmake/ftxui_coverage.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..b92db44f75fa98b23068dac5c4263e0b1c155cb9
--- /dev/null
+++ b/cmake/ftxui_coverage.cmake
@@ -0,0 +1,8 @@
+function(ftxui_check_coverage library)
+  if (FTXUI_ENABLE_COVERAGE)
+    if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
+      target_compile_options(${library} INTERFACE --coverage -O0 -g)
+      target_link_libraries(${library} INTERFACE --coverage)
+    endif()
+  endif()
+endfunction()
diff --git a/cmake/ftxui_test.cmake b/cmake/ftxui_test.cmake
index f438866b10930e053d88961e8ea90b90d13784e1..2ed92badf3d3bd02c6bf6ff0fffb1dea678a728d 100644
--- a/cmake/ftxui_test.cmake
+++ b/cmake/ftxui_test.cmake
@@ -1,17 +1,25 @@
 enable_testing()
-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
 
 option(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
+option(FETCHCONTENT_QUIET FALSE)
 include(FetchContent)
 
 FetchContent_Declare(googletest
   GIT_REPOSITORY "https://github.com/google/googletest"
   GIT_TAG        23ef29555ef4789f555f1ba8c51b4c52975f0907
+  GIT_PROGRESS   TRUE
 )
 FetchContent_GetProperties(googletest)
 if(NOT googletest_POPULATED)
   FetchContent_Populate(googletest)
-  add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
+  set(BUILD_GMOCK OFF CACHE INTERNAL "")
+  set(INSTALL_GTEST OFF CACHE INTERNAL "")
+  set(gtest_force_shared_crt ON CACHE INTERNAL "")
+  add_subdirectory(
+    ${googletest_SOURCE_DIR}
+    ${googletest_BINARY_DIR}
+    EXCLUDE_FROM_ALL
+  )
 endif()
 
 add_executable(tests
@@ -38,16 +46,17 @@ add_executable(tests
 target_link_libraries(tests
   PRIVATE component
   PRIVATE gtest
-  PRIVATE gmock
   PRIVATE gtest_main
 )
 target_include_directories(tests
   PRIVATE src
 )
+ftxui_set_options(tests)
 
-if (NOT MSVC)
-  include(cmake/ftxui_benchmark.cmake)
-endif()
+include(GoogleTest)
+gtest_discover_tests(tests)
+
+include(cmake/ftxui_benchmark.cmake)
 
 if (FTXUI_BUILD_TESTS_FUZZER)
   include(cmake/ftxui_fuzzer.cmake)
diff --git a/src/ftxui/component/animation.cpp b/src/ftxui/component/animation.cpp
index 49cc3cd088527c3f5bed073b513d3c4fbcb0cdbd..cbee0a2b2fe4e43d91d56dbd40c0be835cbad7aa 100644
--- a/src/ftxui/component/animation.cpp
+++ b/src/ftxui/component/animation.cpp
@@ -189,8 +189,8 @@ float ElasticIn(float p) {
 // Modeled after the damped sine wave y = sin(-13pi/2*(x + 1))*pow(2, -10x) +
 // 1
 float ElasticOut(float p) {
-  return std::sin(-13.F * kPi2 * (p + 1)) * std::pow(2.F, -10.F * p) +
-         1;  // NOLINT
+  // NOLINTNEXTLINE
+  return std::sin(-13.F * kPi2 * (p + 1)) * std::pow(2.F, -10.F * p) + 1;
 }
 
 // Modeled after the piecewise exponentially-damped sine wave:
diff --git a/src/ftxui/component/button.cpp b/src/ftxui/component/button.cpp
index 30ebfecb9b8b9c33b44e325a6d69cb96fbe89907..2fcd1910d9f1850ee7d2aadbba3cce64f9d649bd 100644
--- a/src/ftxui/component/button.cpp
+++ b/src/ftxui/component/button.cpp
@@ -55,6 +55,7 @@ Element DefaultTransform(EntryState params) {  // NOLINT
 /// │Click to quit│
 /// └─────────────┘
 /// ```
+// NOLINTNEXTLINE(readability-function-cognitive-complexity)
 Component Button(ConstStringRef label,
                  std::function<void()> on_click,
                  Ref<ButtonOption> option) {
diff --git a/src/ftxui/component/component_test.cpp b/src/ftxui/component/component_test.cpp
index 42a681453706e923d6759ff6a949ebc8eff534f2..8c0029ae1c7169aa2337b3c25cdfa60a794dc34b 100644
--- a/src/ftxui/component/component_test.cpp
+++ b/src/ftxui/component/component_test.cpp
@@ -7,7 +7,7 @@
 #include "ftxui/component/component_base.hpp"  // for ComponentBase, Component
 #include "gtest/gtest_pred_impl.h"  // for EXPECT_EQ, Test, SuiteApiResolver, TEST, TestFactoryImpl
 
-using namespace ftxui;
+namespace ftxui {
 
 namespace {
 Component Make() {
@@ -172,6 +172,8 @@ TEST(ComponentTest, NonFocusableAreNotFocused) {
   EXPECT_EQ(child->ActiveChild(), nullptr);
 }
 
+}  // namespace ftxui
+
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/component/container_test.cpp b/src/ftxui/component/container_test.cpp
index 1c5d914361ade71f89db03f47cd5ed5e5e4d8c71..902d4a3b5aa4caddd08e5363527ce297e76fc136 100644
--- a/src/ftxui/component/container_test.cpp
+++ b/src/ftxui/component/container_test.cpp
@@ -8,14 +8,16 @@
 #include "ftxui/component/event.hpp"  // for Event, Event::Tab, Event::TabReverse, Event::ArrowDown, Event::ArrowLeft, Event::ArrowRight, Event::ArrowUp
 #include "gtest/gtest_pred_impl.h"  // for AssertionResult, EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, Test, TEST
 
-using namespace ftxui;
+namespace ftxui {
 
+namespace {
 Component Focusable() {
   return Button("", [] {});
 }
 Component NonFocusable() {
   return Container::Horizontal({});
 }
+}  // namespace
 
 TEST(ContainerTest, HorizontalEvent) {
   auto container = Container::Horizontal({});
@@ -333,6 +335,8 @@ TEST(ContainerTest, TabFocusable) {
   EXPECT_FALSE(c->Focused());
 }
 
+}  // namespace ftxui
+
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/component/input_test.cpp b/src/ftxui/component/input_test.cpp
index 7cd16f99a8d55003f6cfb753a28de79cb2172069..0621c0452b06c306178d8acd1ffdb7cdeca873ae 100644
--- a/src/ftxui/component/input_test.cpp
+++ b/src/ftxui/component/input_test.cpp
@@ -15,7 +15,7 @@
 #include "ftxui/util/ref.hpp"       // for Ref
 #include "gtest/gtest_pred_impl.h"  // for Test, EXPECT_EQ, TEST
 
-using namespace ftxui;
+namespace ftxui {
 
 TEST(InputTest, Init) {
   std::string content;
@@ -372,6 +372,8 @@ TEST(InputTest, MouseClickComplex) {
   EXPECT_EQ(option.cursor_position(), 4u);
 }
 
+}  // namespace ftxui
+
 // Copyright 2021 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/component/menu_test.cpp b/src/ftxui/component/menu_test.cpp
index f7088db4855d8829ef3f09a6698fea8c77c96bd4..fd84a26a33daff5a03ed4246c13e5228a7c86576 100644
--- a/src/ftxui/component/menu_test.cpp
+++ b/src/ftxui/component/menu_test.cpp
@@ -12,7 +12,7 @@
 #include "ftxui/util/ref.hpp"         // for Ref
 #include "gtest/gtest_pred_impl.h"  // for Test, EXPECT_EQ, TEST
 
-using namespace ftxui;
+namespace ftxui {
 
 TEST(MenuTest, RemoveEntries) {
   int focused_entry = 0;
@@ -43,6 +43,8 @@ TEST(MenuTest, RemoveEntries) {
   EXPECT_EQ(focused_entry, 1);
 }
 
+}  // namespace ftxui
+
 // Copyright 2022 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/component/radiobox_test.cpp b/src/ftxui/component/radiobox_test.cpp
index 08a45504201608eee8c656a3d4e6a3d065982a27..d057560c40624889a78e65316691d0bfd67e9136 100644
--- a/src/ftxui/component/radiobox_test.cpp
+++ b/src/ftxui/component/radiobox_test.cpp
@@ -12,7 +12,7 @@
 #include "ftxui/util/ref.hpp"         // for Ref
 #include "gtest/gtest_pred_impl.h"    // for EXPECT_EQ, Test, TEST
 
-using namespace ftxui;
+namespace ftxui {
 
 TEST(RadioboxTest, Navigation) {
   int selected = 0;
@@ -145,6 +145,8 @@ TEST(RadioboxTest, RemoveEntries) {
   EXPECT_EQ(focused_entry, 1);
 }
 
+}  // namespace ftxui
+
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/component/receiver_test.cpp b/src/ftxui/component/receiver_test.cpp
index bd4e1cb63e2cede715b98f9348f875897085d882..a327ac8c3a54f9810b8a73a2dc5c720c0e004ec8 100644
--- a/src/ftxui/component/receiver_test.cpp
+++ b/src/ftxui/component/receiver_test.cpp
@@ -6,7 +6,7 @@
 #include "ftxui/component/receiver.hpp"
 #include "gtest/gtest_pred_impl.h"  // for AssertionResult, Test, EXPECT_EQ
 
-using namespace ftxui;
+namespace ftxui {
 
 TEST(Receiver, Basic) {
   auto receiver = MakeReceiver<char>();
@@ -75,6 +75,8 @@ TEST(Receiver, BasicWithThread) {
   t23.join();
 }
 
+}  // namespace ftxui
+
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/component/screen_interactive_test.cpp b/src/ftxui/component/screen_interactive_test.cpp
index 53f4a3e4e55a5f0de31a015f8abb00b7eff58851..9592d9324bd66064865250869c5cc444bc19e398 100644
--- a/src/ftxui/component/screen_interactive_test.cpp
+++ b/src/ftxui/component/screen_interactive_test.cpp
@@ -7,7 +7,7 @@
 #include "ftxui/dom/elements.hpp"   // for text, Element
 #include "gtest/gtest_pred_impl.h"  // for Test, TEST, EXPECT_EQ
 
-using namespace ftxui;
+namespace ftxui {
 
 namespace {
 bool TestSignal(int signal) {
@@ -47,6 +47,8 @@ TEST(ScreenInteractive, Signal_SIGFPE) {
   TestSignal(SIGFPE);
 }
 
+}  // namespace ftxui
+
 // Copyright 2021 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/component/terminal_input_parser_test.cpp b/src/ftxui/component/terminal_input_parser_test.cpp
index f2bb0e2c640c8edcb8c491ad0e31161ca2a58eaf..863f9743f70521dc093a7694b47c4a924e1734a8 100644
--- a/src/ftxui/component/terminal_input_parser_test.cpp
+++ b/src/ftxui/component/terminal_input_parser_test.cpp
@@ -9,7 +9,7 @@
 #include "ftxui/component/terminal_input_parser.hpp"
 #include "gtest/gtest_pred_impl.h"  // for AssertionResult, Test, EXPECT_EQ, EXPECT_TRUE, EXPECT_FALSE, TEST
 
-using namespace ftxui;
+namespace ftxui {
 
 // Test char |c| to are trivially converted into |Event::Character(c)|.
 TEST(Event, Character) {
@@ -232,6 +232,8 @@ TEST(Event, UTF8) {
   }
 }
 
+}  // namespace ftxui
+
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/dom/benchmark_test.cpp b/src/ftxui/dom/benchmark_test.cpp
index 800b62001be3456d2aaa7ff3b6642dbeb3f789a8..76a028de5b57eb9a8c5546d6d48aeb5e038690ed 100644
--- a/src/ftxui/dom/benchmark_test.cpp
+++ b/src/ftxui/dom/benchmark_test.cpp
@@ -5,7 +5,7 @@
 #include "ftxui/screen/color.hpp"  // for ftxui
 #include "ftxui/screen/screen.hpp"  // for Screen
 
-using namespace ftxui;
+namespace ftxui {
 
 static void BencharkBasic(benchmark::State& state) {
   while (state.KeepRunning()) {
@@ -30,6 +30,8 @@ static void BencharkBasic(benchmark::State& state) {
 }
 BENCHMARK(BencharkBasic)->DenseRange(0, 256, 16);
 
+}  // namespace ftxui
+
 // Copyright 2021 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.l
diff --git a/src/ftxui/dom/flexbox_helper_test.cpp b/src/ftxui/dom/flexbox_helper_test.cpp
index ab6af7b0c92e3c64d14f83b86b512c6e6f73910b..09d5b203911c92dd384170b4fff222fb286784b8 100644
--- a/src/ftxui/dom/flexbox_helper_test.cpp
+++ b/src/ftxui/dom/flexbox_helper_test.cpp
@@ -5,8 +5,7 @@
 #include "ftxui/dom/flexbox_helper.hpp"
 #include "gtest/gtest_pred_impl.h"  // for EXPECT_EQ, Test, TEST
 
-using namespace ftxui;
-using namespace ftxui;
+namespace ftxui {
 
 TEST(FlexboxHelperTest, BasicRow) {
   flexbox_helper::Block block_10_5;
@@ -228,6 +227,8 @@ TEST(FlexboxHelperTest, BasicColumnInversed) {
   EXPECT_EQ(g.blocks[4].dim_y, 5);
 }
 
+}  // namespace ftxui
+
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/dom/flexbox_test.cpp b/src/ftxui/dom/flexbox_test.cpp
index c284dc555529faae6b0b400682a1e53016b7f931..841711ff55b0f1e8de109c4a8c19539873f189ae 100644
--- a/src/ftxui/dom/flexbox_test.cpp
+++ b/src/ftxui/dom/flexbox_test.cpp
@@ -9,7 +9,7 @@
 #include "ftxui/screen/screen.hpp"       // for Screen
 #include "gtest/gtest_pred_impl.h"       // for Test, EXPECT_EQ, TEST
 
-using namespace ftxui;
+namespace ftxui {
 
 TEST(FlexboxTest, BasicRow) {
   auto root = flexbox(
@@ -433,6 +433,8 @@ TEST(FlexboxTest, GapY) {
             "       ");
 }
 
+}  // namespace ftxui
+
 // Copyright 2021 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/dom/gauge_test.cpp b/src/ftxui/dom/gauge_test.cpp
index 8165426cc2a5b336f49cc7f89aa3f9d6803dd101..454850e00a7a64bb7c7b41cb35a504ace3ae6fe9 100644
--- a/src/ftxui/dom/gauge_test.cpp
+++ b/src/ftxui/dom/gauge_test.cpp
@@ -8,8 +8,7 @@
 #include "ftxui/screen/screen.hpp"  // for Screen
 #include "gtest/gtest_pred_impl.h"  // for Test, EXPECT_EQ, TEST
 
-using namespace ftxui;
-using namespace ftxui;
+namespace ftxui {
 
 TEST(GaugeTest, ZeroHorizontal) {
   auto root = gauge(0);
@@ -24,7 +23,11 @@ TEST(GaugeTest, HalfHorizontal) {
   Screen screen(11, 1);
   Render(screen, root);
 
+#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
+  EXPECT_EQ("█████▌     ", screen.ToString());
+#else
   EXPECT_EQ("█████▍     ", screen.ToString());
+#endif
 }
 
 TEST(GaugeTest, OneHorizontal) {
@@ -95,6 +98,8 @@ TEST(GaugeTest, OneVertical) {
       screen.ToString());
 }
 
+}  // namespace ftxui
+
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/dom/gridbox_test.cpp b/src/ftxui/dom/gridbox_test.cpp
index aa200c16653155172b936f5e4f4d694446226366..30c6e4c9d6a7ae76897dd96498e9e74e42278541 100644
--- a/src/ftxui/dom/gridbox_test.cpp
+++ b/src/ftxui/dom/gridbox_test.cpp
@@ -10,7 +10,7 @@
 #include "ftxui/screen/screen.hpp"  // for Screen
 #include "gtest/gtest_pred_impl.h"  // for Test, TEST, EXPECT_EQ
 
-using namespace ftxui;
+namespace ftxui {
 
 namespace {
 std::string rotate(std::string str) {
@@ -175,7 +175,7 @@ TEST(GridboxTest, Horizontal_NoFlex_NoFlex_NoFlex) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -203,7 +203,7 @@ TEST(GridboxTest, Vertical_NoFlex_NoFlex_NoFlex) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -233,7 +233,7 @@ TEST(GridboxTest, Horizontal_FlexGrow_NoFlex_NoFlex) {
       "012 abcABC",   //
       "012  abcABC",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -261,7 +261,7 @@ TEST(GridboxTest, Vertical_FlexGrow_NoFlex_NoFlex) {
       "012 abcABC",   //
       "012  abcABC",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -291,7 +291,7 @@ TEST(GridboxTest, Horizontal_NoFlex_FlexGrow_NoFlex) {
       "012abc ABC",   //
       "012abc  ABC",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -321,7 +321,7 @@ TEST(GridboxTest, Horizontal_NoFlex_NoFlex_FlexGrow) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -353,7 +353,7 @@ TEST(GridboxTest, Horizontal_FlexGrow_NoFlex_FlexGrow) {
       "012 abcABC  ",   //
       "012  abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -387,7 +387,7 @@ TEST(GridboxTest, Horizontal_FlexGrow_FlexGrow_FlexGrow) {
       "012 abc  ABC  ",   //
       "012  abc  ABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -419,7 +419,7 @@ TEST(GridboxTest, Horizontal_FlexShrink_NoFlex_NoFlex) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -449,7 +449,7 @@ TEST(GridboxTest, Horizontal_NoFlex_FlexShrink_NoFlex) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -479,7 +479,7 @@ TEST(GridboxTest, Horizontal_NoFlex_NoFlex_FlexShrink) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -508,7 +508,7 @@ TEST(GridboxTest, Horizontal_FlexShrink_NoFlex_FlexShrink) {
       "012abcABC",   //
       "012abcABC ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -539,7 +539,7 @@ TEST(GridboxTest, Horizontal_FlexShrink_FlexShrink_FlexShrink) {
       "012abcABC  ",   //
       "012abcABC   ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -570,7 +570,7 @@ TEST(GridboxTest, Horizontal_FlexGrow_NoFlex_FlewShrink) {
       "012  abcABC",   //
       "012   abcABC",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -596,6 +596,8 @@ TEST(GridboxTest, MissingCells) {
             "                    ");
 }
 
+}  // namespace ftxui
+
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/dom/hbox_test.cpp b/src/ftxui/dom/hbox_test.cpp
index a084c81a1b707f6a4fdd75a3664a0ac21a628818..05fefe1da3585df03968b87f2ea8770323544d51 100644
--- a/src/ftxui/dom/hbox_test.cpp
+++ b/src/ftxui/dom/hbox_test.cpp
@@ -33,7 +33,7 @@ TEST(HBoxTest, NoFlex_NoFlex_NoFlex) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -61,7 +61,7 @@ TEST(HBoxTest, FlexGrow_NoFlex_NoFlex) {
       "012 abcABC",   //
       "012  abcABC",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -89,7 +89,7 @@ TEST(HBoxTest, NoFlex_FlexGrow_NoFlex) {
       "012abc ABC",   //
       "012abc  ABC",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -117,7 +117,7 @@ TEST(HBoxTest, NoFlex_NoFlex_FlexGrow) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -147,7 +147,7 @@ TEST(HBoxTest, FlexGrow_NoFlex_FlexGrow) {
       "012 abcABC  ",   //
       "012  abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -179,7 +179,7 @@ TEST(HBoxTest, FlexGrow_FlexGrow_FlexGrow) {
       "012 abc  ABC  ",   //
       "012  abc  ABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -209,7 +209,7 @@ TEST(HBoxTest, FlexShrink_NoFlex_NoFlex) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -237,7 +237,7 @@ TEST(HBoxTest, NoFlex_FlexShrink_NoFlex) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -265,7 +265,7 @@ TEST(HBoxTest, NoFlex_NoFlex_FlexShrink) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -292,7 +292,7 @@ TEST(HBoxTest, FlexShrink_NoFlex_FlexShrink) {
       "012abcABC",   //
       "012abcABC ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -321,7 +321,7 @@ TEST(HBoxTest, FlexShrink_FlexShrink_FlexShrink) {
       "012abcABC  ",   //
       "012abcABC   ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
@@ -350,7 +350,7 @@ TEST(HBoxTest, FlexGrow_NoFlex_FlewShrink) {
       "012  abcABC",   //
       "012   abcABC",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(i, 1);
     Render(screen, root);
     EXPECT_EQ(expectations[i], screen.ToString());
diff --git a/src/ftxui/dom/table_test.cpp b/src/ftxui/dom/table_test.cpp
index 0cb4a920e25f27fc4c15b926893752e85c4f8083..b055d27411ac4f4198fa008f3de3eba8c5dd3709 100644
--- a/src/ftxui/dom/table_test.cpp
+++ b/src/ftxui/dom/table_test.cpp
@@ -9,7 +9,7 @@
 #include "ftxui/screen/screen.hpp"  // for Screen
 #include "gtest/gtest_pred_impl.h"  // for Test, EXPECT_EQ, TEST
 
-using namespace ftxui;
+namespace ftxui {
 
 TEST(TableTest, Empty) {
   auto table = Table();
@@ -711,6 +711,8 @@ TEST(TableTest, RowFlexTwo) {
       screen.ToString());
 }
 
+}  // namespace ftxui
+
 // Copyright 2021 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/dom/text_test.cpp b/src/ftxui/dom/text_test.cpp
index d763932463bfb7ae3406430521243fa25f1efe27..10ba7ccb7847c24ab8415b674510d10e5bd12853 100644
--- a/src/ftxui/dom/text_test.cpp
+++ b/src/ftxui/dom/text_test.cpp
@@ -8,7 +8,7 @@
 #include "ftxui/screen/screen.hpp"  // for Screen
 #include "gtest/gtest_pred_impl.h"  // for Test, EXPECT_EQ, TEST
 
-using namespace ftxui;
+namespace ftxui {
 
 TEST(TextTest, ScreenHeightSmaller) {
   auto element = text("test");
@@ -103,6 +103,8 @@ TEST(TextTest, CombiningCharacters) {
   EXPECT_EQ(t, screen.ToString());
 }
 
+}  // namespace ftxui
+
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/dom/vbox_test.cpp b/src/ftxui/dom/vbox_test.cpp
index 4a11bf1449920945d545b86dfaa8ecf0111a4183..9812c35eac34b6c18ea9c5707b43d10c73e50488 100644
--- a/src/ftxui/dom/vbox_test.cpp
+++ b/src/ftxui/dom/vbox_test.cpp
@@ -10,7 +10,8 @@
 #include "ftxui/screen/screen.hpp"  // for Screen
 #include "gtest/gtest_pred_impl.h"  // for Test, EXPECT_EQ, TEST
 
-using namespace ftxui;
+namespace ftxui {
+namespace {
 
 std::string rotate(std::string str) {
   str.erase(std::remove(str.begin(), str.end(), '\r'), str.end());
@@ -18,6 +19,8 @@ std::string rotate(std::string str) {
   return str;
 }
 
+}  // namespace
+
 TEST(VBoxText, NoFlex_NoFlex_NoFlex) {
   auto root = vbox({
       vtext("012"),
@@ -39,7 +42,7 @@ TEST(VBoxText, NoFlex_NoFlex_NoFlex) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -67,7 +70,7 @@ TEST(VBoxText, FlexGrow_NoFlex_NoFlex) {
       "012 abcABC",   //
       "012  abcABC",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -95,7 +98,7 @@ TEST(VBoxText, NoFlex_FlexGrow_NoFlex) {
       "012abc ABC",   //
       "012abc  ABC",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -123,7 +126,7 @@ TEST(VBoxText, NoFlex_NoFlex_FlexGrow) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -153,7 +156,7 @@ TEST(VBoxText, FlexGrow_NoFlex_FlexGrow) {
       "012 abcABC  ",   //
       "012  abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -185,7 +188,7 @@ TEST(VBoxText, FlexGrow_FlexGrow_FlexGrow) {
       "012 abc  ABC  ",   //
       "012  abc  ABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -215,7 +218,7 @@ TEST(VBoxText, FlexShrink_NoFlex_NoFlex) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -243,7 +246,7 @@ TEST(VBoxText, NoFlex_FlexShrink_NoFlex) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -271,7 +274,7 @@ TEST(VBoxText, NoFlex_NoFlex_FlexShrink) {
       "012abcABC ",   //
       "012abcABC  ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -298,7 +301,7 @@ TEST(VBoxText, FlexShrink_NoFlex_FlexShrink) {
       "012abcABC",   //
       "012abcABC ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -327,7 +330,7 @@ TEST(VBoxText, FlexShrink_FlexShrink_FlexShrink) {
       "012abcABC  ",   //
       "012abcABC   ",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
@@ -356,13 +359,15 @@ TEST(VBoxText, FlexGrow_NoFlex_FlewShrink) {
       "012  abcABC",   //
       "012   abcABC",  //
   };
-  for (int i = 0; i < expectations.size(); ++i) {
+  for (size_t i = 0; i < expectations.size(); ++i) {
     Screen screen(1, i);
     Render(screen, root);
     EXPECT_EQ(expectations[i], rotate(screen.ToString()));
   }
 }
 
+}  // namespace ftxui
+
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.
diff --git a/src/ftxui/screen/screen.cpp b/src/ftxui/screen/screen.cpp
index 529eb45ce2131513b58d202e54a5588608676eda..c3d95559c39853e5bd13b163b966ea4eaf4ba365 100644
--- a/src/ftxui/screen/screen.cpp
+++ b/src/ftxui/screen/screen.cpp
@@ -1,4 +1,4 @@
-#include <stdint.h>  // for uint8_t
+#include <cstdint>  // for uint8_t
 #include <iostream>  // for operator<<, stringstream, basic_ostream, flush, cout, ostream
 #include <map>      // for _Rb_tree_const_iterator, map, operator!=, operator==
 #include <memory>   // for allocator
diff --git a/src/ftxui/screen/string_test.cpp b/src/ftxui/screen/string_test.cpp
index 0aff5ad3324c8dbf027999e7dc15b8d65a8d13cd..5518d24934c2c68e97aa89aeecc47696c6697ea0 100644
--- a/src/ftxui/screen/string_test.cpp
+++ b/src/ftxui/screen/string_test.cpp
@@ -5,7 +5,7 @@
 #include "ftxui/screen/string.hpp"
 #include "gtest/gtest_pred_impl.h"  // for EXPECT_EQ, Test, TEST
 
-using namespace ftxui;
+namespace ftxui {
 
 TEST(StringTest, StringWidth) {
   // Basic:
@@ -120,6 +120,7 @@ TEST(StringTest, CellToGlyphIndex) {
   EXPECT_EQ(combining[2], 2);
 }
 
+}
 // Copyright 2020 Arthur Sonzogni. All rights reserved.
 // Use of this source code is governed by the MIT license that can be found in
 // the LICENSE file.