Skip to content

Commit

Permalink
Som devel (#72)
Browse files Browse the repository at this point in the history
* removed std::endl

* progress

* fix: covbr2html -> py

* no more sombin

* update sompy

* adapted ci
  • Loading branch information
sorgom authored Nov 17, 2024
1 parent b034f37 commit 636f916
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@
path = submodules/sompy
url = [email protected]:sorgom/sompy.git
branch = dev
[submodule "sombin"]
path = submodules/sombin
url = [email protected]:sorgom/sombin.git
branch = dev
14 changes: 6 additions & 8 deletions application/components/COM/src/TCP_Com.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#include <SYS/IL.h>
#include <BAS/coverage.h>

using std::endl;

std::ostream& TCP_Com_Base::comerr()
{
return IL::getLog().log(COMP_COM, RET_ERR_COM) << "E ";
Expand All @@ -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)
Expand All @@ -50,7 +48,7 @@ bool Tcp_Listener_Base::select()

if (not ok)
{
comerr() << "select" << endl;
comerr() << "select" << '\n';
tcp.close(mSocket);
}
return ok;
Expand Down Expand Up @@ -93,7 +91,7 @@ bool TCP_Con_Base::accept(const INT32 socket)
}
else
{
comerr() << "accept" << endl;
comerr() << "accept" << '\n';
}
return ok;
}
Expand Down Expand Up @@ -136,7 +134,7 @@ bool TCP_Con_Base::select()
}
if (not ok)
{
comerr() << "select" << endl;
comerr() << "select" << '\n';
}
return ok;
}
Expand Down
14 changes: 7 additions & 7 deletions application/main/AppMain.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <SYS/IL.h>
#include <iostream>
using std::cout, std::endl;
using std::cout;
#include <iomanip>
using std::setw;

Expand All @@ -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<UINT16>(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<UINT16>(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<UINT16>(res) << endl
<< "ERR: " << setw(5) << static_cast<UINT16>(res) << '\n'
;
}
return res;
Expand Down
4 changes: 2 additions & 2 deletions devel/qnd/useCout.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

#include <iostream>
#include <iomanip>
using std::ostream, std::cout, std::endl;
using std::ostream, std::cout;
#include <iomanip>
using std::setw, std::left, std::right, std::setfill, std::hex;

#include <cstdio>

#define TRACEVAR(VAR) cout << #VAR << ": " << VAR << endl;
#define TRACEVAR(VAR) cout << #VAR << ": " << VAR << '\n';
2 changes: 1 addition & 1 deletion make/bullseye/_covreport.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions make/bullseye/_covsetup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion make/runSub.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions make/runSystemTests.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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%
1 change: 0 additions & 1 deletion submodules/sombin
Submodule sombin deleted from 784ae0
2 changes: 1 addition & 1 deletion testing/testenv/comparators/Comparator.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace test

SimpleString valueToString(CPTR ptr)
{
begin() << std::endl << *reinterpret_cast<const T*>(ptr);
begin() << '\n' << *reinterpret_cast<const T*>(ptr);
// content is copied by CppUTest
// cppcheck-suppress returnDanglingLifetime
return mStream.str().c_str();
Expand Down
6 changes: 3 additions & 3 deletions testing/testenv/comparators/ostreamHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
Expand Down
4 changes: 2 additions & 2 deletions testing/testenv/comparators/src/Comparator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ namespace test
std::ostream& ComparatorBase::begin()
{
mStream.str("");
return mStream << std::endl;
return mStream << '\n';
}
}
}

0 comments on commit 636f916

Please sign in to comment.