From 84a09a843d56a4d1f7f015e24f4b698499e51afd Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 25 Mar 2024 14:19:40 +0700 Subject: [PATCH] chore: remove unused sample project --- .gitignore | 1 - test/CMakeLists.txt | 32 -------------------------------- test/hello_world.cpp | 6 ------ test/test.in | 19 ------------------- 4 files changed, 58 deletions(-) delete mode 100644 test/CMakeLists.txt delete mode 100644 test/hello_world.cpp delete mode 100644 test/test.in diff --git a/.gitignore b/.gitignore index afd7a91..260b703 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,5 @@ !.eslint* !.git* -build/ coverage/ node_modules/ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 index 3e64c27..0000000 --- a/test/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(test) - -option(CHECK_USING_CLANG "Check if the target is compiled using Clang" OFF) -option(CHECK_SURPASS_WARNING "Check if the target could surpass a compiler warning" OFF) - -if(CHECK_SURPASS_WARNING) - if(MSVC) - set(CMAKE_C_FLAGS "/WX /W4 ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "/WX /W4 ${CMAKE_CXX_FLAGS}") - else() - set(CMAKE_C_FLAGS "-Werror -Wunused-variable ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "-Werror -Wunused-variable ${CMAKE_CXX_FLAGS}") - endif() -endif() - -enable_testing() -add_executable(hello_world hello_world.cpp) -add_test(NAME hello_world COMMAND $) - -list(APPEND LANGS c cpp) -foreach(LANG ${LANGS}) - configure_file(test.in ${CMAKE_CURRENT_BINARY_DIR}/test.${LANG}) - add_executable(test_${LANG} EXCLUDE_FROM_ALL ${CMAKE_CURRENT_BINARY_DIR}/test.${LANG}) - target_compile_definitions( - test_${LANG} PRIVATE - $<$:IS_C> - $<$:CHECK_USING_CLANG> - $<$:CHECK_SURPASS_WARNING> - ) - add_test(NAME test_${LANG} COMMAND $) -endforeach() diff --git a/test/hello_world.cpp b/test/hello_world.cpp deleted file mode 100644 index 2242cf0..0000000 --- a/test/hello_world.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() { - std::cout << "Hello world!" << std::endl; - return 0; -} diff --git a/test/test.in b/test/test.in deleted file mode 100644 index 4098a34..0000000 --- a/test/test.in +++ /dev/null @@ -1,19 +0,0 @@ -#ifdef IS_C -#include -#define PRINT(STR) printf(STR); printf("\n") -#else -#include -#define PRINT(STR) std::cout << STR << std::endl -#endif - -int main() { -#ifdef CHECK_SURPASS_WARNING - int unused; -#endif -#if defined(CHECK_USING_CLANG) && !defined(__clang__) - PRINT("compiler is not clang"); - return 1; -#endif - PRINT("all ok"); - return 0; -}