From 50574755431810c12ddf18f6c89a48b1c2502c7e Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Mon, 30 Dec 2024 23:56:48 +0100 Subject: [PATCH 01/15] interim with CTC cmake --- make/Bullseye_msbuild.cmd | 2 +- make/CMakeLists.txt | 60 ++++++++++++++++++++++++++++++++++++ make/Test_B_Macro.make | 6 ++-- make/Test_Count.make | 6 ++-- make/Test_Exclude.make | 6 ++-- make/Test_FD_SET_Macro.make | 6 ++-- make/Test_Macro.make | 6 ++-- make/Test_Mod_Cpp.make | 6 ++-- make/Test_Standard.make | 6 ++-- make/Test_Standard_Part.make | 6 ++-- make/be_build_n_run.cmd | 1 + make/premake5.lua | 5 +-- make/testlib.make | 6 ++-- 13 files changed, 92 insertions(+), 30 deletions(-) create mode 100644 make/CMakeLists.txt diff --git a/make/Bullseye_msbuild.cmd b/make/Bullseye_msbuild.cmd index 3c0a0c7..bc034d0 100644 --- a/make/Bullseye_msbuild.cmd +++ b/make/Bullseye_msbuild.cmd @@ -16,7 +16,7 @@ echo %DATE% %TIME% > %covReport% rem rebase to source dir rem enable macros -set covcopt=--srcdir %srcDir% --macro +set covcopt=--srcdir %srcDir% --macro --no-banner if "%_args%"=="" ( for %%f in (%testsDir%\*.cpp) do call %runSub% %%~nf diff --git a/make/CMakeLists.txt b/make/CMakeLists.txt new file mode 100644 index 0000000..b089688 --- /dev/null +++ b/make/CMakeLists.txt @@ -0,0 +1,60 @@ +# ============================================================ +# CMake for CTC Coverage +# ============================================================ + +cmake_minimum_required(VERSION 3.7) + + +set (projektName CoverageTest) +project(${projektName}) + +set(REPO_PATH ${PROJECT_SOURCE_DIR}/..) +set(CODE_PATH ${REPO_PATH}/code) +set(TESTLIB_PATH ${REPO_PATH}/testlib) +set(TESTS_PATH ${REPO_PATH}/tests) +set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_LIST_DIR}) +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_LIST_DIR}) + +include_directories ( + ${CODE_PATH} + ${TESTLIB_PATH} + # ${TESTS_PATH} +) + +set(CMAKE_CXX_COMPILER_FORCED TRUE) +set(CMAKE_CXX_COMPILER "ctc") + +set(CMAKE_CXX_COMPILER_ARG1 "-C \"CONST_INSTR = ON\" -C \"NO_EXCLUDE+*\\code\\*\" -v -i m cl -c") + +find_library ( + CtcWin + NAMES ctcwin32.lib + HINTS C:/Testwell/CTC/Lib + NO_DEFAULT_PATH +) +file(GLOB testLibSrcs ${TESTLIB_PATH}/*.cpp) +add_library(_testlib OBJECT ${testLibSrcs}) + +add_executable(Test_Standard ${TESTS_PATH}/Test_Standard.cpp ${CODE_PATH}/CoverageSrc.cpp) +target_link_libraries(Test_Standard ${CtcWin} _testlib) + +add_executable(Test_Standard_Part ${TESTS_PATH}/Test_Standard_Part.cpp ${CODE_PATH}/CoverageSrc.cpp) +target_link_libraries(Test_Standard_Part ${CtcWin} _testlib) + +add_executable(Test_B_Macro ${TESTS_PATH}/Test_B_Macro.cpp) +target_link_libraries(Test_B_Macro ${CtcWin} _testlib) + +add_executable(Test_Count ${TESTS_PATH}/Test_Count.cpp) +target_link_libraries(Test_Count ${CtcWin} _testlib) + +add_executable(Test_Exclude ${TESTS_PATH}/Test_Exclude.cpp) +target_link_libraries(Test_Exclude ${CtcWin} _testlib) + +add_executable(Test_FD_SET_Macro ${TESTS_PATH}/Test_FD_SET_Macro.cpp) +target_link_libraries(Test_FD_SET_Macro ${CtcWin} _testlib) + +add_executable(Test_Macro ${TESTS_PATH}/Test_Macro.cpp ${CODE_PATH}/CoverageMacro.cpp) +target_link_libraries(Test_Macro ${CtcWin} _testlib) + +add_executable(Test_Mod_Cpp ${TESTS_PATH}/Test_Mod_Cpp.cpp) +target_link_libraries(Test_Mod_Cpp ${CtcWin} _testlib) diff --git a/make/Test_B_Macro.make b/make/Test_B_Macro.make index 3c47ed2..9eee31d 100644 --- a/make/Test_B_Macro.make +++ b/make/Test_B_Macro.make @@ -22,12 +22,12 @@ RESCOMP = windres TARGETDIR = ../build TARGET = $(TARGETDIR)/Test_B_Macro OBJDIR = ../build/linux/ci/Test_B_Macro -DEFINES += -DNDEBUG +DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += ../build/linux/lib/libtestlib.a LDDEPS += ../build/linux/lib/libtestlib.a diff --git a/make/Test_Count.make b/make/Test_Count.make index 0392fe5..abc3855 100644 --- a/make/Test_Count.make +++ b/make/Test_Count.make @@ -22,12 +22,12 @@ RESCOMP = windres TARGETDIR = ../build TARGET = $(TARGETDIR)/Test_Count OBJDIR = ../build/linux/ci/Test_Count -DEFINES += -DNDEBUG +DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += ../build/linux/lib/libtestlib.a LDDEPS += ../build/linux/lib/libtestlib.a diff --git a/make/Test_Exclude.make b/make/Test_Exclude.make index bb37ba8..064979d 100644 --- a/make/Test_Exclude.make +++ b/make/Test_Exclude.make @@ -22,12 +22,12 @@ RESCOMP = windres TARGETDIR = ../build TARGET = $(TARGETDIR)/Test_Exclude OBJDIR = ../build/linux/ci/Test_Exclude -DEFINES += -DNDEBUG +DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += ../build/linux/lib/libtestlib.a LDDEPS += ../build/linux/lib/libtestlib.a diff --git a/make/Test_FD_SET_Macro.make b/make/Test_FD_SET_Macro.make index 0dc5a96..4068ea2 100644 --- a/make/Test_FD_SET_Macro.make +++ b/make/Test_FD_SET_Macro.make @@ -22,12 +22,12 @@ RESCOMP = windres TARGETDIR = ../build TARGET = $(TARGETDIR)/Test_FD_SET_Macro OBJDIR = ../build/linux/ci/Test_FD_SET_Macro -DEFINES += -DNDEBUG +DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += ../build/linux/lib/libtestlib.a LDDEPS += ../build/linux/lib/libtestlib.a diff --git a/make/Test_Macro.make b/make/Test_Macro.make index 07934d7..86449cc 100644 --- a/make/Test_Macro.make +++ b/make/Test_Macro.make @@ -22,12 +22,12 @@ RESCOMP = windres TARGETDIR = ../build TARGET = $(TARGETDIR)/Test_Macro OBJDIR = ../build/linux/ci/Test_Macro -DEFINES += -DNDEBUG +DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += ../build/linux/lib/libtestlib.a LDDEPS += ../build/linux/lib/libtestlib.a diff --git a/make/Test_Mod_Cpp.make b/make/Test_Mod_Cpp.make index 2e5f97f..8cb8636 100644 --- a/make/Test_Mod_Cpp.make +++ b/make/Test_Mod_Cpp.make @@ -22,12 +22,12 @@ RESCOMP = windres TARGETDIR = ../build TARGET = $(TARGETDIR)/Test_Mod_Cpp OBJDIR = ../build/linux/ci/Test_Mod_Cpp -DEFINES += -DNDEBUG +DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += ../build/linux/lib/libtestlib.a LDDEPS += ../build/linux/lib/libtestlib.a diff --git a/make/Test_Standard.make b/make/Test_Standard.make index 599c730..d8213d6 100644 --- a/make/Test_Standard.make +++ b/make/Test_Standard.make @@ -22,12 +22,12 @@ RESCOMP = windres TARGETDIR = ../build TARGET = $(TARGETDIR)/Test_Standard OBJDIR = ../build/linux/ci/Test_Standard -DEFINES += -DNDEBUG +DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += ../build/linux/lib/libtestlib.a LDDEPS += ../build/linux/lib/libtestlib.a diff --git a/make/Test_Standard_Part.make b/make/Test_Standard_Part.make index 6dc9459..94ad2b1 100644 --- a/make/Test_Standard_Part.make +++ b/make/Test_Standard_Part.make @@ -22,12 +22,12 @@ RESCOMP = windres TARGETDIR = ../build TARGET = $(TARGETDIR)/Test_Standard_Part OBJDIR = ../build/linux/ci/Test_Standard_Part -DEFINES += -DNDEBUG +DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += ../build/linux/lib/libtestlib.a LDDEPS += ../build/linux/lib/libtestlib.a diff --git a/make/be_build_n_run.cmd b/make/be_build_n_run.cmd index 211b0a7..9da7918 100644 --- a/make/be_build_n_run.cmd +++ b/make/be_build_n_run.cmd @@ -45,4 +45,5 @@ if %errorlevel% neq 0 ( if %_html% covhtml -q --allNum --srcdir . %reportsDir%\html_%target%_cov ) covsrc -q --srcdir . >> %covReport% +covsrc -q -c --srcdir . > %reportsDir%\csv_%target%_cov.csv del %exe% diff --git a/make/premake5.lua b/make/premake5.lua index 02c8a27..fbeadcb 100644 --- a/make/premake5.lua +++ b/make/premake5.lua @@ -2,8 +2,8 @@ -- premake5 build rules for coverage test -- ============================================================ -buildoptions_vs = '/std:c++17 /MP /W4 /wd4100 /wd4103 /wd4068 /D_COVERAGE_ON' -buildoptions_gcc = '-std=c++17 -pedantic-errors -D_COVERAGE_ON' +buildoptions_vs = '/std:c++17 /MP /W4 /wd4100 /wd4103 /wd4068' +buildoptions_gcc = '-std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas' workspace 'Tests' configurations { 'ci' } @@ -13,6 +13,7 @@ workspace 'Tests' defines { 'NDEBUG' } kind 'ConsoleApp' includedirs { '../testlib', '../code' } + defines { '_COVERAGE_ON' } filter { 'action:vs*' } warnings 'high' diff --git a/make/testlib.make b/make/testlib.make index 2a061c1..0f18019 100644 --- a/make/testlib.make +++ b/make/testlib.make @@ -22,12 +22,12 @@ RESCOMP = windres TARGETDIR = ../build/linux/lib TARGET = $(TARGETDIR)/libtestlib.a OBJDIR = ../build/linux/ci/testlib -DEFINES += -DNDEBUG +DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += LDDEPS += From 13fb522d9b65072f5eb0533c45b274fb5fc3174f Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Mon, 30 Dec 2024 23:58:03 +0100 Subject: [PATCH 02/15] interim with CTC cmake --- make/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/make/CMakeLists.txt b/make/CMakeLists.txt index b089688..548d879 100644 --- a/make/CMakeLists.txt +++ b/make/CMakeLists.txt @@ -18,7 +18,6 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_LIST_DIR}) include_directories ( ${CODE_PATH} ${TESTLIB_PATH} - # ${TESTS_PATH} ) set(CMAKE_CXX_COMPILER_FORCED TRUE) From bbe7e70f73e28578b8cc4d8b2b9676ced7fcf4b2 Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Wed, 22 Jan 2025 19:08:30 +0100 Subject: [PATCH 03/15] some modifications --- code/CoverageMacro.h | 31 +++----- code/CoverageMcpp.h | 53 +++++++++++++ code/CoverageTpl.h | 14 +++- make/Makefile | 11 ++- make/Test_All.make | 170 ++++++++++++++++++++++++++++++++++++++++ make/be_build_n_run.cmd | 2 +- make/premake5.lua | 3 + tests/Test_Macro.cpp | 4 +- tests/Test_Mod_Cpp.cpp | 36 ++++++++- tests/Test_Standard.cpp | 5 +- 10 files changed, 299 insertions(+), 30 deletions(-) create mode 100644 make/Test_All.make diff --git a/code/CoverageMacro.h b/code/CoverageMacro.h index 2894650..26cc9db 100644 --- a/code/CoverageMacro.h +++ b/code/CoverageMacro.h @@ -3,41 +3,30 @@ #define COVERAGE_MACRO_H #include -#include -#define MODULE_TEST +#define MAX(V1, V2) (((V1) > (V2)) ? (V1) : (V2)) -// private members and public getters +// private members, public getters and setters #define MEMBER(TYPE, NAME, VAL) \ private: TYPE m ## NAME = VAL; \ -public: inline TYPE get ## NAME() const { return m ## NAME; } - -// in module test also public setters -#ifdef MODULE_TEST -#define SETTER(TYPE, NAME) \ -public: inline void set ## NAME(const TYPE val) { m ## NAME = val; } -#else -#define SETTER(TYPE, NAME) -#endif +public: \ +inline TYPE get ## NAME() const { return m ## NAME; } \ +inline void set ## NAME(const TYPE val) { m ## NAME = val; } class CoverageMacro { public: INSTANCE_DEC(CoverageMacro) + inline CoverageMacro(int i1=1, int i2=2): + mInt(MAX(i1, i2)) + {} + // members and getters MEMBER(bool, Bool1, false) MEMBER(int, Int1, 11) - // test code setters: no coverage - BULLSEY_PAUSE - #pragma CTC SKIP - - SETTER(bool, Bool1) - SETTER(int, Int1) - - #pragma CTC ENDSKIP - BULLSEY_RESUME + const int mInt; }; #endif // _H diff --git a/code/CoverageMcpp.h b/code/CoverageMcpp.h index ee07f20..5b3d0b9 100644 --- a/code/CoverageMcpp.h +++ b/code/CoverageMcpp.h @@ -69,4 +69,57 @@ class CoverageMcpp const SomeStruct mStruct; }; +template +class CoverageInline +{ +public: + CoverageInline() = delete; + inline static bool isNeg() { return IsNeg or I < 0; } + inline static int val() { return IsNeg ? Val : -Val; } + inline static bool func() + { + if constexpr (I < 0) + { + return true; + } + else + { + return false; + } + } + +private: + // static const bool and + const static bool IsNeg = B and I < 0; + // static const int ternary + const static int Val = IsNeg ? I : -I; +}; + +template +class CoverageConstExpr +{ +public: + CoverageConstExpr() = delete; + constexpr static bool isNeg() { return IsNeg or I < 0; } + constexpr static int val() { return IsNeg ? Val : -Val; } + constexpr static bool func() + { + if constexpr (I < 0) + { + return true; + } + else + { + return false; + } + } +private: + // static const bool and + constexpr static bool IsNeg = B and I < 0; + // static const int ternary + constexpr static int Val = IsNeg ? I : -I; +}; + + + #endif // _H diff --git a/code/CoverageTpl.h b/code/CoverageTpl.h index 3b52c4d..3f8d870 100644 --- a/code/CoverageTpl.h +++ b/code/CoverageTpl.h @@ -18,16 +18,24 @@ class CoverageTpl #define MAX(V1, V2) (((V1) > (V2)) ? (V1) : (V2)) template -class ByteBuffer +class ByteBufferHeap { public: - inline ByteBuffer(): + inline ByteBufferHeap(): mBytes(new unsigned char[MAX(sizeof(T1), sizeof(T2))]) {} - inline ~ByteBuffer() { delete[] mBytes; } + inline ~ByteBufferHeap() { delete[] mBytes; } private: unsigned char* mBytes; }; +template +class ByteBufferStack +{ +public: + inline ByteBufferStack() = default; +private: + unsigned char mBytes[MAX(sizeof(T1), sizeof(T2))]; +}; #endif // _H diff --git a/make/Makefile b/make/Makefile index bb49fb4..94e15b0 100644 --- a/make/Makefile +++ b/make/Makefile @@ -17,13 +17,14 @@ ifeq ($(config),ci) Test_FD_SET_Macro_config = ci Test_Macro_config = ci Test_Mod_Cpp_config = ci + Test_All_config = ci testlib_config = ci else $(error "invalid configuration $(config)") endif -PROJECTS := Test_Standard Test_Standard_Part Test_B_Macro Test_Count Test_Exclude Test_FD_SET_Macro Test_Macro Test_Mod_Cpp testlib +PROJECTS := Test_Standard Test_Standard_Part Test_B_Macro Test_Count Test_Exclude Test_FD_SET_Macro Test_Macro Test_Mod_Cpp Test_All testlib .PHONY: all clean help $(PROJECTS) @@ -77,6 +78,12 @@ ifneq (,$(Test_Mod_Cpp_config)) @${MAKE} --no-print-directory -C . -f Test_Mod_Cpp.make config=$(Test_Mod_Cpp_config) endif +Test_All: testlib +ifneq (,$(Test_All_config)) + @echo "==== Building Test_All ($(Test_All_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_All.make config=$(Test_All_config) +endif + testlib: ifneq (,$(testlib_config)) @echo "==== Building testlib ($(testlib_config)) ====" @@ -92,6 +99,7 @@ clean: @${MAKE} --no-print-directory -C . -f Test_FD_SET_Macro.make clean @${MAKE} --no-print-directory -C . -f Test_Macro.make clean @${MAKE} --no-print-directory -C . -f Test_Mod_Cpp.make clean + @${MAKE} --no-print-directory -C . -f Test_All.make clean @${MAKE} --no-print-directory -C . -f testlib.make clean help: @@ -111,6 +119,7 @@ help: @echo " Test_FD_SET_Macro" @echo " Test_Macro" @echo " Test_Mod_Cpp" + @echo " Test_All" @echo " testlib" @echo "" @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/make/Test_All.make b/make/Test_All.make new file mode 100644 index 0000000..6083d12 --- /dev/null +++ b/make/Test_All.make @@ -0,0 +1,170 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=ci +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq ($(shell echo "test"), "test") + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +TARGETDIR = ../build +TARGET = $(TARGETDIR)/Test_All +OBJDIR = ../build/linux/ci/Test_All +DEFINES += -DNDEBUG -D_COVERAGE_ON +INCLUDES += -I../testlib -I../code +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += ../build/linux/lib/libtestlib.a +LDDEPS += ../build/linux/lib/libtestlib.a +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -s +LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +# Per File Configurations +# ############################################# + + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/CoverageMacro.o +GENERATED += $(OBJDIR)/CoverageSrc.o +GENERATED += $(OBJDIR)/Test_B_Macro.o +GENERATED += $(OBJDIR)/Test_Count.o +GENERATED += $(OBJDIR)/Test_Exclude.o +GENERATED += $(OBJDIR)/Test_FD_SET_Macro.o +GENERATED += $(OBJDIR)/Test_Macro.o +GENERATED += $(OBJDIR)/Test_Mod_Cpp.o +GENERATED += $(OBJDIR)/Test_Standard.o +GENERATED += $(OBJDIR)/Test_Standard_Part.o +OBJECTS += $(OBJDIR)/CoverageMacro.o +OBJECTS += $(OBJDIR)/CoverageSrc.o +OBJECTS += $(OBJDIR)/Test_B_Macro.o +OBJECTS += $(OBJDIR)/Test_Count.o +OBJECTS += $(OBJDIR)/Test_Exclude.o +OBJECTS += $(OBJDIR)/Test_FD_SET_Macro.o +OBJECTS += $(OBJDIR)/Test_Macro.o +OBJECTS += $(OBJDIR)/Test_Mod_Cpp.o +OBJECTS += $(OBJDIR)/Test_Standard.o +OBJECTS += $(OBJDIR)/Test_Standard_Part.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking Test_All + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning Test_All +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/CoverageMacro.o: ../code/CoverageMacro.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/CoverageSrc.o: ../code/CoverageSrc.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Test_B_Macro.o: ../tests/Test_B_Macro.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Test_Count.o: ../tests/Test_Count.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Test_Exclude.o: ../tests/Test_Exclude.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Test_FD_SET_Macro.o: ../tests/Test_FD_SET_Macro.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Test_Macro.o: ../tests/Test_Macro.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Test_Mod_Cpp.o: ../tests/Test_Mod_Cpp.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Test_Standard.o: ../tests/Test_Standard.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Test_Standard_Part.o: ../tests/Test_Standard_Part.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/make/be_build_n_run.cmd b/make/be_build_n_run.cmd index 9da7918..812f6d0 100644 --- a/make/be_build_n_run.cmd +++ b/make/be_build_n_run.cmd @@ -45,5 +45,5 @@ if %errorlevel% neq 0 ( if %_html% covhtml -q --allNum --srcdir . %reportsDir%\html_%target%_cov ) covsrc -q --srcdir . >> %covReport% -covsrc -q -c --srcdir . > %reportsDir%\csv_%target%_cov.csv +covsrc -q -c --srcdir . | sed "s/,/;/g" > %reportsDir%\csv_%target%_cov.csv del %exe% diff --git a/make/premake5.lua b/make/premake5.lua index fbeadcb..3ed7fbd 100644 --- a/make/premake5.lua +++ b/make/premake5.lua @@ -50,6 +50,9 @@ workspace 'Tests' project 'Test_Mod_Cpp' files { '../tests/Test_Mod_Cpp.cpp' } + project 'Test_All' + files { '../tests/*.cpp', '../code/*.cpp' } + project 'testlib' kind 'StaticLib' targetdir '../build/%{_TARGET_OS}/lib' diff --git a/tests/Test_Macro.cpp b/tests/Test_Macro.cpp index e292956..6a890ae 100644 --- a/tests/Test_Macro.cpp +++ b/tests/Test_Macro.cpp @@ -5,8 +5,10 @@ TEST(Macro) { - const CoverageMacro& cm = CoverageMacro::instance(); + CoverageMacro& cm = CoverageMacro::instance(); const bool b = cm.getBool1(); const int i = cm.getInt1(); + cm.setInt1(42); + cm.setBool1(true); use(b, i); } diff --git a/tests/Test_Mod_Cpp.cpp b/tests/Test_Mod_Cpp.cpp index a6573d1..3ca7fc4 100644 --- a/tests/Test_Mod_Cpp.cpp +++ b/tests/Test_Mod_Cpp.cpp @@ -3,7 +3,7 @@ #include #include -TEST(Mod_Cpp) +TEST(Mod_Cpp_1) { { CoverageMcpp c0(0); @@ -20,3 +20,37 @@ TEST(Mod_Cpp) CoverageMcpp::assignments(1, 0); CoverageMcpp::assignments(1, 1); } + +TEST(Mod_Cpp_2) +{ + bool b = false; + int i = 0; + b = CoverageInline::isNeg(); + b = CoverageInline::isNeg(); + b = CoverageInline::isNeg(); + b = CoverageInline::isNeg(); + + b = CoverageInline::func(); + b = CoverageInline::func(); + + i = CoverageInline::val(); + i = CoverageInline::val(); + use(b, i); +} + +TEST(Mod_Cpp_3) +{ + bool b = false; + int i = 0; + b = CoverageConstExpr::isNeg(); + b = CoverageConstExpr::isNeg(); + b = CoverageConstExpr::isNeg(); + b = CoverageConstExpr::isNeg(); + + b = CoverageConstExpr::func(); + b = CoverageConstExpr::func(); + + i = CoverageConstExpr::val(); + i = CoverageConstExpr::val(); + use(b, i); +} diff --git a/tests/Test_Standard.cpp b/tests/Test_Standard.cpp index 24d0336..869fdff 100644 --- a/tests/Test_Standard.cpp +++ b/tests/Test_Standard.cpp @@ -123,6 +123,7 @@ TEST(Standard_2) b = CoverageTpl::isNeg(); i = CoverageTpl::val(); - ByteBuffer bb; - use(b, i, bb); + ByteBufferHeap bbh; + ByteBufferStack bbs; + use(b, i, bbh, bbs); } From cdb555d42e600a6efdf2c55f6c876a606e9541f5 Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Sun, 23 Mar 2025 14:52:36 +0100 Subject: [PATCH 04/15] precommit --- .gitHooks/pre-commit | 23 +++++++---------------- submodules/sompy | 2 +- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.gitHooks/pre-commit b/.gitHooks/pre-commit index 208f0ea..34bcd61 100644 --- a/.gitHooks/pre-commit +++ b/.gitHooks/pre-commit @@ -4,7 +4,7 @@ # availabilty of python py=$(which py || which python || which python3) if [[ -z $py ]] -then +then echo "No python found" exit 0 fi @@ -15,22 +15,13 @@ cd $(git rev-parse --show-toplevel) # path to sompy python scripts sompy=$(pwd)/submodules/sompy/somutil -# files regarded as text files to be cleaned -txts= -# extensions of text files sorted by likeliness -xtxt="h cpp cmd py md lua sh yml" +txts=() for file in $(git diff-index --cached --name-only HEAD); do - if [[ -f $file ]] - then - for ext in $xtxt; do - if [[ $file == *.$ext ]]; then txts="$txts $file"; break; fi - done - fi + if [ -f $file ]; then txts+=($file); fi done -if [[ -n $txts ]]; then - echo cleaning text files - $py $sompy/cleanTxt.py -l $txts -fi -for file in $txts; do git add $file; done +echo txt: ${#txts[@]} +done=$($py $sompy/cleanTxt.py -le ${txts[@]}) + +for file in $done; do git add $file; done diff --git a/submodules/sompy b/submodules/sompy index c39bb1c..167252f 160000 --- a/submodules/sompy +++ b/submodules/sompy @@ -1 +1 @@ -Subproject commit c39bb1ce3e0692d04551ebf7675c209ce36bc1a2 +Subproject commit 167252f6c3a8d2a2d2af9f5daa77ebd47ebfa3d0 From 824e1deaafcb714c8ba2978e740e3d65efb88a53 Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Sun, 23 Mar 2025 23:09:54 +0100 Subject: [PATCH 05/15] interim --- .gitignore | 2 +- make/Makefile | 104 +++++++++---------- make/Test_All.make | 103 +++++++++--------- make/Test_B_Macro.make | 67 ++++++------ make/Test_Count.make | 67 ++++++------ make/Test_Exclude.make | 67 ++++++------ make/Test_FD_SET_Macro.make | 67 ++++++------ make/Test_Macro.make | 71 +++++++------ make/Test_Mod_Cpp.make | 67 ++++++------ make/Test_Standard.make | 71 +++++++------ make/Test_Standard_Part.make | 71 +++++++------ make/testlib.make | 69 ++++++------ {make => scripts}/BullseyeCoverageExclusions | 0 {make => scripts}/Bullseye_msbuild.cmd | 0 {make => scripts}/CMakeLists.txt | 0 {make => scripts}/CTC_msbuild.cmd | 2 +- {make => scripts}/README.md | 0 {make => scripts}/be_build_n_run.cmd | 2 +- {make => scripts}/be_off.cmd | 0 {make => scripts}/ci.sh | 0 {make => scripts}/ctc_build_n_run.cmd | 0 {make => scripts}/ctc_report.htm | 3 +- {make => scripts}/options.txt | 0 {make => scripts}/premake5.lua | 8 +- {make => scripts}/setup.cmd | 16 +-- tests/Test_Standard_Part.cpp | 4 +- 26 files changed, 478 insertions(+), 383 deletions(-) rename {make => scripts}/BullseyeCoverageExclusions (100%) rename {make => scripts}/Bullseye_msbuild.cmd (100%) rename {make => scripts}/CMakeLists.txt (100%) rename {make => scripts}/CTC_msbuild.cmd (83%) rename {make => scripts}/README.md (100%) rename {make => scripts}/be_build_n_run.cmd (97%) rename {make => scripts}/be_off.cmd (100%) rename {make => scripts}/ci.sh (100%) rename {make => scripts}/ctc_build_n_run.cmd (100%) rename {make => scripts}/ctc_report.htm (98%) rename {make => scripts}/options.txt (100%) rename {make => scripts}/premake5.lua (93%) rename {make => scripts}/setup.cmd (77%) diff --git a/.gitignore b/.gitignore index eacaffe..13561b3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ MON.* *.log tmp* *.ctc +vs # Prerequisites *.d @@ -50,4 +51,3 @@ tmp* *.exe *.out *.app - diff --git a/make/Makefile b/make/Makefile index 94e15b0..ae78380 100644 --- a/make/Makefile +++ b/make/Makefile @@ -1,4 +1,4 @@ -# Alternative GNU Make workspace makefile autogenerated by Premake +# GNU Make workspace makefile autogenerated by Premake ifndef config config=ci @@ -26,100 +26,100 @@ endif PROJECTS := Test_Standard Test_Standard_Part Test_B_Macro Test_Count Test_Exclude Test_FD_SET_Macro Test_Macro Test_Mod_Cpp Test_All testlib -.PHONY: all clean help $(PROJECTS) +.PHONY: all clean help $(PROJECTS) all: $(PROJECTS) Test_Standard: testlib ifneq (,$(Test_Standard_config)) - @echo "==== Building Test_Standard ($(Test_Standard_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Standard.make config=$(Test_Standard_config) + @echo "==== Building Test_Standard ($(Test_Standard_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Standard.make config=$(Test_Standard_config) endif Test_Standard_Part: testlib ifneq (,$(Test_Standard_Part_config)) - @echo "==== Building Test_Standard_Part ($(Test_Standard_Part_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Standard_Part.make config=$(Test_Standard_Part_config) + @echo "==== Building Test_Standard_Part ($(Test_Standard_Part_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Standard_Part.make config=$(Test_Standard_Part_config) endif Test_B_Macro: testlib ifneq (,$(Test_B_Macro_config)) - @echo "==== Building Test_B_Macro ($(Test_B_Macro_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_B_Macro.make config=$(Test_B_Macro_config) + @echo "==== Building Test_B_Macro ($(Test_B_Macro_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_B_Macro.make config=$(Test_B_Macro_config) endif Test_Count: testlib ifneq (,$(Test_Count_config)) - @echo "==== Building Test_Count ($(Test_Count_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Count.make config=$(Test_Count_config) + @echo "==== Building Test_Count ($(Test_Count_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Count.make config=$(Test_Count_config) endif Test_Exclude: testlib ifneq (,$(Test_Exclude_config)) - @echo "==== Building Test_Exclude ($(Test_Exclude_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Exclude.make config=$(Test_Exclude_config) + @echo "==== Building Test_Exclude ($(Test_Exclude_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Exclude.make config=$(Test_Exclude_config) endif Test_FD_SET_Macro: testlib ifneq (,$(Test_FD_SET_Macro_config)) - @echo "==== Building Test_FD_SET_Macro ($(Test_FD_SET_Macro_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_FD_SET_Macro.make config=$(Test_FD_SET_Macro_config) + @echo "==== Building Test_FD_SET_Macro ($(Test_FD_SET_Macro_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_FD_SET_Macro.make config=$(Test_FD_SET_Macro_config) endif Test_Macro: testlib ifneq (,$(Test_Macro_config)) - @echo "==== Building Test_Macro ($(Test_Macro_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Macro.make config=$(Test_Macro_config) + @echo "==== Building Test_Macro ($(Test_Macro_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Macro.make config=$(Test_Macro_config) endif Test_Mod_Cpp: testlib ifneq (,$(Test_Mod_Cpp_config)) - @echo "==== Building Test_Mod_Cpp ($(Test_Mod_Cpp_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Mod_Cpp.make config=$(Test_Mod_Cpp_config) + @echo "==== Building Test_Mod_Cpp ($(Test_Mod_Cpp_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Mod_Cpp.make config=$(Test_Mod_Cpp_config) endif Test_All: testlib ifneq (,$(Test_All_config)) - @echo "==== Building Test_All ($(Test_All_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_All.make config=$(Test_All_config) + @echo "==== Building Test_All ($(Test_All_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_All.make config=$(Test_All_config) endif testlib: ifneq (,$(testlib_config)) - @echo "==== Building testlib ($(testlib_config)) ====" - @${MAKE} --no-print-directory -C . -f testlib.make config=$(testlib_config) + @echo "==== Building testlib ($(testlib_config)) ====" + @${MAKE} --no-print-directory -C . -f testlib.make config=$(testlib_config) endif clean: - @${MAKE} --no-print-directory -C . -f Test_Standard.make clean - @${MAKE} --no-print-directory -C . -f Test_Standard_Part.make clean - @${MAKE} --no-print-directory -C . -f Test_B_Macro.make clean - @${MAKE} --no-print-directory -C . -f Test_Count.make clean - @${MAKE} --no-print-directory -C . -f Test_Exclude.make clean - @${MAKE} --no-print-directory -C . -f Test_FD_SET_Macro.make clean - @${MAKE} --no-print-directory -C . -f Test_Macro.make clean - @${MAKE} --no-print-directory -C . -f Test_Mod_Cpp.make clean - @${MAKE} --no-print-directory -C . -f Test_All.make clean - @${MAKE} --no-print-directory -C . -f testlib.make clean + @${MAKE} --no-print-directory -C . -f Test_Standard.make clean + @${MAKE} --no-print-directory -C . -f Test_Standard_Part.make clean + @${MAKE} --no-print-directory -C . -f Test_B_Macro.make clean + @${MAKE} --no-print-directory -C . -f Test_Count.make clean + @${MAKE} --no-print-directory -C . -f Test_Exclude.make clean + @${MAKE} --no-print-directory -C . -f Test_FD_SET_Macro.make clean + @${MAKE} --no-print-directory -C . -f Test_Macro.make clean + @${MAKE} --no-print-directory -C . -f Test_Mod_Cpp.make clean + @${MAKE} --no-print-directory -C . -f Test_All.make clean + @${MAKE} --no-print-directory -C . -f testlib.make clean help: - @echo "Usage: make [config=name] [target]" - @echo "" - @echo "CONFIGURATIONS:" - @echo " ci" - @echo "" - @echo "TARGETS:" - @echo " all (default)" - @echo " clean" - @echo " Test_Standard" - @echo " Test_Standard_Part" - @echo " Test_B_Macro" - @echo " Test_Count" - @echo " Test_Exclude" - @echo " Test_FD_SET_Macro" - @echo " Test_Macro" - @echo " Test_Mod_Cpp" - @echo " Test_All" - @echo " testlib" - @echo "" - @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file + @echo "Usage: make [config=name] [target]" + @echo "" + @echo "CONFIGURATIONS:" + @echo " ci" + @echo "" + @echo "TARGETS:" + @echo " all (default)" + @echo " clean" + @echo " Test_Standard" + @echo " Test_Standard_Part" + @echo " Test_B_Macro" + @echo " Test_Count" + @echo " Test_Exclude" + @echo " Test_FD_SET_Macro" + @echo " Test_Macro" + @echo " Test_Mod_Cpp" + @echo " Test_All" + @echo " testlib" + @echo "" + @echo "For more information, see https://github.com/premake/premake-core/wiki" diff --git a/make/Test_All.make b/make/Test_All.make index 6083d12..097d503 100644 --- a/make/Test_All.make +++ b/make/Test_All.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -12,14 +12,23 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres -TARGETDIR = ../build +TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_All OBJDIR = ../build/linux/ci/Test_All DEFINES += -DNDEBUG -D_COVERAGE_ON @@ -75,55 +84,55 @@ OBJECTS += $(OBJDIR)/Test_Standard_Part.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_All - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_All + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_All + @echo Cleaning Test_All ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -134,37 +143,37 @@ endif # ############################################# $(OBJDIR)/CoverageMacro.o: ../code/CoverageMacro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/CoverageSrc.o: ../code/CoverageSrc.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_B_Macro.o: ../tests/Test_B_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Count.o: ../tests/Test_Count.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Exclude.o: ../tests/Test_Exclude.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_FD_SET_Macro.o: ../tests/Test_FD_SET_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Macro.o: ../tests/Test_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Mod_Cpp.o: ../tests/Test_Mod_Cpp.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Standard.o: ../tests/Test_Standard.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Standard_Part.o: ../tests/Test_Standard_Part.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file +endif diff --git a/make/Test_B_Macro.make b/make/Test_B_Macro.make index 9eee31d..83d37d7 100644 --- a/make/Test_B_Macro.make +++ b/make/Test_B_Macro.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -12,14 +12,23 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres -TARGETDIR = ../build +TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_B_Macro OBJDIR = ../build/linux/ci/Test_B_Macro DEFINES += -DNDEBUG -D_COVERAGE_ON @@ -57,55 +66,55 @@ OBJECTS += $(OBJDIR)/Test_B_Macro.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_B_Macro - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_B_Macro + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_B_Macro + @echo Cleaning Test_B_Macro ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -116,10 +125,10 @@ endif # ############################################# $(OBJDIR)/Test_B_Macro.o: ../tests/Test_B_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file +endif diff --git a/make/Test_Count.make b/make/Test_Count.make index abc3855..92814a3 100644 --- a/make/Test_Count.make +++ b/make/Test_Count.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -12,14 +12,23 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres -TARGETDIR = ../build +TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Count OBJDIR = ../build/linux/ci/Test_Count DEFINES += -DNDEBUG -D_COVERAGE_ON @@ -57,55 +66,55 @@ OBJECTS += $(OBJDIR)/Test_Count.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Count - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Count + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Count + @echo Cleaning Test_Count ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -116,10 +125,10 @@ endif # ############################################# $(OBJDIR)/Test_Count.o: ../tests/Test_Count.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file +endif diff --git a/make/Test_Exclude.make b/make/Test_Exclude.make index 064979d..e8dc9c4 100644 --- a/make/Test_Exclude.make +++ b/make/Test_Exclude.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -12,14 +12,23 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres -TARGETDIR = ../build +TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Exclude OBJDIR = ../build/linux/ci/Test_Exclude DEFINES += -DNDEBUG -D_COVERAGE_ON @@ -57,55 +66,55 @@ OBJECTS += $(OBJDIR)/Test_Exclude.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Exclude - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Exclude + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Exclude + @echo Cleaning Test_Exclude ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -116,10 +125,10 @@ endif # ############################################# $(OBJDIR)/Test_Exclude.o: ../tests/Test_Exclude.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file +endif diff --git a/make/Test_FD_SET_Macro.make b/make/Test_FD_SET_Macro.make index 4068ea2..bf33d23 100644 --- a/make/Test_FD_SET_Macro.make +++ b/make/Test_FD_SET_Macro.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -12,14 +12,23 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres -TARGETDIR = ../build +TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_FD_SET_Macro OBJDIR = ../build/linux/ci/Test_FD_SET_Macro DEFINES += -DNDEBUG -D_COVERAGE_ON @@ -57,55 +66,55 @@ OBJECTS += $(OBJDIR)/Test_FD_SET_Macro.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_FD_SET_Macro - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_FD_SET_Macro + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_FD_SET_Macro + @echo Cleaning Test_FD_SET_Macro ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -116,10 +125,10 @@ endif # ############################################# $(OBJDIR)/Test_FD_SET_Macro.o: ../tests/Test_FD_SET_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file +endif diff --git a/make/Test_Macro.make b/make/Test_Macro.make index 86449cc..61bd4a5 100644 --- a/make/Test_Macro.make +++ b/make/Test_Macro.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -12,14 +12,23 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres -TARGETDIR = ../build +TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Macro OBJDIR = ../build/linux/ci/Test_Macro DEFINES += -DNDEBUG -D_COVERAGE_ON @@ -59,55 +68,55 @@ OBJECTS += $(OBJDIR)/Test_Macro.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Macro - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Macro + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Macro + @echo Cleaning Test_Macro ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -118,13 +127,13 @@ endif # ############################################# $(OBJDIR)/CoverageMacro.o: ../code/CoverageMacro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Macro.o: ../tests/Test_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file +endif diff --git a/make/Test_Mod_Cpp.make b/make/Test_Mod_Cpp.make index 8cb8636..32dfff6 100644 --- a/make/Test_Mod_Cpp.make +++ b/make/Test_Mod_Cpp.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -12,14 +12,23 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres -TARGETDIR = ../build +TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Mod_Cpp OBJDIR = ../build/linux/ci/Test_Mod_Cpp DEFINES += -DNDEBUG -D_COVERAGE_ON @@ -57,55 +66,55 @@ OBJECTS += $(OBJDIR)/Test_Mod_Cpp.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Mod_Cpp - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Mod_Cpp + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Mod_Cpp + @echo Cleaning Test_Mod_Cpp ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -116,10 +125,10 @@ endif # ############################################# $(OBJDIR)/Test_Mod_Cpp.o: ../tests/Test_Mod_Cpp.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file +endif diff --git a/make/Test_Standard.make b/make/Test_Standard.make index d8213d6..eb01ffa 100644 --- a/make/Test_Standard.make +++ b/make/Test_Standard.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -12,14 +12,23 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres -TARGETDIR = ../build +TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Standard OBJDIR = ../build/linux/ci/Test_Standard DEFINES += -DNDEBUG -D_COVERAGE_ON @@ -59,55 +68,55 @@ OBJECTS += $(OBJDIR)/Test_Standard.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Standard - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Standard + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Standard + @echo Cleaning Test_Standard ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -118,13 +127,13 @@ endif # ############################################# $(OBJDIR)/CoverageSrc.o: ../code/CoverageSrc.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Standard.o: ../tests/Test_Standard.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file +endif diff --git a/make/Test_Standard_Part.make b/make/Test_Standard_Part.make index 94ad2b1..13473f2 100644 --- a/make/Test_Standard_Part.make +++ b/make/Test_Standard_Part.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -12,14 +12,23 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres -TARGETDIR = ../build +TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Standard_Part OBJDIR = ../build/linux/ci/Test_Standard_Part DEFINES += -DNDEBUG -D_COVERAGE_ON @@ -59,55 +68,55 @@ OBJECTS += $(OBJDIR)/Test_Standard_Part.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Standard_Part - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Standard_Part + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Standard_Part + @echo Cleaning Test_Standard_Part ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -118,13 +127,13 @@ endif # ############################################# $(OBJDIR)/CoverageSrc.o: ../code/CoverageSrc.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Standard_Part.o: ../tests/Test_Standard_Part.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file +endif diff --git a/make/testlib.make b/make/testlib.make index 0f18019..e08b388 100644 --- a/make/testlib.make +++ b/make/testlib.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -12,12 +12,21 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres TARGETDIR = ../build/linux/lib TARGET = $(TARGETDIR)/libtestlib.a @@ -59,55 +68,55 @@ OBJECTS += $(OBJDIR)/testlib.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking testlib - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking testlib + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning testlib + @echo Cleaning testlib ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -118,13 +127,13 @@ endif # ############################################# $(OBJDIR)/testMain.o: ../testlib/testMain.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/testlib.o: ../testlib/testlib.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file +endif diff --git a/make/BullseyeCoverageExclusions b/scripts/BullseyeCoverageExclusions similarity index 100% rename from make/BullseyeCoverageExclusions rename to scripts/BullseyeCoverageExclusions diff --git a/make/Bullseye_msbuild.cmd b/scripts/Bullseye_msbuild.cmd similarity index 100% rename from make/Bullseye_msbuild.cmd rename to scripts/Bullseye_msbuild.cmd diff --git a/make/CMakeLists.txt b/scripts/CMakeLists.txt similarity index 100% rename from make/CMakeLists.txt rename to scripts/CMakeLists.txt diff --git a/make/CTC_msbuild.cmd b/scripts/CTC_msbuild.cmd similarity index 83% rename from make/CTC_msbuild.cmd rename to scripts/CTC_msbuild.cmd index 70b2e82..ab0cd5d 100644 --- a/make/CTC_msbuild.cmd +++ b/scripts/CTC_msbuild.cmd @@ -13,7 +13,7 @@ call %myDir%\be_off.cmd set runSub=%myDir%\ctc_build_n_run.cmd set ctclaunchParams=-C "NO_EXCLUDE+*\code\*" -C "CONST_INSTR = ON" -i m -set ctcreportParams=-t 98 -nsb -shorten-path %rootDir%\ -include-justifications -restrict-to-files "*/code/*" -measures f,mcdc +set ctcreportParams=-t 98 -nsb -shorten-path %repo%\ -include-justifications -restrict-to-files "*/code/*" -measures f,mcdc set msbuildParams=-p:TrackFileAccess=false -m set monFile=%myDir%\MON.sym set datFile=%myDir%\MON.dat diff --git a/make/README.md b/scripts/README.md similarity index 100% rename from make/README.md rename to scripts/README.md diff --git a/make/be_build_n_run.cmd b/scripts/be_build_n_run.cmd similarity index 97% rename from make/be_build_n_run.cmd rename to scripts/be_build_n_run.cmd index 812f6d0..7c267c1 100644 --- a/make/be_build_n_run.cmd +++ b/scripts/be_build_n_run.cmd @@ -28,7 +28,7 @@ if %elevel% neq 0 ( del %buildLog% ) echo - report -set exe=%buildDir%\%target%.exe +set exe=%exeDir%\%target%.exe cd %srcDir% rem reset coverage data covclear -q diff --git a/make/be_off.cmd b/scripts/be_off.cmd similarity index 100% rename from make/be_off.cmd rename to scripts/be_off.cmd diff --git a/make/ci.sh b/scripts/ci.sh similarity index 100% rename from make/ci.sh rename to scripts/ci.sh diff --git a/make/ctc_build_n_run.cmd b/scripts/ctc_build_n_run.cmd similarity index 100% rename from make/ctc_build_n_run.cmd rename to scripts/ctc_build_n_run.cmd diff --git a/make/ctc_report.htm b/scripts/ctc_report.htm similarity index 98% rename from make/ctc_report.htm rename to scripts/ctc_report.htm index bf86429..05761d4 100644 --- a/make/ctc_report.htm +++ b/scripts/ctc_report.htm @@ -43,7 +43,6 @@ $Checkpoints$$Hits$$TER$% {CTC_LOOP_END("CoverageMeasures")} - + - diff --git a/make/options.txt b/scripts/options.txt similarity index 100% rename from make/options.txt rename to scripts/options.txt diff --git a/make/premake5.lua b/scripts/premake5.lua similarity index 93% rename from make/premake5.lua rename to scripts/premake5.lua index 3ed7fbd..c18b1f9 100644 --- a/make/premake5.lua +++ b/scripts/premake5.lua @@ -8,7 +8,6 @@ buildoptions_gcc = '-std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragm workspace 'Tests' configurations { 'ci' } language 'C++' - targetdir '../build' objdir '../build/%{_TARGET_OS}' defines { 'NDEBUG' } kind 'ConsoleApp' @@ -18,14 +17,20 @@ workspace 'Tests' filter { 'action:vs*' } warnings 'high' buildoptions { buildoptions_vs } + location '../vs' filter { 'action:gmake*' } buildoptions { buildoptions_gcc } + location '../make' filter { 'kind:ConsoleApp' } + targetdir '../build/%{_TARGET_OS}' libdirs { '../build/%{_TARGET_OS}/lib' } links { 'testlib' } + filter { 'kind:StaticLib' } + targetdir '../build/%{_TARGET_OS}/lib' + project 'Test_Standard' files { '../tests/Test_Standard.cpp', '../code/CoverageSrc.cpp' } @@ -55,5 +60,4 @@ workspace 'Tests' project 'testlib' kind 'StaticLib' - targetdir '../build/%{_TARGET_OS}/lib' files { '../testlib/*.cpp' } diff --git a/make/setup.cmd b/scripts/setup.cmd similarity index 77% rename from make/setup.cmd rename to scripts/setup.cmd index dd85e90..39983a7 100644 --- a/make/setup.cmd +++ b/scripts/setup.cmd @@ -5,17 +5,19 @@ if %_me%=="" exit /b 1 cd %~dp0 set myDir=%cd% cd .. -set rootDir=%cd% -set testsDir=%cd%\tests -set srcDir=%cd%\code -set buildDir=%cd%\build -set pyDir=%cd%\submodules\sompy -set reportsDir=%CD%\reports_%tool% +set repo=%cd% +set buildDir=%repo%\build +set exeDir=%buildDir%\windows +set pyDir=%repo%\submodules\sompy +set reportsDir=%repo%\reports_%tool% +set srcDir=%repo%\code +set testsDir=%repo%\tests +set vsDir=%repo%\vs set tmpCmd=%buildDir%\tmp.cmd set tmpFile=%buildDir%\tmp.tmp -set solution=%myDir%\Tests.sln +set solution=%vsDir%\Tests.sln if not exist %solution% ( echo use premake5 to generate %solution% diff --git a/tests/Test_Standard_Part.cpp b/tests/Test_Standard_Part.cpp index 981350e..0634b2c 100644 --- a/tests/Test_Standard_Part.cpp +++ b/tests/Test_Standard_Part.cpp @@ -123,6 +123,6 @@ TEST(Standard_Part_2) // b = CoverageTpl::isNeg(); // i = CoverageTpl::val(); - ByteBuffer bb; - use(b, i, bb); + ByteBufferStack bbs; + use(b, i, bbs); } From babc1c5f32a58f10e06b7744e2daa1ee1f4f3a32 Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Wed, 26 Mar 2025 11:04:07 +0100 Subject: [PATCH 06/15] pipeline --- .gitHooks/pre-commit | 11 +++- .github/workflows/c-cpp.yml | 2 +- make/Makefile | 102 +++++++++++++++++------------------ make/Test_All.make | 90 +++++++++++++++---------------- make/Test_B_Macro.make | 54 +++++++++---------- make/Test_Count.make | 54 +++++++++---------- make/Test_Exclude.make | 54 +++++++++---------- make/Test_FD_SET_Macro.make | 54 +++++++++---------- make/Test_Macro.make | 58 ++++++++++---------- make/Test_Mod_Cpp.make | 54 +++++++++---------- make/Test_Standard.make | 58 ++++++++++---------- make/Test_Standard_Part.make | 58 ++++++++++---------- make/testlib.make | 58 ++++++++++---------- 13 files changed, 358 insertions(+), 349 deletions(-) diff --git a/.gitHooks/pre-commit b/.gitHooks/pre-commit index 34bcd61..307746d 100644 --- a/.gitHooks/pre-commit +++ b/.gitHooks/pre-commit @@ -15,10 +15,19 @@ cd $(git rev-parse --show-toplevel) # path to sompy python scripts sompy=$(pwd)/submodules/sompy/somutil +# files to skip +skips="make/*" + txts=() for file in $(git diff-index --cached --name-only HEAD); do - if [ -f $file ]; then txts+=($file); fi + if [ -f $file ]; then + ok=true + for s in $skips; do + if [[ $file == $s ]]; then ok=false; break; fi + done + if $ok; then txts+=($file); fi + fi done echo txt: ${#txts[@]} diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index e5013f1..c4972fb 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -20,4 +20,4 @@ jobs: uses: actions/checkout@v3 - name: ci - run: cd make; chmod +x ci.sh; ./ci.sh + run: cd scripts; chmod +x ci.sh; ./ci.sh diff --git a/make/Makefile b/make/Makefile index ae78380..7eb9bbd 100644 --- a/make/Makefile +++ b/make/Makefile @@ -26,100 +26,100 @@ endif PROJECTS := Test_Standard Test_Standard_Part Test_B_Macro Test_Count Test_Exclude Test_FD_SET_Macro Test_Macro Test_Mod_Cpp Test_All testlib -.PHONY: all clean help $(PROJECTS) +.PHONY: all clean help $(PROJECTS) all: $(PROJECTS) Test_Standard: testlib ifneq (,$(Test_Standard_config)) - @echo "==== Building Test_Standard ($(Test_Standard_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Standard.make config=$(Test_Standard_config) + @echo "==== Building Test_Standard ($(Test_Standard_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Standard.make config=$(Test_Standard_config) endif Test_Standard_Part: testlib ifneq (,$(Test_Standard_Part_config)) - @echo "==== Building Test_Standard_Part ($(Test_Standard_Part_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Standard_Part.make config=$(Test_Standard_Part_config) + @echo "==== Building Test_Standard_Part ($(Test_Standard_Part_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Standard_Part.make config=$(Test_Standard_Part_config) endif Test_B_Macro: testlib ifneq (,$(Test_B_Macro_config)) - @echo "==== Building Test_B_Macro ($(Test_B_Macro_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_B_Macro.make config=$(Test_B_Macro_config) + @echo "==== Building Test_B_Macro ($(Test_B_Macro_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_B_Macro.make config=$(Test_B_Macro_config) endif Test_Count: testlib ifneq (,$(Test_Count_config)) - @echo "==== Building Test_Count ($(Test_Count_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Count.make config=$(Test_Count_config) + @echo "==== Building Test_Count ($(Test_Count_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Count.make config=$(Test_Count_config) endif Test_Exclude: testlib ifneq (,$(Test_Exclude_config)) - @echo "==== Building Test_Exclude ($(Test_Exclude_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Exclude.make config=$(Test_Exclude_config) + @echo "==== Building Test_Exclude ($(Test_Exclude_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Exclude.make config=$(Test_Exclude_config) endif Test_FD_SET_Macro: testlib ifneq (,$(Test_FD_SET_Macro_config)) - @echo "==== Building Test_FD_SET_Macro ($(Test_FD_SET_Macro_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_FD_SET_Macro.make config=$(Test_FD_SET_Macro_config) + @echo "==== Building Test_FD_SET_Macro ($(Test_FD_SET_Macro_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_FD_SET_Macro.make config=$(Test_FD_SET_Macro_config) endif Test_Macro: testlib ifneq (,$(Test_Macro_config)) - @echo "==== Building Test_Macro ($(Test_Macro_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Macro.make config=$(Test_Macro_config) + @echo "==== Building Test_Macro ($(Test_Macro_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Macro.make config=$(Test_Macro_config) endif Test_Mod_Cpp: testlib ifneq (,$(Test_Mod_Cpp_config)) - @echo "==== Building Test_Mod_Cpp ($(Test_Mod_Cpp_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_Mod_Cpp.make config=$(Test_Mod_Cpp_config) + @echo "==== Building Test_Mod_Cpp ($(Test_Mod_Cpp_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_Mod_Cpp.make config=$(Test_Mod_Cpp_config) endif Test_All: testlib ifneq (,$(Test_All_config)) - @echo "==== Building Test_All ($(Test_All_config)) ====" - @${MAKE} --no-print-directory -C . -f Test_All.make config=$(Test_All_config) + @echo "==== Building Test_All ($(Test_All_config)) ====" + @${MAKE} --no-print-directory -C . -f Test_All.make config=$(Test_All_config) endif testlib: ifneq (,$(testlib_config)) - @echo "==== Building testlib ($(testlib_config)) ====" - @${MAKE} --no-print-directory -C . -f testlib.make config=$(testlib_config) + @echo "==== Building testlib ($(testlib_config)) ====" + @${MAKE} --no-print-directory -C . -f testlib.make config=$(testlib_config) endif clean: - @${MAKE} --no-print-directory -C . -f Test_Standard.make clean - @${MAKE} --no-print-directory -C . -f Test_Standard_Part.make clean - @${MAKE} --no-print-directory -C . -f Test_B_Macro.make clean - @${MAKE} --no-print-directory -C . -f Test_Count.make clean - @${MAKE} --no-print-directory -C . -f Test_Exclude.make clean - @${MAKE} --no-print-directory -C . -f Test_FD_SET_Macro.make clean - @${MAKE} --no-print-directory -C . -f Test_Macro.make clean - @${MAKE} --no-print-directory -C . -f Test_Mod_Cpp.make clean - @${MAKE} --no-print-directory -C . -f Test_All.make clean - @${MAKE} --no-print-directory -C . -f testlib.make clean + @${MAKE} --no-print-directory -C . -f Test_Standard.make clean + @${MAKE} --no-print-directory -C . -f Test_Standard_Part.make clean + @${MAKE} --no-print-directory -C . -f Test_B_Macro.make clean + @${MAKE} --no-print-directory -C . -f Test_Count.make clean + @${MAKE} --no-print-directory -C . -f Test_Exclude.make clean + @${MAKE} --no-print-directory -C . -f Test_FD_SET_Macro.make clean + @${MAKE} --no-print-directory -C . -f Test_Macro.make clean + @${MAKE} --no-print-directory -C . -f Test_Mod_Cpp.make clean + @${MAKE} --no-print-directory -C . -f Test_All.make clean + @${MAKE} --no-print-directory -C . -f testlib.make clean help: - @echo "Usage: make [config=name] [target]" - @echo "" - @echo "CONFIGURATIONS:" - @echo " ci" - @echo "" - @echo "TARGETS:" - @echo " all (default)" - @echo " clean" - @echo " Test_Standard" - @echo " Test_Standard_Part" - @echo " Test_B_Macro" - @echo " Test_Count" - @echo " Test_Exclude" - @echo " Test_FD_SET_Macro" - @echo " Test_Macro" - @echo " Test_Mod_Cpp" - @echo " Test_All" - @echo " testlib" - @echo "" - @echo "For more information, see https://github.com/premake/premake-core/wiki" + @echo "Usage: make [config=name] [target]" + @echo "" + @echo "CONFIGURATIONS:" + @echo " ci" + @echo "" + @echo "TARGETS:" + @echo " all (default)" + @echo " clean" + @echo " Test_Standard" + @echo " Test_Standard_Part" + @echo " Test_B_Macro" + @echo " Test_Count" + @echo " Test_Exclude" + @echo " Test_FD_SET_Macro" + @echo " Test_Macro" + @echo " Test_Mod_Cpp" + @echo " Test_All" + @echo " testlib" + @echo "" + @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/make/Test_All.make b/make/Test_All.make index 097d503..026e128 100644 --- a/make/Test_All.make +++ b/make/Test_All.make @@ -12,7 +12,7 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations @@ -84,55 +84,55 @@ OBJECTS += $(OBJDIR)/Test_Standard_Part.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_All - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_All + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_All + @echo Cleaning Test_All ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -143,37 +143,37 @@ endif # ############################################# $(OBJDIR)/CoverageMacro.o: ../code/CoverageMacro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/CoverageSrc.o: ../code/CoverageSrc.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_B_Macro.o: ../tests/Test_B_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Count.o: ../tests/Test_Count.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Exclude.o: ../tests/Test_Exclude.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_FD_SET_Macro.o: ../tests/Test_FD_SET_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Macro.o: ../tests/Test_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Mod_Cpp.o: ../tests/Test_Mod_Cpp.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Standard.o: ../tests/Test_Standard.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Standard_Part.o: ../tests/Test_Standard_Part.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif +endif \ No newline at end of file diff --git a/make/Test_B_Macro.make b/make/Test_B_Macro.make index 83d37d7..21a6c61 100644 --- a/make/Test_B_Macro.make +++ b/make/Test_B_Macro.make @@ -12,7 +12,7 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations @@ -66,55 +66,55 @@ OBJECTS += $(OBJDIR)/Test_B_Macro.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_B_Macro - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_B_Macro + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_B_Macro + @echo Cleaning Test_B_Macro ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -125,10 +125,10 @@ endif # ############################################# $(OBJDIR)/Test_B_Macro.o: ../tests/Test_B_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif +endif \ No newline at end of file diff --git a/make/Test_Count.make b/make/Test_Count.make index 92814a3..2a5fedf 100644 --- a/make/Test_Count.make +++ b/make/Test_Count.make @@ -12,7 +12,7 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations @@ -66,55 +66,55 @@ OBJECTS += $(OBJDIR)/Test_Count.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Count - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Count + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Count + @echo Cleaning Test_Count ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -125,10 +125,10 @@ endif # ############################################# $(OBJDIR)/Test_Count.o: ../tests/Test_Count.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif +endif \ No newline at end of file diff --git a/make/Test_Exclude.make b/make/Test_Exclude.make index e8dc9c4..d422504 100644 --- a/make/Test_Exclude.make +++ b/make/Test_Exclude.make @@ -12,7 +12,7 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations @@ -66,55 +66,55 @@ OBJECTS += $(OBJDIR)/Test_Exclude.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Exclude - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Exclude + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Exclude + @echo Cleaning Test_Exclude ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -125,10 +125,10 @@ endif # ############################################# $(OBJDIR)/Test_Exclude.o: ../tests/Test_Exclude.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif +endif \ No newline at end of file diff --git a/make/Test_FD_SET_Macro.make b/make/Test_FD_SET_Macro.make index bf33d23..11e8c4f 100644 --- a/make/Test_FD_SET_Macro.make +++ b/make/Test_FD_SET_Macro.make @@ -12,7 +12,7 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations @@ -66,55 +66,55 @@ OBJECTS += $(OBJDIR)/Test_FD_SET_Macro.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_FD_SET_Macro - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_FD_SET_Macro + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_FD_SET_Macro + @echo Cleaning Test_FD_SET_Macro ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -125,10 +125,10 @@ endif # ############################################# $(OBJDIR)/Test_FD_SET_Macro.o: ../tests/Test_FD_SET_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif +endif \ No newline at end of file diff --git a/make/Test_Macro.make b/make/Test_Macro.make index 61bd4a5..997aca8 100644 --- a/make/Test_Macro.make +++ b/make/Test_Macro.make @@ -12,7 +12,7 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations @@ -68,55 +68,55 @@ OBJECTS += $(OBJDIR)/Test_Macro.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Macro - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Macro + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Macro + @echo Cleaning Test_Macro ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -127,13 +127,13 @@ endif # ############################################# $(OBJDIR)/CoverageMacro.o: ../code/CoverageMacro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Macro.o: ../tests/Test_Macro.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif +endif \ No newline at end of file diff --git a/make/Test_Mod_Cpp.make b/make/Test_Mod_Cpp.make index 32dfff6..6616f34 100644 --- a/make/Test_Mod_Cpp.make +++ b/make/Test_Mod_Cpp.make @@ -12,7 +12,7 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations @@ -66,55 +66,55 @@ OBJECTS += $(OBJDIR)/Test_Mod_Cpp.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Mod_Cpp - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Mod_Cpp + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Mod_Cpp + @echo Cleaning Test_Mod_Cpp ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -125,10 +125,10 @@ endif # ############################################# $(OBJDIR)/Test_Mod_Cpp.o: ../tests/Test_Mod_Cpp.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif +endif \ No newline at end of file diff --git a/make/Test_Standard.make b/make/Test_Standard.make index eb01ffa..4e34ff7 100644 --- a/make/Test_Standard.make +++ b/make/Test_Standard.make @@ -12,7 +12,7 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations @@ -68,55 +68,55 @@ OBJECTS += $(OBJDIR)/Test_Standard.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Standard - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Standard + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Standard + @echo Cleaning Test_Standard ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -127,13 +127,13 @@ endif # ############################################# $(OBJDIR)/CoverageSrc.o: ../code/CoverageSrc.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Standard.o: ../tests/Test_Standard.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif +endif \ No newline at end of file diff --git a/make/Test_Standard_Part.make b/make/Test_Standard_Part.make index 13473f2..5ba42c6 100644 --- a/make/Test_Standard_Part.make +++ b/make/Test_Standard_Part.make @@ -12,7 +12,7 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations @@ -68,55 +68,55 @@ OBJECTS += $(OBJDIR)/Test_Standard_Part.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Standard_Part - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking Test_Standard_Part + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning Test_Standard_Part + @echo Cleaning Test_Standard_Part ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -127,13 +127,13 @@ endif # ############################################# $(OBJDIR)/CoverageSrc.o: ../code/CoverageSrc.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/Test_Standard_Part.o: ../tests/Test_Standard_Part.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif +endif \ No newline at end of file diff --git a/make/testlib.make b/make/testlib.make index e08b388..cab885f 100644 --- a/make/testlib.make +++ b/make/testlib.make @@ -12,7 +12,7 @@ endif SHELLTYPE := posix ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos + SHELLTYPE := msdos endif # Configurations @@ -68,55 +68,55 @@ OBJECTS += $(OBJDIR)/testlib.o # ############################################# all: $(TARGET) - @: + @: $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking testlib - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) + $(PRELINKCMDS) + @echo Linking testlib + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) $(TARGETDIR): - @echo Creating $(TARGETDIR) + @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) + $(SILENT) mkdir -p $(TARGETDIR) else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): - @echo Creating $(OBJDIR) + @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) + $(SILENT) mkdir -p $(OBJDIR) else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @echo Cleaning testlib + @echo Cleaning testlib ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: | $(OBJDIR) - $(PREBUILDCMDS) + $(PREBUILDCMDS) ifneq (,$(PCH)) $(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) $(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" $(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" + $(SILENT) touch "$@" else - $(SILENT) echo $null >> "$@" + $(SILENT) echo $null >> "$@" endif else $(OBJECTS): | prebuild @@ -127,13 +127,13 @@ endif # ############################################# $(OBJDIR)/testMain.o: ../testlib/testMain.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/testlib.o: ../testlib/testlib.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d -endif +endif \ No newline at end of file From ad934f4b35f5777c7d107322f63b3e5b8c65666b Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Wed, 26 Mar 2025 11:06:52 +0100 Subject: [PATCH 07/15] scripts / make --- scripts/ci.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/ci.sh b/scripts/ci.sh index 803ef57..4619d29 100644 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -1,10 +1,11 @@ #!/bin/bash # build & run for github CI cd $(dirname $0) +cd ../make make -j clean make -j echo "" for cpp in $(ls ../tests/); do - ../build/${cpp%.cpp} X + ../build/linux/${cpp%.cpp} X done From a8e4961bdd393755cd185029aee86316928957ee Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Sat, 29 Mar 2025 18:58:33 +0100 Subject: [PATCH 08/15] cmd -> py --- scripts/bullseye_msbuild.py | 71 +++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 scripts/bullseye_msbuild.py diff --git a/scripts/bullseye_msbuild.py b/scripts/bullseye_msbuild.py new file mode 100644 index 0000000..429a26b --- /dev/null +++ b/scripts/bullseye_msbuild.py @@ -0,0 +1,71 @@ +"""ms build run all available tests with Bullseye coverage""" +import atexit +from glob import glob +from os import chdir, getcwd, makedirs, environ, system as sysCall, remove +from os.path import dirname, abspath, join +from sys import argv + +chdir(dirname(abspath(__file__))) +myDir = getcwd() +chdir('..') +repo = getcwd() +buildDir = join(repo, 'build') +exeDir = join(buildDir, 'windows') +excludeFile = join(myDir, 'BullseyeCoverageExclusions') +reportsDir = join(repo, 'reports_bullseye') +report = join(reportsDir, 'coverage.md') +srcDir = join(repo, 'code') +testsDir = join(repo, 'tests') +vsDir = join(repo, 'vs') +vsSolution = 'Tests.sln' + +makedirs(reportsDir, exist_ok=True) + +remove(report) + +environ['COVCOPT'] = f'--srcdir {srcDir} --macro -q' + +def covRestore(): + """restore cov01 setting""" + sysCall('cov01 -q --pop') + +atexit.register(covRestore) + +def testList(): + """return list of tests""" + chdir(vsDir) + return [c.replace('.vcxproj', '') for c in glob('Test_*.vcxproj')] + +def tryCall(call:str): + res = sysCall(call) + if res != 0: + print('call failed:', call) + exit(1) + +def vsBuild(target): + """build vs solution with target""" + chdir(vsDir) + tryCall(f'msbuild -m {vsSolution} -t:{target}') + +def buildAndRun(test:str): + """build and run test""" + chdir(vsDir) + environ['COVFILE'] = join(reportsDir, f'{test}.cov') + vsBuild(test) + tryCall('covclear -q') + tryCall(f'covselect -qd --import {excludeFile}') + with open(report, 'a') as fh: + fh.write(f'## {test}\n```\n') + tryCall(join(exeDir, f'{test}.exe X >> {report}')) + chdir(reportsDir) + tryCall(f'covsrc -q --by-name >> {report}') + with open(report, 'a') as fh: + fh.write(f'```\n\n') + +sysCall('cov01 -q --push') +sysCall('cov01 -q --on') + +vsBuild('Clean') + +for test in argv[1:] or testList(): + buildAndRun(test) From e792fc0fafea7444997372f445c4761072965523 Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Sun, 30 Mar 2025 13:24:34 +0200 Subject: [PATCH 09/15] py: Bullseye and CTC --- .../coverage_common.cpython-313.pyc | Bin 0 -> 2267 bytes scripts/bullseye_msbuild.py | 71 ------------------ scripts/coverage_Bullseye.py | 45 +++++++++++ scripts/coverage_CTC.py | 38 ++++++++++ scripts/coverage_common.py | 38 ++++++++++ 5 files changed, 121 insertions(+), 71 deletions(-) create mode 100644 scripts/__pycache__/coverage_common.cpython-313.pyc delete mode 100644 scripts/bullseye_msbuild.py create mode 100644 scripts/coverage_Bullseye.py create mode 100644 scripts/coverage_CTC.py create mode 100644 scripts/coverage_common.py diff --git a/scripts/__pycache__/coverage_common.cpython-313.pyc b/scripts/__pycache__/coverage_common.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8fadf100c0e1c03fe700a6fe7cc9ea853790e017 GIT binary patch literal 2267 zcmZ8hTTdHD6h3?NuCH935JLt!YR32I>4}D1fL8ZPl{~*LPDJ!a|YF_e&N~E^wOV6w?TxPXr&YU@OX6Br4 zzTIHZ2dtfXk=_*m{&WX5A=modw>W^ipn=9sKnw_|Oy?)K7*F_^K!lh`MAs%vNHGub z#AG7J6r#8`al#w(5ns$t{3^uxUWj|}m+=pr$GEH=?$J-^h4a-(AVIcDlj>fFWS74Yd%WD(o(Z{8|f6fleS{Ef_yC#A~5W zSQ5$6+NjALb!g4#aV*^uX??+t6X6^&ov{`of+OjRNs~C9v|;NjNykI4Q`^YmgpB4~ zB5OEuVu9up_M#&$S!OQ6JJOVuH*$_Rb#-d2$Va1&v`{cJNk?8Wb4hE3I-+hR4M(yK zYEy?_rbX`zQ=>GK(`)H-J61|8FYK03+=aPX;sNGrN!u%e3Ud-VxlQBhNpFLXf%1d+ zx51Tm01Kw;@Tfauuko5tPu3Lw;Sm5of`#%q=tEi6QV~M3?o|Jh7IFN?mhs4H0nzM_Q(rO+wgR9GMvTOhPv>$DB^tl~gBsX*ixX?f4~Y z*&vCu!6L?~PRzVb<9f|FuUpxym5b)DI||$R8lHk2#q}-t)3Yc_@LcqM-GB4i_Tafk zLzg!P$148u$Ae?{dv0I7b+x>7ulGrye`9cL!$1B=9RK&Rf1I-8{m}Kch&4%MGI}G! zXl7Gx_NP(VpZ(be^fhjH1t8IZ6=9xk(|DY()#pG}gnCs}NaGg~CkbFc3Jup{gLiCa$(TQM!xnO-aO*~MFriOhVD|KV66jY-{JjF06ENnA~6z4 z$2+#F8+qHba^yI3JAneL%_{5gDWnj#HD!fRRn@IBImP^#VBzT}C`zy+N>cN7u(dq& zqxe(%6Z{GzT zmmWmLw}=X~zM^L^`j<_kVYo9eDhfXN_l2n(eO07(RrAS>d?M2m25aiyXKTE3)XR>Nh zRL|JMlM&uUzT;b_T5SoEil@5Zz(ZN4?=uD_Z{We$8=;Ig7+d()KK*`R{rJ6^`>)^c zcoaDMt9Xudk^n`+bmQ zX39eqr2``cTgv_GU6o*e$@iBia363xK7ng4x4i`Hc6>6|yr#bd>~>puZpgjL|F{v~ Ai2wiq literal 0 HcmV?d00001 diff --git a/scripts/bullseye_msbuild.py b/scripts/bullseye_msbuild.py deleted file mode 100644 index 429a26b..0000000 --- a/scripts/bullseye_msbuild.py +++ /dev/null @@ -1,71 +0,0 @@ -"""ms build run all available tests with Bullseye coverage""" -import atexit -from glob import glob -from os import chdir, getcwd, makedirs, environ, system as sysCall, remove -from os.path import dirname, abspath, join -from sys import argv - -chdir(dirname(abspath(__file__))) -myDir = getcwd() -chdir('..') -repo = getcwd() -buildDir = join(repo, 'build') -exeDir = join(buildDir, 'windows') -excludeFile = join(myDir, 'BullseyeCoverageExclusions') -reportsDir = join(repo, 'reports_bullseye') -report = join(reportsDir, 'coverage.md') -srcDir = join(repo, 'code') -testsDir = join(repo, 'tests') -vsDir = join(repo, 'vs') -vsSolution = 'Tests.sln' - -makedirs(reportsDir, exist_ok=True) - -remove(report) - -environ['COVCOPT'] = f'--srcdir {srcDir} --macro -q' - -def covRestore(): - """restore cov01 setting""" - sysCall('cov01 -q --pop') - -atexit.register(covRestore) - -def testList(): - """return list of tests""" - chdir(vsDir) - return [c.replace('.vcxproj', '') for c in glob('Test_*.vcxproj')] - -def tryCall(call:str): - res = sysCall(call) - if res != 0: - print('call failed:', call) - exit(1) - -def vsBuild(target): - """build vs solution with target""" - chdir(vsDir) - tryCall(f'msbuild -m {vsSolution} -t:{target}') - -def buildAndRun(test:str): - """build and run test""" - chdir(vsDir) - environ['COVFILE'] = join(reportsDir, f'{test}.cov') - vsBuild(test) - tryCall('covclear -q') - tryCall(f'covselect -qd --import {excludeFile}') - with open(report, 'a') as fh: - fh.write(f'## {test}\n```\n') - tryCall(join(exeDir, f'{test}.exe X >> {report}')) - chdir(reportsDir) - tryCall(f'covsrc -q --by-name >> {report}') - with open(report, 'a') as fh: - fh.write(f'```\n\n') - -sysCall('cov01 -q --push') -sysCall('cov01 -q --on') - -vsBuild('Clean') - -for test in argv[1:] or testList(): - buildAndRun(test) diff --git a/scripts/coverage_Bullseye.py b/scripts/coverage_Bullseye.py new file mode 100644 index 0000000..f4bd0df --- /dev/null +++ b/scripts/coverage_Bullseye.py @@ -0,0 +1,45 @@ +"""ms build run all available tests with Bullseye coverage""" +from coverage_common import testList, sysCall, proc, vsBuild, myDir, repo, exeDir, srcDir, vsDir, vsSolution + +import atexit +from os import chdir, makedirs, environ +from os.path import join +from sys import argv + + +reportsDir = join(repo, 'reports_bullseye') +report = join(reportsDir, 'coverage.md') +excludeFile = join(myDir, 'BullseyeCoverageExclusions') + +makedirs(reportsDir, exist_ok=True) + +fh = open(report, 'w') + +environ['COVCOPT'] = f'--srcdir {srcDir} --macro -q' + +def covRestore(): + """restore cov01 setting""" + sysCall('cov01 -q --pop') + +atexit.register(covRestore) + +def buildAndRun(test:str): + """build and run test""" + chdir(vsDir) + environ['COVFILE'] = join(reportsDir, f'{test}.cov') + vsBuild(test) + sysCall('covclear -q') + fh.write(f'### {test}\n```\n') + proc(join(exeDir, f'{test}.exe X'), fh) + chdir(reportsDir) + sysCall(f'covselect -qd --import {excludeFile}') + proc(f'covsrc -q --by-name', fh) + fh.write('```\n\n') + +sysCall('cov01 -q --push') +sysCall('cov01 -q --on') + +# vsBuild('Clean') + +for test in argv[1:] or testList(): + buildAndRun(test) diff --git a/scripts/coverage_CTC.py b/scripts/coverage_CTC.py new file mode 100644 index 0000000..6b845ba --- /dev/null +++ b/scripts/coverage_CTC.py @@ -0,0 +1,38 @@ +from coverage_common import testList, sysCall, myDir, repo, exeDir, vsSolution +from os import chdir, makedirs, remove +from os.path import join, isfile +from sys import argv + +reportsDir = join(repo, 'reports_CTC') + +ctcLaunchParams = '-C "NO_EXCLUDE+*/code/*" -C "CONST_INSTR = ON" -i m' +ctcReportParams = f'-t 98 -nsb -shorten-path {repo}/ -include-justifications -restrict-to-files "*/code/*" -measures f,mcdc' +msBuildParams = '-p:TrackFileAccess=false -m' +monFile = join(myDir, 'MON.sym') +datFile = join(myDir, 'MON.dat') + +makedirs(reportsDir, exist_ok=True) + +def reportTemplate(target): + """build report using template""" + sysCall(f'ctcreport.exe {ctcReportParams} -D ProjectName={target} -template {join(myDir, 'ctc_report.htm')} -o {join(reportsDir, target)}.html') + +def buildAndRun(test:str): + """build, run and report""" + chdir(myDir) + if isfile(monFile): remove(monFile) + if isfile(datFile): remove(datFile) + sysCall(f'ctclaunch {ctcLaunchParams} msbuild {vsSolution} -t:{test} {msBuildParams}') + + exe = join(exeDir, f'{test}.exe') + sysCall(exe) + reportTemplate(test) + sysCall(f'{exe} X') + reportTemplate(f'{test}_cov') + htmlDir = join(reportsDir, f'html_{test}_cov') + sysCall(f'ctcreport.exe {ctcReportParams} -D ProjectName={test}_cov -o {htmlDir}') + +# vsBuild('Clean') + +for test in argv[1:] or testList(): + buildAndRun(test) diff --git a/scripts/coverage_common.py b/scripts/coverage_common.py new file mode 100644 index 0000000..6f74219 --- /dev/null +++ b/scripts/coverage_common.py @@ -0,0 +1,38 @@ +from glob import glob +from os import chdir, getcwd, system +from os.path import dirname, abspath, join +from subprocess import Popen, PIPE + +chdir(dirname(abspath(__file__))) +myDir = getcwd() +chdir('..') +repo = getcwd() +buildDir = join(repo, 'build') +exeDir = join(buildDir, 'windows') +srcDir = join(repo, 'code') +testsDir = join(repo, 'tests') +vsDir = join(repo, 'vs') +vsSolution = join(vsDir, 'Tests.sln') + +def testList(): + """return list of tests""" + chdir(vsDir) + return [c.replace('.vcxproj', '') for c in glob('Test_*.vcxproj')] + +def sysCall(call:str): + if system(call) != 0: + print('call failed:', call) + exit(1) + +def proc(call:str, fh): + """run process to report""" + try: + with Popen(call, stdout=PIPE, universal_newlines=True) as proc: + fh.write(proc.stdout.read()) + except Exception: + print('call failed:', call) + exit(1) + +def vsBuild(target): + """build vs solution with target""" + sysCall(f'msbuild -m {vsSolution} -t:{target}') From 57d643c2cdccd37f88a92ccfea1c134aa47d6ae0 Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Sun, 30 Mar 2025 15:35:01 +0200 Subject: [PATCH 10/15] bullseye with docopts; testlib uncovered --- .gitignore | 4 ++ .../coverage_common.cpython-313.pyc | Bin 2267 -> 2267 bytes scripts/coverage_Bullseye.py | 36 ++++++++++-------- scripts/coverage_Bullseye_DO.py | 25 ++++++++++++ scripts/coverage_CTC.py | 1 + scripts/sompy.py | 6 +++ 6 files changed, 56 insertions(+), 16 deletions(-) create mode 100644 scripts/coverage_Bullseye_DO.py create mode 100644 scripts/sompy.py diff --git a/.gitignore b/.gitignore index 13561b3..718745d 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,10 @@ tmp* *.ctc vs +# python +*.pyc +__pycache__/ + # Prerequisites *.d diff --git a/scripts/__pycache__/coverage_common.cpython-313.pyc b/scripts/__pycache__/coverage_common.cpython-313.pyc index 8fadf100c0e1c03fe700a6fe7cc9ea853790e017..8d3ded37139909f8a428d07baa5246478a6ef00d 100644 GIT binary patch delta 22 ccmcaDcw3P7GcPX}0}y=De3|}fBkws509CXH?f?J) delta 22 bcmcaDcw3P7GcPX}0|= Date: Sun, 30 Mar 2025 16:33:34 +0200 Subject: [PATCH 11/15] minor corrections --- scripts/coverage_Bullseye.py | 2 +- scripts/coverage_CTC.py | 10 +++++----- submodules/sompy | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/coverage_Bullseye.py b/scripts/coverage_Bullseye.py index 990853f..f244123 100644 --- a/scripts/coverage_Bullseye.py +++ b/scripts/coverage_Bullseye.py @@ -6,7 +6,7 @@ from os.path import join from sys import argv -reportsDir = join(repo, 'reports_bullseye') +reportsDir = join(repo, 'reports_Bullseye') report = join(reportsDir, 'coverage.md') excludeFile = join(myDir, 'BullseyeCoverageExclusions') diff --git a/scripts/coverage_CTC.py b/scripts/coverage_CTC.py index 935d1ce..cb3446b 100644 --- a/scripts/coverage_CTC.py +++ b/scripts/coverage_CTC.py @@ -1,5 +1,5 @@ """ms build run all available tests with CTC coverage""" -from coverage_common import testList, sysCall, myDir, repo, exeDir, vsSolution +from coverage_common import testList, sysCall, vsBuild, myDir, repo, exeDir, vsDir, vsSolution from os import chdir, makedirs, remove from os.path import join, isfile from sys import argv @@ -9,8 +9,8 @@ ctcLaunchParams = '-C "NO_EXCLUDE+*/code/*" -C "CONST_INSTR = ON" -i m' ctcReportParams = f'-t 98 -nsb -shorten-path {repo}/ -include-justifications -restrict-to-files "*/code/*" -measures f,mcdc' msBuildParams = '-p:TrackFileAccess=false -m' -monFile = join(myDir, 'MON.sym') -datFile = join(myDir, 'MON.dat') +monFile = 'MON.sym' +datFile = 'MON.dat' makedirs(reportsDir, exist_ok=True) @@ -20,7 +20,7 @@ def reportTemplate(target): def buildAndRun(test:str): """build, run and report""" - chdir(myDir) + chdir(vsDir) if isfile(monFile): remove(monFile) if isfile(datFile): remove(datFile) sysCall(f'ctclaunch {ctcLaunchParams} msbuild {vsSolution} -t:{test} {msBuildParams}') @@ -33,7 +33,7 @@ def buildAndRun(test:str): htmlDir = join(reportsDir, f'html_{test}_cov') sysCall(f'ctcreport.exe {ctcReportParams} -D ProjectName={test}_cov -o {htmlDir}') -# vsBuild('Clean') +vsBuild('Clean') for test in argv[1:] or testList(): buildAndRun(test) diff --git a/submodules/sompy b/submodules/sompy index 167252f..6d5a2d9 160000 --- a/submodules/sompy +++ b/submodules/sompy @@ -1 +1 @@ -Subproject commit 167252f6c3a8d2a2d2af9f5daa77ebd47ebfa3d0 +Subproject commit 6d5a2d911b8b7d8a3020941aaba9b2fb462a219c From d868962c423794fdaeaf2f2ace7803e000ccc2c0 Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:23:24 +0200 Subject: [PATCH 12/15] pycache --- .gitignore | 1 + .../__pycache__/coverage_common.cpython-313.pyc | Bin 2267 -> 0 bytes scripts/coverage_common.py | 6 +++++- submodules/sompy | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) delete mode 100644 scripts/__pycache__/coverage_common.cpython-313.pyc diff --git a/.gitignore b/.gitignore index 718745d..093567d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ vs # python *.pyc __pycache__/ +*/__pycache__/ # Prerequisites *.d diff --git a/scripts/__pycache__/coverage_common.cpython-313.pyc b/scripts/__pycache__/coverage_common.cpython-313.pyc deleted file mode 100644 index 8d3ded37139909f8a428d07baa5246478a6ef00d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2267 zcmZ8hOHUhD6h8CvjGsK65JLczVDvMUiqKo7oRO+Vr2O*|O8Bs-5v&jyHNNv+i&mBK_+|itS?z!jO$2s5q zc7s75V0#gHo_-+!{KW?KCfAhRw>W@1pn=9sKnw_|Oy?)K7*F_^K!lh`MAs%vNHGub z#AG7J6r#8`al#w(5ns$t{3^uxUWj|}m+=pr$8}jd+@qh+3+JnoK!Pkvlj>fFWS74Yd%WD(o(Z{8|f6fleS{Ef_yC#A~5W zSQ5$6+NjALb!g4#aV*^uX?@O)6X6^&ov{`of+OjRNs~C9v|;NjNykI4Q`^YmgpB4~ zB5OEuVu9up_M#&$S!OQ6JJOVuH*$_Rb#-d2$Va1&v`{cJNk?8Wb4hE3I-+hR4M(yK zYEy?_rbX`zQ=>GK(`)H-J61|8FYK03+=01T;sNGrN!u%e3Ud-VxlQBhNpFLXf%1d+ zx51Tm01Kw;@Tfauuko5tPu3Lw;Sm5of`#%q=tEi6QV~M3?o|Jh7IFN?mg>hKRU-6SU@OL{PRzVb<9f|FuUpxym5b)DI||$R8lHk2#rPKd=~)ydcqV$k?!S3$d+^-D zq05_tV-^4SqrtIzJ-4skx>{bk+xs}szcDzr;U9k}j{p0}KTg^4e(ZW%#F`{B8NHEV zG_xr;`_riG&;D!!`WiR90+8syiZD;NX*|x?>T{qfLcJ;~r16W0lZ3gw3b38kRKm;{ z$>Hbh1QCIFuydq5F>|&f8mp!q;RtR6)r1kO5oQvxcnM?4NgOc??L$$5Z8^A>yzzPY zvx?lYtpwL{>&Z>!wQVJ^_R%-;js(iFUGxLJ0U{i*{oKp`gUTH^xesi!`{1T=8h=sX zA;-^h(+$93NUhEC(`=?K7L*teIuw9o@@!s%LQ5)+f+Rpc#2_C$f*cp-Jn#pEfv9P z5qkz-wTIeCt6)2=g`9~frHRaZ&REHqIfG6T+!#m~iikqkfruZ4BdrkAHb@WCMPek9 zj(2QTH}bY=<;Zd7b^--fn^o4~Q%E6fYsw0ts;XOMa*Fve!Ir0=peVtPC`rxR!PfH7 zPvXz*kAfq=_Wd3R-M(_`N_pn{x$owlg!?zb{gv>k&A{ou1qi+OBslUoIP%{!fBP=* z7x)xT^S4a0W>qoVMOg4zSoH`*#c2nkGYb!E6`^rG@o|-Uwy1!PvsT_UR7;>&NfT+uuwzJJ`5=H^C^7U z^Yf0By^bWvfRMKw#k~w0dyG}X?J3b&?{b? Date: Thu, 10 Apr 2025 11:24:58 +0200 Subject: [PATCH 13/15] pycache --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 093567d..5d2df0e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,8 +21,7 @@ vs # python *.pyc -__pycache__/ -*/__pycache__/ +__pycache__ # Prerequisites *.d From 116b2b1c850ba1a25596ba536d9ae68ff96971dd Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Fri, 11 Apr 2025 11:21:17 +0200 Subject: [PATCH 14/15] py only --- README.md | 2 +- make/Makefile | 26 +++--- make/Test_All.make | 4 +- make/Test_B_Macro.make | 4 +- make/Test_Count.make | 4 +- make/Test_Exclude.make | 4 +- make/Test_FD_SET_Macro.make | 4 +- make/Test_Macro.make | 4 +- make/Test_Mod_Cpp.make | 4 +- make/Test_Runner.make | 135 ------------------------------ make/Test_Standard.make | 4 +- make/Test_Standard_Part.make | 4 +- make/Tests_Standard.make | 140 -------------------------------- make/testlib.make | 4 +- scripts/Bullseye_msbuild.cmd | 32 -------- scripts/CTC_msbuild.cmd | 30 ------- scripts/README.md | 28 +++---- scripts/be_build_n_run.cmd | 49 ----------- scripts/be_off.cmd | 12 --- scripts/ci.sh | 4 +- scripts/coverage_Bullseye.py | 7 +- scripts/coverage_Bullseye_DO.py | 23 +++--- scripts/coverage_CTC.py | 16 ++-- scripts/coverage_common.py | 11 +++ scripts/ctc_build_n_run.cmd | 40 --------- scripts/options.txt | 5 -- scripts/premake5.lua | 2 +- scripts/setup.cmd | 62 -------------- 28 files changed, 83 insertions(+), 581 deletions(-) delete mode 100644 make/Test_Runner.make delete mode 100644 make/Tests_Standard.make delete mode 100644 scripts/Bullseye_msbuild.cmd delete mode 100644 scripts/CTC_msbuild.cmd delete mode 100644 scripts/be_build_n_run.cmd delete mode 100644 scripts/be_off.cmd delete mode 100644 scripts/ctc_build_n_run.cmd delete mode 100644 scripts/options.txt delete mode 100644 scripts/setup.cmd diff --git a/README.md b/README.md index b9b31bc..0c1ea4c 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,4 @@ C++ code collection to evaluate coverage tools - headers - sources - test execution code -- [make and run section](make/README.md) for Bullseye and CTC++ +- [make and run section](scripts/README.md) for Bullseye and CTC++ diff --git a/make/Makefile b/make/Makefile index 7eb9bbd..2d88883 100644 --- a/make/Makefile +++ b/make/Makefile @@ -1,24 +1,24 @@ # GNU Make workspace makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose SILENT = @ endif -ifeq ($(config),ci) - Test_Standard_config = ci - Test_Standard_Part_config = ci - Test_B_Macro_config = ci - Test_Count_config = ci - Test_Exclude_config = ci - Test_FD_SET_Macro_config = ci - Test_Macro_config = ci - Test_Mod_Cpp_config = ci - Test_All_config = ci - testlib_config = ci +ifeq ($(config),release) + Test_Standard_config = release + Test_Standard_Part_config = release + Test_B_Macro_config = release + Test_Count_config = release + Test_Exclude_config = release + Test_FD_SET_Macro_config = release + Test_Macro_config = release + Test_Mod_Cpp_config = release + Test_All_config = release + testlib_config = release else $(error "invalid configuration $(config)") @@ -106,7 +106,7 @@ help: @echo "Usage: make [config=name] [target]" @echo "" @echo "CONFIGURATIONS:" - @echo " ci" + @echo " release" @echo "" @echo "TARGETS:" @echo " all (default)" diff --git a/make/Test_All.make b/make/Test_All.make index 026e128..331b07e 100644 --- a/make/Test_All.make +++ b/make/Test_All.make @@ -1,7 +1,7 @@ # GNU Make project makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose @@ -30,7 +30,7 @@ endif RESCOMP = windres TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_All -OBJDIR = ../build/linux/ci/Test_All +OBJDIR = ../build/linux/release/Test_All DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += diff --git a/make/Test_B_Macro.make b/make/Test_B_Macro.make index 21a6c61..e3af172 100644 --- a/make/Test_B_Macro.make +++ b/make/Test_B_Macro.make @@ -1,7 +1,7 @@ # GNU Make project makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose @@ -30,7 +30,7 @@ endif RESCOMP = windres TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_B_Macro -OBJDIR = ../build/linux/ci/Test_B_Macro +OBJDIR = ../build/linux/release/Test_B_Macro DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += diff --git a/make/Test_Count.make b/make/Test_Count.make index 2a5fedf..249db0a 100644 --- a/make/Test_Count.make +++ b/make/Test_Count.make @@ -1,7 +1,7 @@ # GNU Make project makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose @@ -30,7 +30,7 @@ endif RESCOMP = windres TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Count -OBJDIR = ../build/linux/ci/Test_Count +OBJDIR = ../build/linux/release/Test_Count DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += diff --git a/make/Test_Exclude.make b/make/Test_Exclude.make index d422504..77ce116 100644 --- a/make/Test_Exclude.make +++ b/make/Test_Exclude.make @@ -1,7 +1,7 @@ # GNU Make project makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose @@ -30,7 +30,7 @@ endif RESCOMP = windres TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Exclude -OBJDIR = ../build/linux/ci/Test_Exclude +OBJDIR = ../build/linux/release/Test_Exclude DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += diff --git a/make/Test_FD_SET_Macro.make b/make/Test_FD_SET_Macro.make index 11e8c4f..96a86bd 100644 --- a/make/Test_FD_SET_Macro.make +++ b/make/Test_FD_SET_Macro.make @@ -1,7 +1,7 @@ # GNU Make project makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose @@ -30,7 +30,7 @@ endif RESCOMP = windres TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_FD_SET_Macro -OBJDIR = ../build/linux/ci/Test_FD_SET_Macro +OBJDIR = ../build/linux/release/Test_FD_SET_Macro DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += diff --git a/make/Test_Macro.make b/make/Test_Macro.make index 997aca8..ba24bee 100644 --- a/make/Test_Macro.make +++ b/make/Test_Macro.make @@ -1,7 +1,7 @@ # GNU Make project makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose @@ -30,7 +30,7 @@ endif RESCOMP = windres TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Macro -OBJDIR = ../build/linux/ci/Test_Macro +OBJDIR = ../build/linux/release/Test_Macro DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += diff --git a/make/Test_Mod_Cpp.make b/make/Test_Mod_Cpp.make index 6616f34..11f57d4 100644 --- a/make/Test_Mod_Cpp.make +++ b/make/Test_Mod_Cpp.make @@ -1,7 +1,7 @@ # GNU Make project makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose @@ -30,7 +30,7 @@ endif RESCOMP = windres TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Mod_Cpp -OBJDIR = ../build/linux/ci/Test_Mod_Cpp +OBJDIR = ../build/linux/release/Test_Mod_Cpp DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += diff --git a/make/Test_Runner.make b/make/Test_Runner.make deleted file mode 100644 index b428efe..0000000 --- a/make/Test_Runner.make +++ /dev/null @@ -1,135 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=ci -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -TARGETDIR = ../build -TARGET = $(TARGETDIR)/Test_Runner -OBJDIR = ../build/linux/ci/ci/Test_Runner -DEFINES += -DNDEBUG -INCLUDES += -I../testlib -I../code -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += -LDDEPS += -ALL_LDFLAGS += $(LDFLAGS) -s -LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -# Per File Configurations -# ############################################# - - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/Test_Runner.o -GENERATED += $(OBJDIR)/testMain.o -GENERATED += $(OBJDIR)/testlib.o -OBJECTS += $(OBJDIR)/Test_Runner.o -OBJECTS += $(OBJDIR)/testMain.o -OBJECTS += $(OBJDIR)/testlib.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Test_Runner - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning Test_Runner -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/testMain.o: ../testlib/testMain.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/testlib.o: ../testlib/testlib.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/Test_Runner.o: ../tests/Test_Runner.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/make/Test_Standard.make b/make/Test_Standard.make index 4e34ff7..df44408 100644 --- a/make/Test_Standard.make +++ b/make/Test_Standard.make @@ -1,7 +1,7 @@ # GNU Make project makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose @@ -30,7 +30,7 @@ endif RESCOMP = windres TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Standard -OBJDIR = ../build/linux/ci/Test_Standard +OBJDIR = ../build/linux/release/Test_Standard DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += diff --git a/make/Test_Standard_Part.make b/make/Test_Standard_Part.make index 5ba42c6..a677fe5 100644 --- a/make/Test_Standard_Part.make +++ b/make/Test_Standard_Part.make @@ -1,7 +1,7 @@ # GNU Make project makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose @@ -30,7 +30,7 @@ endif RESCOMP = windres TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/Test_Standard_Part -OBJDIR = ../build/linux/ci/Test_Standard_Part +OBJDIR = ../build/linux/release/Test_Standard_Part DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += diff --git a/make/Tests_Standard.make b/make/Tests_Standard.make deleted file mode 100644 index 7bf466a..0000000 --- a/make/Tests_Standard.make +++ /dev/null @@ -1,140 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=ci -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -TARGETDIR = ../build -TARGET = $(TARGETDIR)/Tests_Standard -OBJDIR = ../build/linux/ci/ci/Tests_Standard -DEFINES += -DNDEBUG -INCLUDES += -I../testlib -I../code -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -D_COVERAGE_ON -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += -LDDEPS += -ALL_LDFLAGS += $(LDFLAGS) -s -LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -# Per File Configurations -# ############################################# - - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/CoverageSrc.o -GENERATED += $(OBJDIR)/Tests_Standard.o -GENERATED += $(OBJDIR)/testMain.o -GENERATED += $(OBJDIR)/testlib.o -OBJECTS += $(OBJDIR)/CoverageSrc.o -OBJECTS += $(OBJDIR)/Tests_Standard.o -OBJECTS += $(OBJDIR)/testMain.o -OBJECTS += $(OBJDIR)/testlib.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Tests_Standard - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning Tests_Standard -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/CoverageSrc.o: ../code/CoverageSrc.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/testMain.o: ../testlib/testMain.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/testlib.o: ../testlib/testlib.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/Tests_Standard.o: ../tests/Tests_Standard.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/make/testlib.make b/make/testlib.make index cab885f..a66bd14 100644 --- a/make/testlib.make +++ b/make/testlib.make @@ -1,7 +1,7 @@ # GNU Make project makefile autogenerated by Premake ifndef config - config=ci + config=release endif ifndef verbose @@ -30,7 +30,7 @@ endif RESCOMP = windres TARGETDIR = ../build/linux/lib TARGET = $(TARGETDIR)/libtestlib.a -OBJDIR = ../build/linux/ci/testlib +OBJDIR = ../build/linux/release/testlib DEFINES += -DNDEBUG -D_COVERAGE_ON INCLUDES += -I../testlib -I../code FORCE_INCLUDE += diff --git a/scripts/Bullseye_msbuild.cmd b/scripts/Bullseye_msbuild.cmd deleted file mode 100644 index bc034d0..0000000 --- a/scripts/Bullseye_msbuild.cmd +++ /dev/null @@ -1,32 +0,0 @@ -@echo off -rem Bullsyey build, run & report -rem using msbuild, docopts, covbr2html -rem solution generated by premake5 - -SETLOCAL - -set _me=%~nx0 -set tool=bullseye -call %~dp0setup.cmd %* -if %errorlevel% NEQ 0 exit /b 0 - -set runSub=%myDir%\be_build_n_run.cmd -set covReport=%reportsDir%\coverage.txt -echo %DATE% %TIME% > %covReport% - -rem rebase to source dir -rem enable macros -set covcopt=--srcdir %srcDir% --macro --no-banner - -if "%_args%"=="" ( - for %%f in (%testsDir%\*.cpp) do call %runSub% %%~nf -) else ( - for %%f in (%_args%) do call %runSub% %%f -) - -echo finish -%pyDir%\covbr2html\covbr2html.py -co %reportsDir% %buildDir%\todo_*.txt -echo report: %covReport% -echo. -echo %start% -echo %time% diff --git a/scripts/CTC_msbuild.cmd b/scripts/CTC_msbuild.cmd deleted file mode 100644 index ab0cd5d..0000000 --- a/scripts/CTC_msbuild.cmd +++ /dev/null @@ -1,30 +0,0 @@ -@echo off -rem CTC build, run & report -rem using ctclaunch msbuild, docopts -rem solution generated by premake5 - -SETLOCAL -set _me=%~nx0 -set tool=ctc -call %~dp0setup.cmd %* -if %errorlevel% NEQ 0 exit /b 0 - -call %myDir%\be_off.cmd - -set runSub=%myDir%\ctc_build_n_run.cmd -set ctclaunchParams=-C "NO_EXCLUDE+*\code\*" -C "CONST_INSTR = ON" -i m -set ctcreportParams=-t 98 -nsb -shorten-path %repo%\ -include-justifications -restrict-to-files "*/code/*" -measures f,mcdc -set msbuildParams=-p:TrackFileAccess=false -m -set monFile=%myDir%\MON.sym -set datFile=%myDir%\MON.dat - -if "%_args%"=="" ( - for %%f in (%testsDir%\*.cpp) do call %runSub% %%~nf -) else ( - for %%f in (%_args%) do call %runSub% %%f -) - -del /Q %monFile% %datFile% 2>NUL - -echo %start% -echo %time% diff --git a/scripts/README.md b/scripts/README.md index 900e51f..d363a7c 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,29 +1,25 @@ # make and run section -## windows msbuild +## windows msbuild scripts ### required tools for all scripts -- msbuild +- msbuild / Developer Command Prompt - [premake5](https://premake.github.io/) +- python 3 ### prebuild - call premake5 with your VS version to generate solution - call premake5 --help to find out how ### build and run scripts -#### Bullseye_msbuild.cmd +#### coverage_Bullseye.py - requires Bullseye coverage -- generates reports_bullseye folder +- generates reports_Bullseye folder - coverage summary (covsrc) - - .cov files for coverage browser - - todo html files (covbr / covbr2html**) - - optional html folders -#### CTC_msbuild.cmd + - coverage (.cov) files for coverage browser +#### coverage_CTC.py - requires CTC++ -- generates reports_ctc folder - - simple html reports - - optional html folders -#### usage -call scripts with **-h** +- generates reports_CTC folder + - simple html reports with simple template + - html folders with CTC html template +#### common usage +call scripts with **-l** for available tests ## linux currently only build and run script for github CI - no tools required - -## covbr2html -** for information about covbr2html see [covbr2html repo](https://github.com/sorgom/covbr2html) diff --git a/scripts/be_build_n_run.cmd b/scripts/be_build_n_run.cmd deleted file mode 100644 index 7c267c1..0000000 --- a/scripts/be_build_n_run.cmd +++ /dev/null @@ -1,49 +0,0 @@ -@echo off -rem ======================================== -rem build and run sub -rem ======================================== -SETLOCAL -if "%_me%"=="" exit /b 1 - -set target=%1 - -echo %target% -echo - build -echo. >> %covReport% -echo === %target% >> %covReport% -set covfile=%reportsDir%\%target%.cov -del /Q %covfile% 2>NUL -msbuild %solution% -t:clean -m >NUL - -set buildLog=%buildDir%\be_build_%target%.log -cov01 -q1 -msbuild %solution% -t:%target% -m > %buildLog% 2>&1 -set elevel=%errorlevel% -cov01 -q0 -if %elevel% neq 0 ( - echo - build failed - echo - see %buildLog% - exit /b %elevel% -) else ( - del %buildLog% -) -echo - report -set exe=%exeDir%\%target%.exe -cd %srcDir% -rem reset coverage data -covclear -q -covselect -qd --import %myDir%\BullseyeCoverageExclusions -rem call executable without tests -%exe% -rem reports -covbr -qu --srcdir . > %buildDir%\todo_%target%.txt -if %_html% covhtml -q --allNum --srcdir . %reportsDir%\html_%target% -%exe% X >> %covReport% -covdir -q --srcdir . --checkmin 100,100 -if %errorlevel% neq 0 ( - covbr -qu --srcdir . > %buildDir%\todo_%target%_cov.txt - if %_html% covhtml -q --allNum --srcdir . %reportsDir%\html_%target%_cov -) -covsrc -q --srcdir . >> %covReport% -covsrc -q -c --srcdir . | sed "s/,/;/g" > %reportsDir%\csv_%target%_cov.csv -del %exe% diff --git a/scripts/be_off.cmd b/scripts/be_off.cmd deleted file mode 100644 index 5eabe55..0000000 --- a/scripts/be_off.cmd +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -rem if cov01 installed: -rem - make sure Bullseye Coverage is off - -if "%tmpFile%" == "" exit /b 1 - -SETLOCAL - -call where cov01 | grep -c cov01.exe > %tmpFile% -set /p _beInstalled=<%tmpFile% - -if %_beInstalled% NEQ 0 call cov01 -q --off diff --git a/scripts/ci.sh b/scripts/ci.sh index 4619d29..9cd8866 100644 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -6,6 +6,6 @@ make -j clean make -j echo "" -for cpp in $(ls ../tests/); do - ../build/linux/${cpp%.cpp} X +for cpp in $(ls Test_*.make); do + ../build/linux/${cpp%.make} X done diff --git a/scripts/coverage_Bullseye.py b/scripts/coverage_Bullseye.py index f244123..ee00211 100644 --- a/scripts/coverage_Bullseye.py +++ b/scripts/coverage_Bullseye.py @@ -1,5 +1,5 @@ -"""ms build run all available tests with Bullseye coverage""" -from coverage_common import testList, sysCall, proc, vsBuild, myDir, repo, exeDir, srcDir, vsDir, vsSolution +"""ms build and run available tests with Bullseye coverage""" +from coverage_common import testList, sysCall, proc, vsBuild, checkArgs, myDir, repo, exeDir, srcDir, vsDir import atexit from os import chdir, makedirs, environ @@ -45,5 +45,6 @@ def run(tests): fh.close() if __name__ == '__main__': - vsBuild('Clean') + checkArgs() + vsBuild('clean') run(argv[1:] or testList()) diff --git a/scripts/coverage_Bullseye_DO.py b/scripts/coverage_Bullseye_DO.py index 53304b5..1856e9e 100644 --- a/scripts/coverage_Bullseye_DO.py +++ b/scripts/coverage_Bullseye_DO.py @@ -1,25 +1,24 @@ -# ms build run all available tests with Bullseye coverage -# using sompy docopts module for options and help -if __name__ == '__main__': - from coverage_Bullseye import run, __doc__ as bdoc, reportsDir - from coverage_common import testList, vsBuild - import sompy - from docopts import docopts +""" +ms build and run tests with Bullseye coverage - help = bdoc + """ usage: this script [options] [tests] options: -c clean build and reports folder -l list available tests -h this help """ - opts, args = docopts(help) +if __name__ == '__main__': + from coverage_Bullseye import run, reportsDir + from coverage_common import testList, vsBuild, showTests + import sompy + from docopts import docopts + + opts, args = docopts(__doc__) if opts.get('l'): - print('available tests:', *testList(), sep='\n') - exit(0) + showTests() if opts.get('c'): from shutil import rmtree rmtree(reportsDir, ignore_errors=True) - vsBuild('Clean') + vsBuild('clean') run(args or testList()) diff --git a/scripts/coverage_CTC.py b/scripts/coverage_CTC.py index cb3446b..eb09825 100644 --- a/scripts/coverage_CTC.py +++ b/scripts/coverage_CTC.py @@ -1,5 +1,5 @@ -"""ms build run all available tests with CTC coverage""" -from coverage_common import testList, sysCall, vsBuild, myDir, repo, exeDir, vsDir, vsSolution +"""ms build and run available tests with CTC coverage""" +from coverage_common import testList, sysCall, vsBuild, checkArgs, myDir, repo, exeDir, vsDir, vsSolution from os import chdir, makedirs, remove from os.path import join, isfile from sys import argv @@ -12,8 +12,6 @@ monFile = 'MON.sym' datFile = 'MON.dat' -makedirs(reportsDir, exist_ok=True) - def reportTemplate(target): """build report using template""" sysCall(f'ctcreport.exe {ctcReportParams} -D ProjectName={target} -template {join(myDir, 'ctc_report.htm')} -o {join(reportsDir, target)}.html') @@ -33,7 +31,9 @@ def buildAndRun(test:str): htmlDir = join(reportsDir, f'html_{test}_cov') sysCall(f'ctcreport.exe {ctcReportParams} -D ProjectName={test}_cov -o {htmlDir}') -vsBuild('Clean') - -for test in argv[1:] or testList(): - buildAndRun(test) +if __name__ == '__main__': + checkArgs() + makedirs(reportsDir, exist_ok=True) + vsBuild('clean') + for test in argv[1:] or testList(): + buildAndRun(test) diff --git a/scripts/coverage_common.py b/scripts/coverage_common.py index be31c80..d03faf6 100644 --- a/scripts/coverage_common.py +++ b/scripts/coverage_common.py @@ -2,6 +2,7 @@ from os import chdir, getcwd, system from os.path import dirname, abspath, join, isfile from subprocess import Popen, PIPE +from sys import argv chdir(dirname(abspath(__file__))) myDir = getcwd() @@ -40,3 +41,13 @@ def proc(call:str, fh): def vsBuild(target): """build vs solution with target""" sysCall(f'msbuild -m {vsSolution} -t:{target}') + +def showTests(): + """show available tests""" + print('available tests:', *testList(), sep='\n') + exit(0) + +def checkArgs(): + """show available tests with -l option""" + if '-l' in argv: + showTests() diff --git a/scripts/ctc_build_n_run.cmd b/scripts/ctc_build_n_run.cmd deleted file mode 100644 index f49e7b6..0000000 --- a/scripts/ctc_build_n_run.cmd +++ /dev/null @@ -1,40 +0,0 @@ -@echo off -rem ======================================== -rem build and run sub CTC -rem ======================================== -SETLOCAL -if "%_me%"=="" exit /b 1 - -set target=%1 - -echo %target% -echo - build -del /Q %monFile% %datFile% 2>NUL -msbuild %solution% -t:clean >NUL - -set buildLog=%buildDir%\ctc_build_%target%.log - -cd %myDir% - -ctclaunch %ctclaunchParams% msbuild %solution% -t:%target% %msbuildParams% > %buildLog% 2>&1 -if %errorlevel% neq 0 ( - echo - build failed - echo - see %buildLog% - exit /b %elevel% -) else ( - del %buildLog% -) -set exe=%buildDir%\%target%.exe - -echo - report -rem call executable without tests -%exe% -ctcreport.exe %ctcreportParams% -D ProjectName=%target% -template %myDir%\ctc_report.htm -o %reportsDir%\%target%.html >NUL -rem call executable with tests -%exe% X -ctcreport.exe %ctcreportParams% -D ProjectName=%target%_cov -template %myDir%\ctc_report.htm -o %reportsDir%\%target%_cov.html >NUL -if %_html% ( - ctcreport.exe %ctcreportParams% -D ProjectName=%target%_cov -o %reportsDir%\html_%target%_cov >NUL -) -del %exe% -echo. diff --git a/scripts/options.txt b/scripts/options.txt deleted file mode 100644 index 79add1f..0000000 --- a/scripts/options.txt +++ /dev/null @@ -1,5 +0,0 @@ -options: --c clean build and report folders --H generate HTML --l list targets --h this help diff --git a/scripts/premake5.lua b/scripts/premake5.lua index c18b1f9..ee9fece 100644 --- a/scripts/premake5.lua +++ b/scripts/premake5.lua @@ -6,7 +6,7 @@ buildoptions_vs = '/std:c++17 /MP /W4 /wd4100 /wd4103 /wd4068' buildoptions_gcc = '-std=c++17 -pedantic-errors -Werror -Wall -Wno-unknown-pragmas' workspace 'Tests' - configurations { 'ci' } + configurations { 'release' } language 'C++' objdir '../build/%{_TARGET_OS}' defines { 'NDEBUG' } diff --git a/scripts/setup.cmd b/scripts/setup.cmd deleted file mode 100644 index 39983a7..0000000 --- a/scripts/setup.cmd +++ /dev/null @@ -1,62 +0,0 @@ -@echo off - -if %_me%=="" exit /b 1 - -cd %~dp0 -set myDir=%cd% -cd .. -set repo=%cd% -set buildDir=%repo%\build -set exeDir=%buildDir%\windows -set pyDir=%repo%\submodules\sompy -set reportsDir=%repo%\reports_%tool% -set srcDir=%repo%\code -set testsDir=%repo%\tests -set vsDir=%repo%\vs - -set tmpCmd=%buildDir%\tmp.cmd -set tmpFile=%buildDir%\tmp.tmp - -set solution=%vsDir%\Tests.sln - -if not exist %solution% ( - echo use premake5 to generate %solution% - exit /b 1 -) - -md %buildDir% 2>NUL - -set optsTxt=%myDir%\options.txt - -%pyDir%\somutil\docopts.py %optsTxt% %* > %tmpCmd% -if %errorlevel% neq 0 exit /b 1 -call %tmpCmd% -del %tmpCmd% 2>NUL - -rem help -if %_h% ( - echo usage: %_me% [options] [targets] - type %optsTxt% - exit /b 1 -) - -rem list targets -if %_l% ( - echo targets: - for %%f in (%testsDir%\*.cpp) do echo %%~nf - exit /b 1 -) - -rem clean build and reports -if %_c% ( - del /Q /S %buildDir% >NUL 2>&1 - del /Q /S %reportsDir% >NUL 2>&1 -) - -rem enable HTML (uppercase H option) -set _html=%_Hu% - -set start=%time% -md %reportsDir% 2>NUL - -exit /b 0 From 88bc046b2f4a03e32588e6946b2e9fe912b55da4 Mon Sep 17 00:00:00 2001 From: sorgom <110917257+sorgom@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:19:47 +0200 Subject: [PATCH 15/15] build and run scripts; readme --- scripts/README.md | 43 ++++++++++++++++++++++------ scripts/coverage_Bullseye.py | 33 +++++++++++----------- scripts/coverage_Bullseye_DO.py | 4 +-- scripts/coverage_CTC.py | 16 +++++------ scripts/coverage_common.py | 50 +++++++++++++++++++++------------ 5 files changed, 92 insertions(+), 54 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index d363a7c..284aafa 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,25 +1,50 @@ # make and run section -## windows msbuild scripts -### required tools for all scripts +## Windows / msbuild +### required tools on Windows - msbuild / Developer Command Prompt - [premake5](https://premake.github.io/) -- python 3 +- python 3 (associated with *.py) ### prebuild - call premake5 with your VS version to generate solution - call premake5 --help to find out how ### build and run scripts #### coverage_Bullseye.py -- requires Bullseye coverage +- requires Bullseye coverage for Windows - generates reports_Bullseye folder - coverage summary (covsrc) - coverage (.cov) files for coverage browser #### coverage_CTC.py -- requires CTC++ +- requires CTC++ for Windows - generates reports_CTC folder - simple html reports with simple template - html folders with CTC html template #### common usage -call scripts with **-l** for available tests -## linux -currently only build and run script for github CI -- no tools required +##### VS code +- setup Developer Command Prompt terminal see [howto](https://github.com/sorgom/howto/blob/dev/vscode/developer_command_prompt.md) +- start Developer Command Prompt terminal +- drag script into it +##### list of tests +- call scripts with **-l** for available tests +## linux / make Bullseye +### required tools on linux +- make, gcc +- python 3 +### build and run scripts +#### coverage_Bullseye.py +- requires Bullseye coverage for linux +- generates reports_Bullseye folder + - coverage summary (covsrc) + - coverage (.cov) files for coverage browser +#### usage +- build and run all tests +```shell +dev@linux:scripts$ python3 coverage_Bullseye.py +``` +- call script with **-l** for available tests +```shell +dev@linux:scripts$ python3 coverage_Bullseye.py -l +``` +- build and run some tests +```shell +dev@linux:scripts$ python3 coverage_Bullseye.py Test1 Test2 ... +``` diff --git a/scripts/coverage_Bullseye.py b/scripts/coverage_Bullseye.py index ee00211..2e8ada6 100644 --- a/scripts/coverage_Bullseye.py +++ b/scripts/coverage_Bullseye.py @@ -1,29 +1,28 @@ """ms build and run available tests with Bullseye coverage""" -from coverage_common import testList, sysCall, proc, vsBuild, checkArgs, myDir, repo, exeDir, srcDir, vsDir +from coverage_common import testList, call, proc, build, checkArgs, myDir, repo, srcDir, vsDir import atexit from os import chdir, makedirs, environ -from os.path import join +# from os.path import join from sys import argv -reportsDir = join(repo, 'reports_Bullseye') -report = join(reportsDir, 'coverage.md') -excludeFile = join(myDir, 'BullseyeCoverageExclusions') +reportsDir = f'{repo}/reports_Bullseye' +report = f'{reportsDir}/coverage.md' +excludeFile = f'{myDir}/BullseyeCoverageExclusions' def covRestore(): """restore cov01 setting""" - sysCall('cov01 -q --pop') + call('cov01 -q --pop') def buildAndRun(test:str, fh): """build, run and report""" - chdir(vsDir) - environ['COVFILE'] = join(reportsDir, f'{test}.cov') - vsBuild(test) - sysCall('covclear -q') + environ['COVFILE'] = f'{reportsDir}/{test}.cov' + build(test) + call('covclear -q') fh.write(f'### {test}\n```\n') - proc(join(exeDir, f'{test}.exe X'), fh) + proc(f'{test} X', fh) chdir(reportsDir) - sysCall(f'covselect -qd --import {excludeFile}') + call(f'covselect -qd --import {excludeFile}') proc(f'covsrc -q --by-name', fh) fh.write('```\n\n') @@ -33,12 +32,12 @@ def run(tests): with open(report, 'w') as fh: atexit.register(covRestore) environ['COVCOPT'] = f'--srcdir {srcDir} --macro -q' - sysCall('cov01 -q --push') + call('cov01 -q --push') - sysCall('cov01 -q --off') - vsBuild('testlib') + call('cov01 -q --off') + build('testlib') - sysCall('cov01 -q --on') + call('cov01 -q --on') for test in tests: buildAndRun(test, fh) @@ -46,5 +45,5 @@ def run(tests): if __name__ == '__main__': checkArgs() - vsBuild('clean') + build('clean') run(argv[1:] or testList()) diff --git a/scripts/coverage_Bullseye_DO.py b/scripts/coverage_Bullseye_DO.py index 1856e9e..4450137 100644 --- a/scripts/coverage_Bullseye_DO.py +++ b/scripts/coverage_Bullseye_DO.py @@ -9,7 +9,7 @@ """ if __name__ == '__main__': from coverage_Bullseye import run, reportsDir - from coverage_common import testList, vsBuild, showTests + from coverage_common import testList, build, showTests import sompy from docopts import docopts @@ -19,6 +19,6 @@ if opts.get('c'): from shutil import rmtree rmtree(reportsDir, ignore_errors=True) - vsBuild('clean') + build('clean') run(args or testList()) diff --git a/scripts/coverage_CTC.py b/scripts/coverage_CTC.py index eb09825..97d60be 100644 --- a/scripts/coverage_CTC.py +++ b/scripts/coverage_CTC.py @@ -1,5 +1,5 @@ """ms build and run available tests with CTC coverage""" -from coverage_common import testList, sysCall, vsBuild, checkArgs, myDir, repo, exeDir, vsDir, vsSolution +from coverage_common import testList, call, build, checkArgs, myDir, repo, binDir, vsDir, vsSolution from os import chdir, makedirs, remove from os.path import join, isfile from sys import argv @@ -14,26 +14,26 @@ def reportTemplate(target): """build report using template""" - sysCall(f'ctcreport.exe {ctcReportParams} -D ProjectName={target} -template {join(myDir, 'ctc_report.htm')} -o {join(reportsDir, target)}.html') + call(f'ctcreport.exe {ctcReportParams} -D ProjectName={target} -template {join(myDir, 'ctc_report.htm')} -o {join(reportsDir, target)}.html') def buildAndRun(test:str): """build, run and report""" chdir(vsDir) if isfile(monFile): remove(monFile) if isfile(datFile): remove(datFile) - sysCall(f'ctclaunch {ctcLaunchParams} msbuild {vsSolution} -t:{test} {msBuildParams}') + call(f'ctclaunch {ctcLaunchParams} msbuild {vsSolution} -t:{test} {msBuildParams}') - exe = join(exeDir, f'{test}.exe') - sysCall(exe) + exe = join(binDir, f'{test}.exe') + call(exe) reportTemplate(test) - sysCall(f'{exe} X') + call(f'{exe} X') reportTemplate(f'{test}_cov') htmlDir = join(reportsDir, f'html_{test}_cov') - sysCall(f'ctcreport.exe {ctcReportParams} -D ProjectName={test}_cov -o {htmlDir}') + call(f'ctcreport.exe {ctcReportParams} -D ProjectName={test}_cov -o {htmlDir}') if __name__ == '__main__': checkArgs() makedirs(reportsDir, exist_ok=True) - vsBuild('clean') + build('clean') for test in argv[1:] or testList(): buildAndRun(test) diff --git a/scripts/coverage_common.py b/scripts/coverage_common.py index d03faf6..0be0820 100644 --- a/scripts/coverage_common.py +++ b/scripts/coverage_common.py @@ -1,30 +1,40 @@ from glob import glob -from os import chdir, getcwd, system -from os.path import dirname, abspath, join, isfile +from os import chdir, getcwd, system, name as oname, environ +from os.path import dirname, abspath, isfile from subprocess import Popen, PIPE from sys import argv +isWin = oname == 'nt' +osSub = 'windows' if isWin else 'linux' + chdir(dirname(abspath(__file__))) myDir = getcwd() chdir('..') repo = getcwd() -buildDir = join(repo, 'build') -exeDir = join(buildDir, 'windows') -srcDir = join(repo, 'code') -testsDir = join(repo, 'tests') -vsDir = join(repo, 'vs') -vsSolution = join(vsDir, 'Tests.sln') - -if not isfile(vsSolution): - print(f'{vsSolution} not found', 'use premake5 to generate', sep='\n') +buildDir = f'{repo}/build' +binDir = f'{buildDir}/{osSub}' +makeDir = f'{repo}/make' +vsDir = f'{repo}/vs' +vsSolution = f'{vsDir}/Tests.sln' +srcDir = f'{repo}/code' +testsDir = f'{repo}/tests' + +if isWin and not isfile(vsSolution): + print('not found:', vsSolution, 'use premake5 to generate', sep='\n') exit(1) +environ['PATH'] = f"{binDir}{';' if isWin else ':'}{environ['PATH']}" + def testList(): """return list of tests""" - chdir(vsDir) - return [c.replace('.vcxproj', '') for c in glob('Test_*.vcxproj')] + if isWin: + chdir(vsDir) + return [c.replace('.vcxproj', '') for c in glob('Test_*.vcxproj')] + else: + chdir(makeDir) + return [c.replace('.make', '') for c in glob('Test_*.make')] -def sysCall(call:str): +def call(call:str): if system(call) != 0: print('call failed:', call) exit(1) @@ -32,15 +42,19 @@ def sysCall(call:str): def proc(call:str, fh): """run process to report""" try: - with Popen(call, stdout=PIPE, universal_newlines=True) as proc: + with Popen(call.split(), stdout=PIPE, universal_newlines=True) as proc: fh.write(proc.stdout.read()) except Exception: print('call failed:', call) exit(1) -def vsBuild(target): - """build vs solution with target""" - sysCall(f'msbuild -m {vsSolution} -t:{target}') +def build(target): + """build target""" + if isWin: + chdir(vsDir) + call(f'msbuild -m {vsSolution} -t:{target}') + else: + call(f'make -j -C {makeDir} {target}') def showTests(): """show available tests"""