From 636f91608cba8690d481821a3f422353b41eac0d Mon Sep 17 00:00:00 2001 From: Manfred Sorgo <110917257+sorgom@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:17:55 +0100 Subject: [PATCH] Som devel (#72) * removed std::endl * progress * fix: covbr2html -> py * no more sombin * update sompy * adapted ci --- .github/workflows/c-cpp.yml | 4 ++-- .gitmodules | 4 ---- application/components/COM/src/TCP_Com.cpp | 14 ++++++-------- application/main/AppMain.cpp | 14 +++++++------- devel/qnd/useCout.h | 4 ++-- make/bullseye/_covreport.cmd | 2 +- make/bullseye/_covsetup.cmd | 5 +++-- make/runSub.cmd | 1 - make/runSystemTests.cmd | 10 +++++----- submodules/sombin | 1 - submodules/sompy | 2 +- testing/testenv/comparators/Comparator.h | 2 +- testing/testenv/comparators/ostreamHelpers.h | 6 +++--- testing/testenv/comparators/src/Comparator.cpp | 4 ++-- 14 files changed, 33 insertions(+), 40 deletions(-) delete mode 160000 submodules/sombin diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 1fa8b3e7..656d8737 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -6,9 +6,9 @@ name: DSTW CI on: push: - branches: [ "dev_98", "dev_20", "release" ] + branches: [ "dev", "dev_98" ] pull_request: - branches: [ "dev_98", "dev_20", "release" ] + branches: [ "dev", "dev_98" ] jobs: buildAndRunAll: diff --git a/.gitmodules b/.gitmodules index e2264cb6..c27e7cf7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,3 @@ path = submodules/sompy url = git@github.com:sorgom/sompy.git branch = dev -[submodule "sombin"] - path = submodules/sombin - url = git@github.com:sorgom/sombin.git - branch = dev diff --git a/application/components/COM/src/TCP_Com.cpp b/application/components/COM/src/TCP_Com.cpp index bb707b76..835700b4 100644 --- a/application/components/COM/src/TCP_Com.cpp +++ b/application/components/COM/src/TCP_Com.cpp @@ -2,8 +2,6 @@ #include #include -using std::endl; - std::ostream& TCP_Com_Base::comerr() { return IL::getLog().log(COMP_COM, RET_ERR_COM) << "E "; @@ -20,17 +18,17 @@ bool Tcp_Listener_Base::listen(const UINT16 port) if (mSocket < 0) { ok = false; - comerr() << "socket " << port << endl; + comerr() << "socket " << port << '\n'; } else if (not tcp.bind(mSocket, port)) { ok = false; - comerr() << "bind " << port << endl; + comerr() << "bind " << port << '\n'; } else if (not tcp.listen(mSocket)) { ok = false; - comerr() << "listen " << port << endl; + comerr() << "listen " << port << '\n'; } if (not ok) @@ -50,7 +48,7 @@ bool Tcp_Listener_Base::select() if (not ok) { - comerr() << "select" << endl; + comerr() << "select" << '\n'; tcp.close(mSocket); } return ok; @@ -93,7 +91,7 @@ bool TCP_Con_Base::accept(const INT32 socket) } else { - comerr() << "accept" << endl; + comerr() << "accept" << '\n'; } return ok; } @@ -136,7 +134,7 @@ bool TCP_Con_Base::select() } if (not ok) { - comerr() << "select" << endl; + comerr() << "select" << '\n'; } return ok; } diff --git a/application/main/AppMain.cpp b/application/main/AppMain.cpp index 7cbbf66c..f2d9eb04 100644 --- a/application/main/AppMain.cpp +++ b/application/main/AppMain.cpp @@ -1,6 +1,6 @@ #include #include -using std::cout, std::endl; +using std::cout; #include using std::setw; @@ -10,19 +10,19 @@ int main(const INT32 argc, const CONST_C_STRING* const argv) E_Ret res = IL::getLog().maxerr(); cout - << "TSW: " << setw(5) << IL::getTSW_Provider().size() << endl - << "SIG: " << setw(5) << IL::getSIG_Provider().size() << endl - << "LCR: " << setw(5) << IL::getLCR_Provider().size() << endl - << "ERR: " << setw(5) << static_cast(res) << endl + << "TSW: " << setw(5) << IL::getTSW_Provider().size() << '\n' + << "SIG: " << setw(5) << IL::getSIG_Provider().size() << '\n' + << "LCR: " << setw(5) << IL::getLCR_Provider().size() << '\n' + << "ERR: " << setw(5) << static_cast(res) << '\n' ; if (res == RET_NO_ERR and argc > 1) { - cout << "run .." << endl; + cout << "run .." << '\n'; IL::getCom().run(); res = IL::getLog().maxerr(); cout - << "ERR: " << setw(5) << static_cast(res) << endl + << "ERR: " << setw(5) << static_cast(res) << '\n' ; } return res; diff --git a/devel/qnd/useCout.h b/devel/qnd/useCout.h index 9a1a607b..788bb6e0 100644 --- a/devel/qnd/useCout.h +++ b/devel/qnd/useCout.h @@ -11,10 +11,10 @@ #include #include -using std::ostream, std::cout, std::endl; +using std::ostream, std::cout; #include using std::setw, std::left, std::right, std::setfill, std::hex; #include -#define TRACEVAR(VAR) cout << #VAR << ": " << VAR << endl; +#define TRACEVAR(VAR) cout << #VAR << ": " << VAR << '\n'; diff --git a/make/bullseye/_covreport.cmd b/make/bullseye/_covreport.cmd index 16dd0390..324f0741 100644 --- a/make/bullseye/_covreport.cmd +++ b/make/bullseye/_covreport.cmd @@ -26,7 +26,7 @@ cd %dstwDir% if %_gentodo% ( echo - todo covbr -qu --srcdir . > %covTodoTxt% - %binDir%\covbr2html.exe -co %myReportsDir% %covTodoTxt% + %pyDir%\covbr2html\covbr2html.py -co %myReportsDir% %covTodoTxt% ) if %_genmd% call %myDir%\_cov2md.cmd diff --git a/make/bullseye/_covsetup.cmd b/make/bullseye/_covsetup.cmd index 83399d90..eb57eb3d 100644 --- a/make/bullseye/_covsetup.cmd +++ b/make/bullseye/_covsetup.cmd @@ -14,7 +14,7 @@ set subsDir=%cd%\submodules set ReportsDir=%cd%\reports set myReportsDir=%reportsDir%\%_me% -set binDir=%subsDir%\sombin +set pyDir=%subsDir%\sompy set vsSolution=%makeDir%\DSTW.sln set exeDir=%buildDir%\windows\bin set buildLog=%myReportsDir%\build.txt @@ -33,7 +33,8 @@ set tmpCmd=%buildDir%\tmp.cmd md %buildDir% >NUL 2>&1 -%binDir%\docopts.exe %optsTxt% %* > %tmpCmd% +%pyDir%\somutil\docopts.py %optsTxt% %* > %tmpCmd% +if %errorlevel% NEQ 0 exit /b 1 call %tmpCmd% if not exist %covfile% set _c=1==1 diff --git a/make/runSub.cmd b/make/runSub.cmd index f071a7fd..e8cf3c4f 100644 --- a/make/runSub.cmd +++ b/make/runSub.cmd @@ -2,6 +2,5 @@ SETLOCAL set tsfile=%1 call %2 %3 %4 %5 %6 %7 %8 %9 -echo return code: %errorlevel% del /Q %tsfile% 2>nul exit 0 diff --git a/make/runSystemTests.cmd b/make/runSystemTests.cmd index 44fb87f8..cef654af 100644 --- a/make/runSystemTests.cmd +++ b/make/runSystemTests.cmd @@ -10,16 +10,14 @@ cd .. set buildDir=%cd%\build set bindir=windows\bin cd %myDir% +echo - build msbuild DSTW.sln -t:dstw_gen,dstw_runtime,systemtests,dstw_stop >NUL if %errorlevel% neq 0 exit /b %errorlevel% set tmpfile=tmp_%random%.txt cd %buildDir% - -%binDir%\dstw_stop.exe -timeout /t 1 /nobreak >nul - +echo - run rem gen required proj data file %binDir%\dstw_gen.exe rem start app in background @@ -30,8 +28,10 @@ rem run tests set ret=%errorlevel% rem stop app anyway %binDir%\dstw_stop.exe +goto check :wait -timeout /t 1 /nobreak >nul +timeout /t 1 /nobreak >NUL +:check if exist %tmpfile% goto wait exit /b %ret% diff --git a/submodules/sombin b/submodules/sombin deleted file mode 160000 index 784ae01b..00000000 --- a/submodules/sombin +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 784ae01b02461e246b7e2fc3969bf3a9173aa4c4 diff --git a/submodules/sompy b/submodules/sompy index 15bb4709..0e167f8c 160000 --- a/submodules/sompy +++ b/submodules/sompy @@ -1 +1 @@ -Subproject commit 15bb470954eca7bd0442574c6c835034e60e3481 +Subproject commit 0e167f8c8d3b9e3f776d3252b87ac37e64f26a92 diff --git a/testing/testenv/comparators/Comparator.h b/testing/testenv/comparators/Comparator.h index 4d718a24..8efcf1cf 100644 --- a/testing/testenv/comparators/Comparator.h +++ b/testing/testenv/comparators/Comparator.h @@ -41,7 +41,7 @@ namespace test SimpleString valueToString(CPTR ptr) { - begin() << std::endl << *reinterpret_cast(ptr); + begin() << '\n' << *reinterpret_cast(ptr); // content is copied by CppUTest // cppcheck-suppress returnDanglingLifetime return mStream.str().c_str(); diff --git a/testing/testenv/comparators/ostreamHelpers.h b/testing/testenv/comparators/ostreamHelpers.h index 76cd7c91..ebd39d1f 100644 --- a/testing/testenv/comparators/ostreamHelpers.h +++ b/testing/testenv/comparators/ostreamHelpers.h @@ -37,15 +37,15 @@ // output line for standard types #define DOUT(NAME) \ - OUT_BEGIN(NAME) << d.NAME << std::endl + OUT_BEGIN(NAME) << d.NAME << '\n' // output line for fixed character types #define DFIX(NAME) \ - OUT_BEGIN(NAME) << fixT(d.NAME) << std::endl + OUT_BEGIN(NAME) << fixT(d.NAME) << '\n' // output line for UINT8 arrays #define DU8X(NAME) \ - OUT_BEGIN(NAME) << fixU(d.NAME) << std::endl + OUT_BEGIN(NAME) << fixU(d.NAME) << '\n' // helper struct for fixed array types template diff --git a/testing/testenv/comparators/src/Comparator.cpp b/testing/testenv/comparators/src/Comparator.cpp index be9deaba..6b85ee7c 100644 --- a/testing/testenv/comparators/src/Comparator.cpp +++ b/testing/testenv/comparators/src/Comparator.cpp @@ -6,6 +6,6 @@ namespace test std::ostream& ComparatorBase::begin() { mStream.str(""); - return mStream << std::endl; + return mStream << '\n'; } -} \ No newline at end of file +}