Học C++ từ Cơ Bản đến Nâng Cao

Website tự học lập trình C++ miễn phí, thực chiến, dễ hiểu

Debug & Testing

GDB (GNU Debugger)

CMake

cmake_minimum_required(VERSION 3.10)
project(MyApp)
add_executable(main main.cpp)
    

GoogleTest

# CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(MyTest)
add_subdirectory(googletest)
include_directories(googletest/include)

add_executable(runTest test.cpp)
target_link_libraries(runTest gtest gtest_main)
#include <gtest/gtest.h>

TEST(SampleTest, BasicAssertion) {
  EXPECT_EQ(1 + 1, 2);
}

int main(int argc, char **argv) {
  ::testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}
    

Static Analysis Tools

← Quay lại C++ Nâng Cao