diff --git a/.gitHooks/pre-commit b/.gitHooks/pre-commit index 84aa60cc..3653c2b7 100644 --- a/.gitHooks/pre-commit +++ b/.gitHooks/pre-commit @@ -13,16 +13,16 @@ fi cd $(git rev-parse --show-toplevel) # path to sompy python scripts -sompy=$(pwd)/sompy/somutil +sompy=$(pwd)/submodules/sompy/somutil mdjs= svgs= # files regarded as text files to be cleaned txts= # extensions of text files sorted by likeliness -xtxt="h cpp cmd py md" +xtxt="h cpp cmd py md lua" -for file in `git diff-index --cached --name-only HEAD`; do +for file in $(git diff-index --cached --name-only HEAD); do if [[ -f $file ]] then if [[ $file == *.mdj ]]; then mdjs="$mdjs $file" @@ -45,6 +45,6 @@ if [[ -n $svgs ]]; then fi if [[ -n $txts ]]; then echo cleaning text files - $py $sompy/cleanTxt.py $txts + $py $sompy/cleanTxt.py -l $txts fi for file in $mdjs $svgs $txts; do git add $file; done diff --git a/.gitattributes b/.gitattributes index a27d0376..5d500988 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,5 @@ # all text files unix line endings * text=auto eol=lf -*.cmd eol=crlf -*.bat eol=crlf *.svg text eol=lf *.mdj text eol=lf diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index c909c590..1fa8b3e7 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -2,7 +2,7 @@ # continuous integration setup # ============================================================ # created by Manfred Sorgo -name: C/C++ CI +name: DSTW CI on: push: @@ -22,14 +22,14 @@ jobs: submodules: 'true' - name: build and run all - run: chmod 755 make/*.sh; make/build.sh -cr - - - name: check coverage - run: make/runGcov.sh + run: chmod 755 make/*.sh; make/buildAndRun.sh - name: run system tests run: make/runSystemTests.sh + - name: check coverage + run: make/runGcov.sh + # - name: check env # run: make/checkEnv.sh diff --git a/.gitignore b/.gitignore index 5f9b2e03..5e38ae78 100644 --- a/.gitignore +++ b/.gitignore @@ -32,12 +32,7 @@ *.app # premake / build -Makefile build -bin -obj -lib -exe .vs *.vcxproj.* *.vcxproj diff --git a/.gitmodules b/.gitmodules index 27089564..e2264cb6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,11 +1,15 @@ [submodule "cpputest"] - path = cpputest + path = submodules/cpputest url = git@github.com:cpputest/cpputest.git [submodule "CppUTestSteps"] - path = CppUTestSteps + path = submodules/CppUTestSteps url = git@github.com:sorgom/CppUTestSteps.git branch = dev [submodule "sompy"] - path = sompy + 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/BAS/NcpIndex.h b/application/components/BAS/AcpIndex.h similarity index 61% rename from application/components/BAS/NcpIndex.h rename to application/components/BAS/AcpIndex.h index b2eff74e..c73961fe 100644 --- a/application/components/BAS/NcpIndex.h +++ b/application/components/BAS/AcpIndex.h @@ -1,11 +1,11 @@ // ============================================================ -// name, component, position +// addr, component, position // ============================================================ // created by Manfred Sorgo #pragma once -#ifndef NCPINDEX_H -#define NCPINDEX_H +#ifndef ACPINDEX_H +#define ACPINDEX_H #include #include @@ -13,39 +13,39 @@ #include -struct Ncp +struct Acp { - const ComName name; + const ComAddr addr; const UINT8 comp; const size_t pos; - inline Ncp( - const ComName& name, + inline Acp( + const ComAddr& addr, UINT8 comp = 0, size_t pos = 0 ): - name(name), + addr(addr), comp(comp), pos(pos) {} - NOCOPY(Ncp) + NOCOPY(Acp) }; #include // ============================================================ -// class NcpIndex is the core of Dispatcher +// class AcpIndex is the core of Dispatcher // see interface I_Dispatcher // ============================================================ -class NcpIndex : public Index +class AcpIndex : public Index { public: - inline NcpIndex() = default; - NOCOPY(NcpIndex) + inline AcpIndex() = default; + NOCOPY(AcpIndex) protected: - inline const ComName& getKey(const Ncp& ncp) const final + inline const ComAddr& getKey(const Acp& acp) const final { - return ncp.name; + return acp.addr; } }; #endif // _H diff --git a/application/components/BAS/coverage.h b/application/components/BAS/coverage.h new file mode 100644 index 00000000..40452378 --- /dev/null +++ b/application/components/BAS/coverage.h @@ -0,0 +1,28 @@ +// coverage instrumentation exception handling +// > works with compilers +// that support _Pragma(string-literal) directive +// - documented for: +// - gcc : https://gcc.gnu.org/onlinedocs/cpp/Pragmas.html +// - msvc: https://learn.microsoft.com/en-us/cpp/preprocessor/pragma-directives-and-the-pragma-keyword + +// created by Manfred Sorgo +#pragma once +#ifndef COVERAGE_H +#define COVERAGE_H + +// bullseye coverage +#if _BullseyeCoverage + // pause coverage instrumentation + #define COVERAGE_PAUSE _Pragma("BullseyeCoverage off") + // resume coverage instrumentation + #define COVERAGE_RESUME _Pragma("BullseyeCoverage on") + // force coverage of simple boolean expressions + // by converting them to ternary expressions + #define B(SIMPLE_EXPR) (SIMPLE_EXPR ? true : false) +#else + #define COVERAGE_PAUSE + #define COVERAGE_RESUME + #define B(SIMPLE_EXPR) SIMPLE_EXPR +#endif + +#endif // _H diff --git a/application/components/BAS/src/BAS_Provider.cpp b/application/components/BAS/src/BAS_Provider.cpp index c880e964..05448528 100644 --- a/application/components/BAS/src/BAS_Provider.cpp +++ b/application/components/BAS/src/BAS_Provider.cpp @@ -9,7 +9,7 @@ void BAS_Provider::load(const ProjItem* data, const UINT32 num) bool ok = true; for (UINT32 n = 0; ok and (n < num); ++n, ++data) { - const PosRes res = IL::getDispatcher().assign(data->name, comp(), n); + const PosRes res = IL::getDispatcher().assign(data->addr, comp(), n); ok = res.valid and add(res.pos, *data); } if (not ok) diff --git a/application/components/BAS/utilz.h b/application/components/BAS/utilz.h new file mode 100644 index 00000000..8fa583b7 --- /dev/null +++ b/application/components/BAS/utilz.h @@ -0,0 +1,29 @@ +// ============================================================ +// misc utilities +// ============================================================ +// created by Manfred Sorgo +#pragma once +#ifndef UTILZ_H +#define UTILZ_H + +#include + +template +using data_tn = UINT8[N]; + +// get byte subset of an object +template +inline const data_tn& getn(const T& obj) +{ + static_assert(P + N <= sizeof(T)); + return *(reinterpret_cast*>(&obj) + P); +} + +// get byte subset of ComData +template +inline const data_tn& getn(const ComData& obj) +{ + return getn(obj); +} + +#endif // _H diff --git a/application/components/COM/TCP.h b/application/components/COM/TCP.h index d1c220fc..e850625f 100644 --- a/application/components/COM/TCP.h +++ b/application/components/COM/TCP.h @@ -25,7 +25,7 @@ class TCP : public I_TCP bool listen(INT32 socket) const; - INT32 select(INT32 socket) const; + E_Select select(INT32 socket) const; INT32 accept(INT32 socket) const; diff --git a/application/components/COM/src/TCP.cpp b/application/components/COM/src/TCP.cpp index a8410b29..e533df84 100644 --- a/application/components/COM/src/TCP.cpp +++ b/application/components/COM/src/TCP.cpp @@ -1,4 +1,5 @@ #include +#include #ifdef _WIN32 #include @@ -53,22 +54,31 @@ bool TCP::listen(const INT32 socket) const return ::listen(socket, SOMAXCONN) >= 0; } -INT32 TCP::select(const INT32 socket) const +E_Select TCP::select(const INT32 socket) const { fd_set readfds; +#ifdef _WIN32 +#pragma warning(disable:4389) +#endif + // interns of fd_set macros must not be coverage instrumented +COVERAGE_PAUSE FD_ZERO(&readfds); FD_SET(socket, &readfds); +COVERAGE_RESUME +#ifdef _WIN32 +#pragma warning(default:4389) +#endif timeval timeout; timeout.tv_sec = mSec; timeout.tv_usec = mMicro; - INT32 ret = 0; + E_Select ret = SELECT_NONE; if (::select(socket + 1, &readfds, nullptr, nullptr, &timeout) < 0) { - ret = -1; + ret = SELECT_ERR; } else if (FD_ISSET(socket, &readfds)) { - ret = 1; + ret = SELECT_READY; } return ret; } diff --git a/application/components/COM/src/TCP_Com.cpp b/application/components/COM/src/TCP_Com.cpp index df4ff292..bb707b76 100644 --- a/application/components/COM/src/TCP_Com.cpp +++ b/application/components/COM/src/TCP_Com.cpp @@ -1,5 +1,6 @@ #include #include +#include using std::endl; @@ -78,7 +79,6 @@ I_TCP_Con& TCP_Listener_Ctrl::getCon() const } INSTANCE_DEF(TCP_Listener_Ctrl) - // ============================================================ // TCP connections // ============================================================ diff --git a/application/components/LCR/src/LCR_X.cpp b/application/components/LCR/src/LCR_X.cpp index 02cc7b51..83f11d1e 100644 --- a/application/components/LCR/src/LCR_X.cpp +++ b/application/components/LCR/src/LCR_X.cpp @@ -1,5 +1,6 @@ #include #include +#include void LCR_X::open() { @@ -107,8 +108,7 @@ bool LCR_UBK::validUbk(const UINT8 state) void LCR_UBK::fromFld(const ComData& data) { - const auto state = data.param1; - const auto ubk = data.param2; + const auto [state, ubk] = getn<2>(data); if ( ( (state != mStateToGui) or diff --git a/application/components/SIG/src/SIG_X.cpp b/application/components/SIG/src/SIG_X.cpp index 93531767..38bdd6a7 100644 --- a/application/components/SIG/src/SIG_X.cpp +++ b/application/components/SIG/src/SIG_X.cpp @@ -1,5 +1,6 @@ #include #include +#include void SIG_X::procFromFld(const UINT8 state) { @@ -152,7 +153,7 @@ void SIG_H::proc_H1() void SIG_N::fromFld(const ComData& data) { - const auto state = data.param1, speed = data.param2; + const auto [ state, speed ] = getn<2>(data); switch (state) { case SIG_STATE_UNDEF: @@ -169,7 +170,7 @@ void SIG_N::fromFld(const ComData& data) void SIG_N::fromGui(const ComData& data) { - const auto state = data.param1, speed = data.param2; + const auto [ state, speed ] = getn<2>(data); switch (state) { case SIG_STATE_N0: @@ -216,7 +217,7 @@ void SIG_N::proc_N1(const UINT8 speed) void SIG_H_N::fromFld(const ComData& data) { - const auto state = data.param1, speed = data.param2; + const auto [ state, speed ] = getn<2>(data); switch (state) { case SIG_STATE_UNDEF: @@ -235,7 +236,7 @@ void SIG_H_N::fromFld(const ComData& data) void SIG_H_N::fromGui(const ComData& data) { - const auto state = data.param1, speed = data.param2; + const auto [ state, speed ] = getn<2>(data); switch (state) { case SIG_STATE_H0_N0: diff --git a/application/components/SYS/Dispatcher.h b/application/components/SYS/Dispatcher.h index e8609325..55f65306 100644 --- a/application/components/SYS/Dispatcher.h +++ b/application/components/SYS/Dispatcher.h @@ -7,7 +7,7 @@ #define DISPATCHER_H #include -#include +#include #include #include @@ -18,7 +18,7 @@ class Dispatcher : public I_Dispatcher void clear() override; void index() override; - const PosRes assign(const ComName& name, E_Comp comp, size_t pos) override; + const PosRes assign(const ComAddr& addr, E_Comp comp, size_t pos) override; void fromFld(const ComTele& tele) const override; void fromGui(const ComTele& tele) const override; @@ -33,10 +33,10 @@ class Dispatcher : public I_Dispatcher NOCOPY(Dispatcher) private: - NcpIndex mIndx; + AcpIndex mIndx; inline Dispatcher() = default; - static void forwardFld(I_Provider& prov, const Ncp& ncp, const ComTele& tele); - static void forwardGui(I_Provider& prov, const Ncp& ncp, const ComTele& tele); + static void forwardFld(I_Provider& prov, const Acp& acp, const ComTele& tele); + static void forwardGui(I_Provider& prov, const Acp& acp, const ComTele& tele); static void reGui(I_Provider& prov); }; #endif // _H diff --git a/application/components/SYS/src/Dispatcher.cpp b/application/components/SYS/src/Dispatcher.cpp index 5324f6c0..34b950ab 100644 --- a/application/components/SYS/src/Dispatcher.cpp +++ b/application/components/SYS/src/Dispatcher.cpp @@ -19,31 +19,31 @@ void Dispatcher::index() } const PosRes Dispatcher::assign( - const ComName& name, + const ComAddr& addr, const E_Comp comp, const size_t pos) { - mIndx.add(name, comp, pos); + mIndx.add(addr, comp, pos); return PosRes{true, mIndx.size() - 1}; } void Dispatcher::fromFld(const ComTele& tele) const { - const PosRes res = mIndx.find(tele.name); + const PosRes res = mIndx.find(tele.addr); if (res.valid) { - const Ncp& ncp = mIndx.at(res); - switch (ncp.comp) + const Acp& acp = mIndx.at(res); + switch (acp.comp) { case COMP_TSW: - forwardFld(IL::getTSW_Provider(), ncp, tele); + forwardFld(IL::getTSW_Provider(), acp, tele); break; case COMP_SIG: - forwardFld(IL::getSIG_Provider(), ncp, tele); + forwardFld(IL::getSIG_Provider(), acp, tele); break; case COMP_LCR: - forwardFld(IL::getLCR_Provider(), ncp, tele); + forwardFld(IL::getLCR_Provider(), acp, tele); break; case COMP_SEG: break; @@ -59,21 +59,21 @@ void Dispatcher::fromFld(const ComTele& tele) const void Dispatcher::fromGui(const ComTele& tele) const { - const PosRes res = mIndx.find(tele.name); + const PosRes res = mIndx.find(tele.addr); if (res.valid) { - const Ncp& ncp = mIndx.at(res); - switch (ncp.comp) + const Acp& acp = mIndx.at(res); + switch (acp.comp) { case COMP_TSW: - forwardGui(IL::getTSW_Provider(), ncp, tele); + forwardGui(IL::getTSW_Provider(), acp, tele); break; case COMP_SIG: - forwardGui(IL::getSIG_Provider(), ncp, tele); + forwardGui(IL::getSIG_Provider(), acp, tele); break; case COMP_LCR: - forwardGui(IL::getLCR_Provider(), ncp, tele); + forwardGui(IL::getLCR_Provider(), acp, tele); break; case COMP_SEG: break; @@ -91,7 +91,7 @@ void Dispatcher::toFld(const size_t id, const ComData& data) const { if (mIndx.size() > id) { - const ComTele tele { mIndx.at(id).name, data }; + const ComTele tele { mIndx.at(id).addr, data }; IL::getCom().toFld(tele); } } @@ -100,7 +100,7 @@ void Dispatcher::toGui(const size_t id, const ComData& data) const { if (mIndx.size() > id) { - const ComTele tele { mIndx.at(id).name, data }; + const ComTele tele { mIndx.at(id).addr, data }; IL::getCom().toGui(tele); } } @@ -121,22 +121,22 @@ void Dispatcher::reGui(I_Provider& prov) } } -void Dispatcher::forwardFld(I_Provider& prov, const Ncp& ncp, const ComTele& tele) +void Dispatcher::forwardFld(I_Provider& prov, const Acp& acp, const ComTele& tele) { - if (prov.size() > ncp.pos) + if (prov.size() > acp.pos) { - prov.at(ncp.pos).fromFld(tele.data); + prov.at(acp.pos).fromFld(tele.data); } else { IL::getLog().log(COMP_SYS, RET_ERR_RANGE); } } -void Dispatcher::forwardGui(I_Provider& prov, const Ncp& ncp, const ComTele& tele) +void Dispatcher::forwardGui(I_Provider& prov, const Acp& acp, const ComTele& tele) { - if (prov.size() > ncp.pos) + if (prov.size() > acp.pos) { - prov.at(ncp.pos).fromGui(tele.data); + prov.at(acp.pos).fromGui(tele.data); } else { diff --git a/make/Makefile b/make/Makefile new file mode 100644 index 00000000..e26aae8a --- /dev/null +++ b/make/Makefile @@ -0,0 +1,128 @@ +# Alternative GNU Make workspace makefile autogenerated by Premake + +ifndef config + config=ci +endif + +ifndef verbose + SILENT = @ +endif + +ifeq ($(config),ci) + cpputest_config = ci + moduletests_config = ci + devtests_config = ci + dstw_gen_config = ci + dstw_runtime_config = ci + systemtests_config = ci + dstw_stop_config = ci + gcov_app_config = ci + gcov_tests_config = ci + +else ifeq ($(config),debug) + cpputest_config = debug + moduletests_config = debug + devtests_config = debug + dstw_gen_config = debug + dstw_runtime_config = debug + systemtests_config = debug + dstw_stop_config = debug + gcov_app_config = debug + gcov_tests_config = debug + +else + $(error "invalid configuration $(config)") +endif + +PROJECTS := cpputest moduletests devtests dstw_gen dstw_runtime systemtests dstw_stop gcov_app gcov_tests + +.PHONY: all clean help $(PROJECTS) + +all: $(PROJECTS) + +cpputest: +ifneq (,$(cpputest_config)) + @echo "==== Building cpputest ($(cpputest_config)) ====" + @${MAKE} --no-print-directory -C . -f cpputest.make config=$(cpputest_config) +endif + +moduletests: cpputest +ifneq (,$(moduletests_config)) + @echo "==== Building moduletests ($(moduletests_config)) ====" + @${MAKE} --no-print-directory -C . -f moduletests.make config=$(moduletests_config) +endif + +devtests: cpputest +ifneq (,$(devtests_config)) + @echo "==== Building devtests ($(devtests_config)) ====" + @${MAKE} --no-print-directory -C . -f devtests.make config=$(devtests_config) +endif + +dstw_gen: +ifneq (,$(dstw_gen_config)) + @echo "==== Building dstw_gen ($(dstw_gen_config)) ====" + @${MAKE} --no-print-directory -C . -f dstw_gen.make config=$(dstw_gen_config) +endif + +dstw_runtime: +ifneq (,$(dstw_runtime_config)) + @echo "==== Building dstw_runtime ($(dstw_runtime_config)) ====" + @${MAKE} --no-print-directory -C . -f dstw_runtime.make config=$(dstw_runtime_config) +endif + +systemtests: cpputest +ifneq (,$(systemtests_config)) + @echo "==== Building systemtests ($(systemtests_config)) ====" + @${MAKE} --no-print-directory -C . -f systemtests.make config=$(systemtests_config) +endif + +dstw_stop: +ifneq (,$(dstw_stop_config)) + @echo "==== Building dstw_stop ($(dstw_stop_config)) ====" + @${MAKE} --no-print-directory -C . -f dstw_stop.make config=$(dstw_stop_config) +endif + +gcov_app: +ifneq (,$(gcov_app_config)) + @echo "==== Building gcov_app ($(gcov_app_config)) ====" + @${MAKE} --no-print-directory -C . -f gcov_app.make config=$(gcov_app_config) +endif + +gcov_tests: gcov_app cpputest +ifneq (,$(gcov_tests_config)) + @echo "==== Building gcov_tests ($(gcov_tests_config)) ====" + @${MAKE} --no-print-directory -C . -f gcov_tests.make config=$(gcov_tests_config) +endif + +clean: + @${MAKE} --no-print-directory -C . -f cpputest.make clean + @${MAKE} --no-print-directory -C . -f moduletests.make clean + @${MAKE} --no-print-directory -C . -f devtests.make clean + @${MAKE} --no-print-directory -C . -f dstw_gen.make clean + @${MAKE} --no-print-directory -C . -f dstw_runtime.make clean + @${MAKE} --no-print-directory -C . -f systemtests.make clean + @${MAKE} --no-print-directory -C . -f dstw_stop.make clean + @${MAKE} --no-print-directory -C . -f gcov_app.make clean + @${MAKE} --no-print-directory -C . -f gcov_tests.make clean + +help: + @echo "Usage: make [config=name] [target]" + @echo "" + @echo "CONFIGURATIONS:" + @echo " ci" + @echo " debug" + @echo "" + @echo "TARGETS:" + @echo " all (default)" + @echo " clean" + @echo " cpputest" + @echo " moduletests" + @echo " devtests" + @echo " dstw_gen" + @echo " dstw_runtime" + @echo " systemtests" + @echo " dstw_stop" + @echo " gcov_app" + @echo " gcov_tests" + @echo "" + @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/make/build.sh b/make/build.sh deleted file mode 100644 index 9679863f..00000000 --- a/make/build.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash - -help() -{ - echo "Usage: $(basename $0) [options]" - echo "build all major makes parallelly" - echo "options:" - echo "-c clean ignored artifacts before" - echo "-p premake5 makefiles" - echo "-r run all binaries" - echo "-h this help" - exit -} - -function tm() -{ - en=$(date +%s) - printf "%-25s[%3d]\n" $1 $(($en-$2)) -} - -function mk() -{ - st=$(date +%s) - make -j -f $1 > /dev/null - if test $? -ne 0; then return 1; fi - tm ${1%.*} $st - return 0 -} - -clean= -run= -pre= -while getopts hcrp option; do - case $option in - (h) help;; - (c) clean=1;; - (r) run=1;; - (p) pre=1;; - esac -done - -cd $(dirname $0) - -if test ! -z $clean; then git clean -dfXq .; fi - -if test ! -z $pre; then premake5 gmake2; fi - -echo build ... -err=0 -pids=() -for fn in lib_*.make; do - mk $fn & pids+=($!) -done -for pid in ${pids[*]}; do - if ! wait $pid; then err=1; fi -done - -pids=() -for fn in $(ls *.make | grep -v '_'); do - mk $fn & pids+=($!) -done -for pid in ${pids[*]}; do - if ! wait $pid; then err=1; fi -done - -if test $err -ne 0; then exit 1; fi - -if test -z $run; then exit 0; fi - -for b in $(ls bin/* | grep -v systemtests_); do - echo '' - echo "====== $b" - $b - x=$? - echo 'returned' $x - if test $x -ne 0; then err=1; fi -done - -exit $err \ No newline at end of file diff --git a/make/buildAndRun.sh b/make/buildAndRun.sh new file mode 100644 index 00000000..778b556d --- /dev/null +++ b/make/buildAndRun.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# ==================================== +# build and run all tests and app +# ==================================== +cd $(dirname $0) +myDir=$(pwd) +cd .. +buildDir=$(pwd)/build +bindir=$buildDir/linux/bin + +cd $myDir +make -j + +cd $buildDir +tot=0 +for bin in $bindir/*; do +echo ==== $(basename $bin) +$bin +ret=$? +echo return: $ret +tot=$((tot+ret)) +done +if test $tot -eq 0; then echo OK; fi +exit $tot diff --git a/make/bullseye/genMd.cmd b/make/bullseye/_cov2md.cmd similarity index 54% rename from make/bullseye/genMd.cmd rename to make/bullseye/_cov2md.cmd index 9079484e..bc905db4 100644 --- a/make/bullseye/genMd.cmd +++ b/make/bullseye/_cov2md.cmd @@ -3,26 +3,18 @@ rem ======================================================================== rem Bullseye coverage: generate md file rem ======================================================================== SETLOCAL -set _me=%~n0 -call %~dp0_covdirs.cmd %* set reportMod=%reportsDir%\modTests\coverage.txt set reportSys=%reportsDir%\sysTests\coverage.txt set target=%dstwDir%\testing\coverage_bullseye.md -if not exist %reportMod% call %myDir%\modTests.cmd -if not exist %reportSys% call %myDir%\sysTests.cmd +if not exist %reportMod% exit /b 0 +if not exist %reportSys% exit /b 0 + +echo - md -if not exist %reportMod% ( - echo %reportMod% not found - exit /b 1 -) -if not exist %reportSys% ( - echo %reportSys% not found - exit /b 1 -) echo # current bullseye coverage > %target% +echo %DATE% >> %target% echo. >> %target% -cat %reportMod% >> %target% -echo. >> %target% -cat %reportSys% >> %target% +type %reportMod% >> %target% echo. >> %target% +type %reportSys% >> %target% diff --git a/make/bullseye/_covbuild.cmd b/make/bullseye/_covbuild.cmd index 83c9e294..8e703eaf 100644 --- a/make/bullseye/_covbuild.cmd +++ b/make/bullseye/_covbuild.cmd @@ -5,20 +5,12 @@ rem Bullseye coverage: build step rem ======================================================================== SETLOCAL -call cov01 -q %1 - -:next +cov01 -q %1 shift if "%1"=="" goto end echo -- %1 -call %vsCall% /t:%1 >> %buildLog% 2>&1 +call %vsCall% -t:%1 >> %buildLog% 2>&1 if %errorlevel% NEQ 0 ( - echo - build error - exit /b 1 -) -if not exist %exeDir%\%1.exe ( - echo - exe not found + echo - build error %1 exit /b 1 ) -goto next -:end diff --git a/make/bullseye/_covdirs.cmd b/make/bullseye/_covdirs.cmd deleted file mode 100644 index 8c4b78bd..00000000 --- a/make/bullseye/_covdirs.cmd +++ /dev/null @@ -1,15 +0,0 @@ -@echo off -if "%_me%" == "" exit /b 1 -rem ======================================================================== -rem Bullseye coverage: base directories -rem ======================================================================== -cd /d %~dp0 -set myDir=%cd% -cd .. -set makeDir=%cd% -cd .. -set dstwDir=%cd% - -set reportsDir=%dstwDir%\reports - -cd %myDir% diff --git a/make/bullseye/_covoptions.txt b/make/bullseye/_covoptions.txt index e26e6c7f..e4051763 100644 --- a/make/bullseye/_covoptions.txt +++ b/make/bullseye/_covoptions.txt @@ -1,9 +1,8 @@ options: --p [VS-version] run premake e.g. -p vs2019 -c force clean build -r remove reports -H generate HTML -u just update coverage file (no report, no HTML) +-t write todo files +-m write coverage md file (after module and system tests) -h this help - -all options must be given separately \ No newline at end of file diff --git a/make/bullseye/_covreport.cmd b/make/bullseye/_covreport.cmd index eeee6e15..16dd0390 100644 --- a/make/bullseye/_covreport.cmd +++ b/make/bullseye/_covreport.cmd @@ -4,29 +4,36 @@ rem ======================================================================== rem Bullseye coverage: reporting rem ======================================================================== +del /Q %buildLog% >NUL 2>&1 + if exist %testReport% ( echo - test errors - cat %testReport% + type %testReport% exit /b 1 ) -if %_update% == 1 exit /b 0 +if %_update% exit /b 0 set covMin=%minFunctionCov%,%minDecisionCov% -call covselect -qd -call covselect -q --import %excludeFile% +covselect -qd --import %excludeFile% -if %_genhtml% == 1 ( +if %_genhtml% ( echo - html - call covhtml -q --allNum %covHtmlDir% + covhtml -q --allNum %covHtmlDir% +) +cd %dstwDir% +if %_gentodo% ( + echo - todo + covbr -qu --srcdir . > %covTodoTxt% + %binDir%\covbr2html.exe -co %myReportsDir% %covTodoTxt% ) +if %_genmd% call %myDir%\_cov2md.cmd echo - report -echo ### %_me% %DATE% %TIME% > %covLog% +echo ### %_me% > %covLog% echo ``` >> %covLog% -cd %dstwDir% call covdir -q --by-name --srcdir . >> %covLog% set _result=failed @@ -34,4 +41,4 @@ call covdir -q --checkmin %covMin% if %errorlevel% == 0 set _result=passed echo covmin %covMin% %_result% >> %covLog% echo ``` >> %covLog% -cat %covLog% +type %covLog% diff --git a/make/bullseye/_covsetup.cmd b/make/bullseye/_covsetup.cmd new file mode 100644 index 00000000..83399d90 --- /dev/null +++ b/make/bullseye/_covsetup.cmd @@ -0,0 +1,76 @@ +@echo off +if "%_me%" == "" exit /b 1 +rem ======================================================================== +rem Bullseye coverage: base directories +rem ======================================================================== +cd /d %~dp0 +set myDir=%cd% +cd .. +set makeDir=%cd% +cd .. +set dstwDir=%cd% +set buildDir=%cd%\build +set subsDir=%cd%\submodules +set ReportsDir=%cd%\reports +set myReportsDir=%reportsDir%\%_me% + +set binDir=%subsDir%\sombin +set vsSolution=%makeDir%\DSTW.sln +set exeDir=%buildDir%\windows\bin +set buildLog=%myReportsDir%\build.txt +set covLog=%myReportsDir%\coverage.txt +set covHtmlDir=%myReportsDir%\html +set testReport=%myReportsDir%\test_errors.txt + +set covcopt=--srcdir %dstwDir% --macro +set covfile=%reportsDir%\%_me%.cov +set excludeFile=%myDir%\_covexclude.txt +set covTodoTxt=%buildDir%\%_me%_todo.txt + +set optsTxt=%myDir%\_covoptions.txt +set vsCall=msbuild %vsSolution% +set tmpCmd=%buildDir%\tmp.cmd + +md %buildDir% >NUL 2>&1 + +%binDir%\docopts.exe %optsTxt% %* > %tmpCmd% +call %tmpCmd% + +if not exist %covfile% set _c=1==1 + +if %_h% ( + echo. + echo usage: %_me%.cmd [options] + type %optsTxt% + exit /b 1 +) + +echo - setup + +if not exist %vsSolution% ( + echo %vsSolution% not found + echo use premak5 vs... in make folder to generate it + exit /b 1 +) + +if %_c% ( + echo - clean + del /Q %covfile% >NUL 2>&1 + %vsCall% -t:Clean >NUL +) +if %_r% ( + rmdir /S /Q %myReportsDir% >NUL 2>&1 +) +set _genhtml=%_Hu% +set _update=%_u% +set _gentodo=%_t% +set _genmd=%_m% + +md %myReportsDir% >NUL 2>&1 + +echo - build + +call %myDir%\_covbuild.cmd --off cpputest +if %errorlevel% NEQ 0 exit /b 1 + +cd %myDir% diff --git a/make/bullseye/_covstep1.cmd b/make/bullseye/_covstep1.cmd deleted file mode 100644 index 44c0a555..00000000 --- a/make/bullseye/_covstep1.cmd +++ /dev/null @@ -1,95 +0,0 @@ -@echo off -if "%_me%" == "" exit /b 1 -rem ======================================================================== -rem Bullseye coverage: build and run step 1 (requires VS shell) -rem ======================================================================== -rem setup -rem ======================================================================== -rem minmal coverage setup -rem - minimal function coverage % -set minFunctionCov=100 -rem - minimal decision coverage % -set minDecisionCov=99 - -call %~dp0_covdirs.cmd - -set premakeFile=%makeDir%\premake5_vs.lua - -set exeDir=%makeDir%\exe -set vsSolution=%makeDir%\dstw.sln -set vsConfig=ci -set myReportsDir=%reportsDir%\%_me% -set buildLog=%myReportsDir%\build_.txt -set covLog=%myReportsDir%\coverage.txt -set covHtmlDir=%myReportsDir%\html -set testReport=%myReportsDir%\test_errors.txt - -set covfile=%reportsDir%\%_me%.cov -set covcopt=--srcdir %dstwDir% -set excludeFile=%myDir%\_covexclude.txt -set optsTxt=%myDir%\_covoptions.txt - -set vsCall=msbuild %vsSolution% /p:Configuration=%vsConfig% - -rem ======================================================================== -rem CLI options -rem ======================================================================== -set _vsversion=vs2019 -set _premake=0 -set _cleanbuild=0 -set _cleanreports=0 -set _genhtml=0 -set _update=0 - -for %%p in (%*) do ( - if "%%p" == "-h" ( - echo Usage: %_me%.cmd [options] - cat %optsTxt% - exit /b 1 - ) else if "%%p" == "-c" ( - set _cleanbuild=1 - ) else if "%%p" == "-r" ( - set _cleanreports=1 - ) else if "%%p" == "-H" ( - set _genhtml=1 - ) else if "%%p" == "-u" ( - set _update=1 - ) else if "%%p" == "-p" ( - set _premake=1 - ) else ( - set _vsversion=%%p - ) -) - -rem ======================================================================== -rem common 1st steps -rem ======================================================================== -if not exist %vsSolution% set _premake=1 -if not exist %covfile% set _cleanbuild=1 - -if %_cleanreports% == 1 ( - echo - clean reports - if exist %myReportsDir% rm -rf %myReportsDir% -) - -if %_premake% == 1 ( - echo - premake for %_vsversion% - call premake5 --file=%premakeFile% %_vsversion% -) - -if %_cleanbuild% == 1 ( - echo - clean - if exist %covfile% rm -f %covfile% - call %vsCall% /t:clean >NUL -) - -if not exist %myReportsDir% mkdir %myReportsDir% - -echo %DATE% %TIME% > %buildLog% - -echo - build -call cov01 -q --off -echo -- cpputest -call %vsCall% /t:cpputest >> %buildLog% 2>&1 - -exit /b 0 diff --git a/make/bullseye/_runapp.cmd b/make/bullseye/_runapp.cmd index a9944955..0010bca4 100644 --- a/make/bullseye/_runapp.cmd +++ b/make/bullseye/_runapp.cmd @@ -5,6 +5,6 @@ rem ======================================================================== rem system tests: run app in background rem ======================================================================== echo running > %tmpFile% -call %exeDir%\dstw_run.exe loop >NUL +%exeDir%\%1.exe loop >NUL rm -f %tmpFile% exit 0 diff --git a/make/bullseye/modTests.cmd b/make/bullseye/modTests.cmd index 65bfcb02..babd7392 100644 --- a/make/bullseye/modTests.cmd +++ b/make/bullseye/modTests.cmd @@ -2,12 +2,17 @@ rem ======================================================================== rem Bullseye coverage: build and run module tests (requires VS shell) rem ======================================================================== - SETLOCAL set _me=%~n0 -call %~dp0_covstep1.cmd %* +call %~dp0_covsetup.cmd %* if %errorlevel% neq 0 exit /b 0 +rem minmal coverage setup +rem - minimal function coverage % +set minFunctionCov=100 +rem - minimal decision coverage % +set minDecisionCov=99 + call %myDir%\_covbuild.cmd --on moduletests if %errorlevel% NEQ 0 exit /b 1 @@ -16,7 +21,7 @@ if not exist %covfile% ( exit /b 1 ) -rm -f %buildLog% +del /Q %buildLog% >NUL 2>&1 rem rewind coverage file if it was not removed before call covclear -q diff --git a/make/bullseye/sysTests.cmd b/make/bullseye/sysTests.cmd index c0316e22..e2839428 100644 --- a/make/bullseye/sysTests.cmd +++ b/make/bullseye/sysTests.cmd @@ -5,45 +5,43 @@ rem ======================================================================== SETLOCAL set _me=%~n0 -call %~dp0_covstep1.cmd %* +call %~dp0_covsetup.cmd %* if %errorlevel% neq 0 exit /b 0 -call %myDir%\_covbuild.cmd --off dstw_gen dstw_stop systemtests_run -if %errorlevel% NEQ 0 exit /b 1 +rem - minimal function coverage % +set minFunctionCov=50 +rem - minimal decision coverage % +set minDecisionCov=30 -call %myDir%\_covbuild.cmd --on dstw_run +for %%t in (dstw_gen dstw_stop systemtests) do ( + call %myDir%\_covbuild.cmd --off %%t + if %errorlevel% NEQ 0 exit /b 1 +) +call %myDir%\_covbuild.cmd --on dstw_runtime if %errorlevel% NEQ 0 exit /b 1 -if not exist %covfile% ( - echo %covfile% not found - exit /b 1 -) -rm -f %buildLog% +cd /d %buildDir% echo - gen data -call %exeDir%\dstw_gen.exe >NUL +%exeDir%\dstw_gen.exe >NUL set /a "myID=%random%" -set tmpFile=%reportsDir%\run.%myID%.tmp +set tmpFile=%buildDir%\run.%myID%.tmp echo - launch application -start /B %myDir%\_runapp.cmd +start /B %myDir%\_runapp.cmd dstw_runtime -timeout /t 2 /nobreak >NUL 2>&1 +echo - wait +timeout /t 5 /nobreak >NUL 2>&1 echo - run tests -call %exeDir%\systemtests_run.exe -b -v > %testReport% 2>&1 -if %errorlevel% == 0 rm -f %testReport% +%exeDir%\systemtests.exe -b -v > %testReport% 2>&1 +if %errorlevel% == 0 del %testReport% echo - stop application ... -call %exeDir%\dstw_stop.exe +%exeDir%\dstw_stop.exe :wait timeout /t 1 /nobreak >NUL 2>&1 if exist %tmpFile% goto wait -rem - minimal function coverage % -set minFunctionCov=50 -rem - minimal decision coverage % -set minDecisionCov=30 - call %myDir%\_covreport.cmd diff --git a/make/coverage.make b/make/coverage.make deleted file mode 100644 index fab35761..00000000 --- a/make/coverage.make +++ /dev/null @@ -1,53 +0,0 @@ -# Alternative GNU Make workspace makefile autogenerated by Premake - -ifndef config - config=ci -endif - -ifndef verbose - SILENT = @ -endif - -ifeq ($(config),ci) - coverage_app_config = ci - coverage_tests_config = ci - -else - $(error "invalid configuration $(config)") -endif - -PROJECTS := coverage_app coverage_tests - -.PHONY: all clean help $(PROJECTS) - -all: $(PROJECTS) - -coverage_app: -ifneq (,$(coverage_app_config)) - @echo "==== Building coverage_app ($(coverage_app_config)) ====" - @${MAKE} --no-print-directory -C . -f coverage_app.make config=$(coverage_app_config) -endif - -coverage_tests: coverage_app -ifneq (,$(coverage_tests_config)) - @echo "==== Building coverage_tests ($(coverage_tests_config)) ====" - @${MAKE} --no-print-directory -C . -f coverage_tests.make config=$(coverage_tests_config) -endif - -clean: - @${MAKE} --no-print-directory -C . -f coverage_app.make clean - @${MAKE} --no-print-directory -C . -f coverage_tests.make clean - -help: - @echo "Usage: make [config=name] [target]" - @echo "" - @echo "CONFIGURATIONS:" - @echo " ci" - @echo "" - @echo "TARGETS:" - @echo " all (default)" - @echo " clean" - @echo " coverage_app" - @echo " coverage_tests" - @echo "" - @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/make/cppu_test.make b/make/cpputest.make similarity index 71% rename from make/cppu_test.make rename to make/cpputest.make index f1ee985c..a2e8e6bb 100644 --- a/make/cppu_test.make +++ b/make/cpputest.make @@ -19,9 +19,9 @@ endif # ############################################# RESCOMP = windres -TARGETDIR = lib -TARGET = $(TARGETDIR)/libcppu_test.a -INCLUDES += -I../cpputest/include +TARGETDIR = ../build/linux/lib +TARGET = $(TARGETDIR)/libcpputest.a +INCLUDES += -I../submodules/cpputest/include FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) @@ -36,18 +36,18 @@ define POSTBUILDCMDS endef ifeq ($(config),ci) -OBJDIR = obj/gcc/cppu_test/ci -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DNDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED -ALL_LDFLAGS += $(LDFLAGS) -s +OBJDIR = ../build/linux/obj/ci/cpputest +DEFINES += -DNDEBUG -DCPPUTEST_USE_LONG_LONG=0 -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -s -pthread else ifeq ($(config),debug) -OBJDIR = obj/gcc/cppu_test/debug -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED -ALL_LDFLAGS += $(LDFLAGS) +OBJDIR = ../build/linux/obj/debug/cpputest +DEFINES += -DDEBUG -DNDEBUG -DCPPUTEST_USE_LONG_LONG=0 -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -pthread endif @@ -140,7 +140,7 @@ all: $(TARGET) $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) $(PRELINKCMDS) - @echo Linking cppu_test + @echo Linking cpputest $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) @@ -161,7 +161,7 @@ else endif clean: - @echo Cleaning cppu_test + @echo Cleaning cpputest ifeq (posix,$(SHELLTYPE)) $(SILENT) rm -f $(TARGET) $(SILENT) rm -rf $(GENERATED) @@ -194,109 +194,109 @@ endif # File Rules # ############################################# -$(OBJDIR)/CommandLineArguments.o: ../cpputest/src/CppUTest/CommandLineArguments.cpp +$(OBJDIR)/CommandLineArguments.o: ../submodules/cpputest/src/CppUTest/CommandLineArguments.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/CommandLineTestRunner.o: ../cpputest/src/CppUTest/CommandLineTestRunner.cpp +$(OBJDIR)/CommandLineTestRunner.o: ../submodules/cpputest/src/CppUTest/CommandLineTestRunner.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/JUnitTestOutput.o: ../cpputest/src/CppUTest/JUnitTestOutput.cpp +$(OBJDIR)/JUnitTestOutput.o: ../submodules/cpputest/src/CppUTest/JUnitTestOutput.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MemoryLeakDetector.o: ../cpputest/src/CppUTest/MemoryLeakDetector.cpp +$(OBJDIR)/MemoryLeakDetector.o: ../submodules/cpputest/src/CppUTest/MemoryLeakDetector.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MemoryLeakWarningPlugin.o: ../cpputest/src/CppUTest/MemoryLeakWarningPlugin.cpp +$(OBJDIR)/MemoryLeakWarningPlugin.o: ../submodules/cpputest/src/CppUTest/MemoryLeakWarningPlugin.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SimpleMutex.o: ../cpputest/src/CppUTest/SimpleMutex.cpp +$(OBJDIR)/SimpleMutex.o: ../submodules/cpputest/src/CppUTest/SimpleMutex.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SimpleString.o: ../cpputest/src/CppUTest/SimpleString.cpp +$(OBJDIR)/SimpleString.o: ../submodules/cpputest/src/CppUTest/SimpleString.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SimpleStringInternalCache.o: ../cpputest/src/CppUTest/SimpleStringInternalCache.cpp +$(OBJDIR)/SimpleStringInternalCache.o: ../submodules/cpputest/src/CppUTest/SimpleStringInternalCache.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TeamCityTestOutput.o: ../cpputest/src/CppUTest/TeamCityTestOutput.cpp +$(OBJDIR)/TeamCityTestOutput.o: ../submodules/cpputest/src/CppUTest/TeamCityTestOutput.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestFailure.o: ../cpputest/src/CppUTest/TestFailure.cpp +$(OBJDIR)/TestFailure.o: ../submodules/cpputest/src/CppUTest/TestFailure.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestFilter.o: ../cpputest/src/CppUTest/TestFilter.cpp +$(OBJDIR)/TestFilter.o: ../submodules/cpputest/src/CppUTest/TestFilter.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestHarness_c.o: ../cpputest/src/CppUTest/TestHarness_c.cpp +$(OBJDIR)/TestHarness_c.o: ../submodules/cpputest/src/CppUTest/TestHarness_c.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestMemoryAllocator.o: ../cpputest/src/CppUTest/TestMemoryAllocator.cpp +$(OBJDIR)/TestMemoryAllocator.o: ../submodules/cpputest/src/CppUTest/TestMemoryAllocator.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestOutput.o: ../cpputest/src/CppUTest/TestOutput.cpp +$(OBJDIR)/TestOutput.o: ../submodules/cpputest/src/CppUTest/TestOutput.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestPlugin.o: ../cpputest/src/CppUTest/TestPlugin.cpp +$(OBJDIR)/TestPlugin.o: ../submodules/cpputest/src/CppUTest/TestPlugin.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestRegistry.o: ../cpputest/src/CppUTest/TestRegistry.cpp +$(OBJDIR)/TestRegistry.o: ../submodules/cpputest/src/CppUTest/TestRegistry.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestResult.o: ../cpputest/src/CppUTest/TestResult.cpp +$(OBJDIR)/TestResult.o: ../submodules/cpputest/src/CppUTest/TestResult.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestTestingFixture.o: ../cpputest/src/CppUTest/TestTestingFixture.cpp +$(OBJDIR)/TestTestingFixture.o: ../submodules/cpputest/src/CppUTest/TestTestingFixture.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/Utest.o: ../cpputest/src/CppUTest/Utest.cpp +$(OBJDIR)/Utest.o: ../submodules/cpputest/src/CppUTest/Utest.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/CodeMemoryReportFormatter.o: ../cpputest/src/CppUTestExt/CodeMemoryReportFormatter.cpp +$(OBJDIR)/CodeMemoryReportFormatter.o: ../submodules/cpputest/src/CppUTestExt/CodeMemoryReportFormatter.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/GTest.o: ../cpputest/src/CppUTestExt/GTest.cpp +$(OBJDIR)/GTest.o: ../submodules/cpputest/src/CppUTestExt/GTest.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/IEEE754ExceptionsPlugin.o: ../cpputest/src/CppUTestExt/IEEE754ExceptionsPlugin.cpp +$(OBJDIR)/IEEE754ExceptionsPlugin.o: ../submodules/cpputest/src/CppUTestExt/IEEE754ExceptionsPlugin.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MemoryReportAllocator.o: ../cpputest/src/CppUTestExt/MemoryReportAllocator.cpp +$(OBJDIR)/MemoryReportAllocator.o: ../submodules/cpputest/src/CppUTestExt/MemoryReportAllocator.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MemoryReportFormatter.o: ../cpputest/src/CppUTestExt/MemoryReportFormatter.cpp +$(OBJDIR)/MemoryReportFormatter.o: ../submodules/cpputest/src/CppUTestExt/MemoryReportFormatter.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MemoryReporterPlugin.o: ../cpputest/src/CppUTestExt/MemoryReporterPlugin.cpp +$(OBJDIR)/MemoryReporterPlugin.o: ../submodules/cpputest/src/CppUTestExt/MemoryReporterPlugin.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MockActualCall.o: ../cpputest/src/CppUTestExt/MockActualCall.cpp +$(OBJDIR)/MockActualCall.o: ../submodules/cpputest/src/CppUTestExt/MockActualCall.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MockExpectedCall.o: ../cpputest/src/CppUTestExt/MockExpectedCall.cpp +$(OBJDIR)/MockExpectedCall.o: ../submodules/cpputest/src/CppUTestExt/MockExpectedCall.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MockExpectedCallsList.o: ../cpputest/src/CppUTestExt/MockExpectedCallsList.cpp +$(OBJDIR)/MockExpectedCallsList.o: ../submodules/cpputest/src/CppUTestExt/MockExpectedCallsList.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MockFailure.o: ../cpputest/src/CppUTestExt/MockFailure.cpp +$(OBJDIR)/MockFailure.o: ../submodules/cpputest/src/CppUTestExt/MockFailure.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MockNamedValue.o: ../cpputest/src/CppUTestExt/MockNamedValue.cpp +$(OBJDIR)/MockNamedValue.o: ../submodules/cpputest/src/CppUTestExt/MockNamedValue.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MockSupport.o: ../cpputest/src/CppUTestExt/MockSupport.cpp +$(OBJDIR)/MockSupport.o: ../submodules/cpputest/src/CppUTestExt/MockSupport.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MockSupportPlugin.o: ../cpputest/src/CppUTestExt/MockSupportPlugin.cpp +$(OBJDIR)/MockSupportPlugin.o: ../submodules/cpputest/src/CppUTestExt/MockSupportPlugin.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/MockSupport_c.o: ../cpputest/src/CppUTestExt/MockSupport_c.cpp +$(OBJDIR)/MockSupport_c.o: ../submodules/cpputest/src/CppUTestExt/MockSupport_c.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/OrderedTest.o: ../cpputest/src/CppUTestExt/OrderedTest.cpp +$(OBJDIR)/OrderedTest.o: ../submodules/cpputest/src/CppUTestExt/OrderedTest.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/UtestPlatform.o: ../cpputest/src/Platforms/Gcc/UtestPlatform.cpp +$(OBJDIR)/UtestPlatform.o: ../submodules/cpputest/src/Platforms/Gcc/UtestPlatform.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" diff --git a/make/systemtests_run.make b/make/devtests.make similarity index 54% rename from make/systemtests_run.make rename to make/devtests.make index c4a43f12..0cfa52ea 100644 --- a/make/systemtests_run.make +++ b/make/devtests.make @@ -19,14 +19,14 @@ endif # ############################################# RESCOMP = windres -TARGETDIR = bin -TARGET = $(TARGETDIR)/systemtests_run -INCLUDES += -I../testing/testenv -I../cpputest/include -I../CppUTestSteps/TestSteps/include -I../specification -I../application/components +TARGETDIR = ../build/linux/bin +TARGET = $(TARGETDIR)/devtests +INCLUDES += -I../testing/testenv -I../submodules/cpputest/include -I../submodules/CppUTestSteps/TestSteps/include -I../specification -I../application/components -I../devel FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += -lcppu_test -LDDEPS += +LIBS += ../build/linux/lib/libcpputest.a +LDDEPS += ../build/linux/lib/libcpputest.a LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) define PREBUILDCMDS endef @@ -36,18 +36,18 @@ define POSTBUILDCMDS endef ifeq ($(config),ci) -OBJDIR = obj/gcc/systemtests_run/ci -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DNDEBUG +OBJDIR = ../build/linux/obj/ci/devtests +DEFINES += -DNDEBUG -DCPPUTEST_USE_LONG_LONG=0 ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) -Llib -s -pthread +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -s -pthread else ifeq ($(config),debug) -OBJDIR = obj/gcc/systemtests_run/debug -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DDEBUG +OBJDIR = ../build/linux/obj/debug/devtests +DEFINES += -DDEBUG -DCPPUTEST_USE_LONG_LONG=0 ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) -Llib -pthread +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -pthread endif @@ -61,10 +61,25 @@ endif GENERATED := OBJECTS := +GENERATED += $(OBJDIR)/BAS_Provider.o +GENERATED += $(OBJDIR)/Com.o GENERATED += $(OBJDIR)/Comparator.o +GENERATED += $(OBJDIR)/DT_01.o +GENERATED += $(OBJDIR)/DT_02.o +GENERATED += $(OBJDIR)/DT_03.o +GENERATED += $(OBJDIR)/Dispatcher.o +GENERATED += $(OBJDIR)/LCR_Provider.o +GENERATED += $(OBJDIR)/LCR_X.o +GENERATED += $(OBJDIR)/Log.o GENERATED += $(OBJDIR)/M_Instances.o -GENERATED += $(OBJDIR)/SYST_01.o +GENERATED += $(OBJDIR)/Reader.o +GENERATED += $(OBJDIR)/SIG_Provider.o +GENERATED += $(OBJDIR)/SIG_X.o +GENERATED += $(OBJDIR)/TCP.o GENERATED += $(OBJDIR)/TCP_Client.o +GENERATED += $(OBJDIR)/TCP_Com.o +GENERATED += $(OBJDIR)/TSW.o +GENERATED += $(OBJDIR)/TSW_Provider.o GENERATED += $(OBJDIR)/TestGroupBase.o GENERATED += $(OBJDIR)/TestLib.o GENERATED += $(OBJDIR)/TestMain.o @@ -73,10 +88,25 @@ GENERATED += $(OBJDIR)/TestStepsPlugin.o GENERATED += $(OBJDIR)/installComparators.o GENERATED += $(OBJDIR)/ostreamHelpers.o GENERATED += $(OBJDIR)/ostreams.o +OBJECTS += $(OBJDIR)/BAS_Provider.o +OBJECTS += $(OBJDIR)/Com.o OBJECTS += $(OBJDIR)/Comparator.o +OBJECTS += $(OBJDIR)/DT_01.o +OBJECTS += $(OBJDIR)/DT_02.o +OBJECTS += $(OBJDIR)/DT_03.o +OBJECTS += $(OBJDIR)/Dispatcher.o +OBJECTS += $(OBJDIR)/LCR_Provider.o +OBJECTS += $(OBJDIR)/LCR_X.o +OBJECTS += $(OBJDIR)/Log.o OBJECTS += $(OBJDIR)/M_Instances.o -OBJECTS += $(OBJDIR)/SYST_01.o +OBJECTS += $(OBJDIR)/Reader.o +OBJECTS += $(OBJDIR)/SIG_Provider.o +OBJECTS += $(OBJDIR)/SIG_X.o +OBJECTS += $(OBJDIR)/TCP.o OBJECTS += $(OBJDIR)/TCP_Client.o +OBJECTS += $(OBJDIR)/TCP_Com.o +OBJECTS += $(OBJDIR)/TSW.o +OBJECTS += $(OBJDIR)/TSW_Provider.o OBJECTS += $(OBJDIR)/TestGroupBase.o OBJECTS += $(OBJDIR)/TestLib.o OBJECTS += $(OBJDIR)/TestMain.o @@ -94,7 +124,7 @@ all: $(TARGET) $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) $(PRELINKCMDS) - @echo Linking systemtests_run + @echo Linking devtests $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) @@ -115,7 +145,7 @@ else endif clean: - @echo Cleaning systemtests_run + @echo Cleaning devtests ifeq (posix,$(SHELLTYPE)) $(SILENT) rm -f $(TARGET) $(SILENT) rm -rf $(GENERATED) @@ -148,10 +178,49 @@ endif # File Rules # ############################################# -$(OBJDIR)/TestSteps.o: ../CppUTestSteps/TestSteps/src/TestSteps.cpp +$(OBJDIR)/BAS_Provider.o: ../application/components/BAS/src/BAS_Provider.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestStepsPlugin.o: ../CppUTestSteps/TestSteps/src/TestStepsPlugin.cpp +$(OBJDIR)/Com.o: ../application/components/COM/src/Com.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TCP.o: ../application/components/COM/src/TCP.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TCP_Com.o: ../application/components/COM/src/TCP_Com.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/LCR_Provider.o: ../application/components/LCR/src/LCR_Provider.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/LCR_X.o: ../application/components/LCR/src/LCR_X.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/SIG_Provider.o: ../application/components/SIG/src/SIG_Provider.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/SIG_X.o: ../application/components/SIG/src/SIG_X.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Dispatcher.o: ../application/components/SYS/src/Dispatcher.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Log.o: ../application/components/SYS/src/Log.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Reader.o: ../application/components/SYS/src/Reader.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TSW.o: ../application/components/TSW/src/TSW.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TSW_Provider.o: ../application/components/TSW/src/TSW_Provider.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TestSteps.o: ../submodules/CppUTestSteps/TestSteps/src/TestSteps.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TestStepsPlugin.o: ../submodules/CppUTestSteps/TestSteps/src/TestStepsPlugin.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/TCP_Client.o: ../testing/testenv/TCP/src/TCP_Client.cpp @@ -181,7 +250,13 @@ $(OBJDIR)/TestLib.o: ../testing/testenv/testlib/src/TestLib.cpp $(OBJDIR)/TestMain.o: ../testing/testenv/testlib/src/TestMain.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SYST_01.o: ../testing/tests/systemtests/SYST_01.cpp +$(OBJDIR)/DT_01.o: ../testing/tests/devtests/DT_01.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/DT_02.o: ../testing/tests/devtests/DT_02.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/DT_03.o: ../testing/tests/devtests/DT_03.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" diff --git a/make/dstw.make b/make/dstw.make deleted file mode 100644 index c080c408..00000000 --- a/make/dstw.make +++ /dev/null @@ -1,58 +0,0 @@ -# Alternative GNU Make workspace makefile autogenerated by Premake - -ifndef config - config=ci -endif - -ifndef verbose - SILENT = @ -endif - -ifeq ($(config),ci) - dstw_gen_config = ci - dstw_run_config = ci - -else ifeq ($(config),debug) - dstw_gen_config = debug - dstw_run_config = debug - -else - $(error "invalid configuration $(config)") -endif - -PROJECTS := dstw_gen dstw_run - -.PHONY: all clean help $(PROJECTS) - -all: $(PROJECTS) - -dstw_gen: -ifneq (,$(dstw_gen_config)) - @echo "==== Building dstw_gen ($(dstw_gen_config)) ====" - @${MAKE} --no-print-directory -C . -f dstw_gen.make config=$(dstw_gen_config) -endif - -dstw_run: -ifneq (,$(dstw_run_config)) - @echo "==== Building dstw_run ($(dstw_run_config)) ====" - @${MAKE} --no-print-directory -C . -f dstw_run.make config=$(dstw_run_config) -endif - -clean: - @${MAKE} --no-print-directory -C . -f dstw_gen.make clean - @${MAKE} --no-print-directory -C . -f dstw_run.make clean - -help: - @echo "Usage: make [config=name] [target]" - @echo "" - @echo "CONFIGURATIONS:" - @echo " ci" - @echo " debug" - @echo "" - @echo "TARGETS:" - @echo " all (default)" - @echo " clean" - @echo " dstw_gen" - @echo " dstw_run" - @echo "" - @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/make/dstw_gen.make b/make/dstw_gen.make index 4cc9ca19..90b33a81 100644 --- a/make/dstw_gen.make +++ b/make/dstw_gen.make @@ -19,9 +19,9 @@ endif # ############################################# RESCOMP = windres -TARGETDIR = bin +TARGETDIR = ../build/linux/bin TARGET = $(TARGETDIR)/dstw_gen -INCLUDES += -I../testing/testenv -I../cpputest/include -I../CppUTestSteps/TestSteps/include -I../specification -I../application/components +INCLUDES += -I../testing/testenv -I../submodules/cpputest/include -I../submodules/CppUTestSteps/TestSteps/include -I../specification -I../application/components FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) @@ -36,18 +36,18 @@ define POSTBUILDCMDS endef ifeq ($(config),ci) -OBJDIR = obj/gcc/dstw_gen/ci -DEFINES += -DNDEBUG -DCPPUTEST_USE_LONG_LONG=0 +OBJDIR = ../build/linux/obj/ci/dstw_gen +DEFINES += -DNDEBUG ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) -s +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -s -pthread else ifeq ($(config),debug) -OBJDIR = obj/gcc/dstw_gen/debug -DEFINES += -DDEBUG -DNDEBUG -DCPPUTEST_USE_LONG_LONG=0 +OBJDIR = ../build/linux/obj/debug/dstw_gen +DEFINES += -DDEBUG ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -pthread endif diff --git a/make/dstw_run.make b/make/dstw_runtime.make similarity index 94% rename from make/dstw_run.make rename to make/dstw_runtime.make index 1aedb381..e723c097 100644 --- a/make/dstw_run.make +++ b/make/dstw_runtime.make @@ -19,8 +19,8 @@ endif # ############################################# RESCOMP = windres -TARGETDIR = bin -TARGET = $(TARGETDIR)/dstw_run +TARGETDIR = ../build/linux/bin +TARGET = $(TARGETDIR)/dstw_runtime INCLUDES += -I../specification -I../application/components FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) @@ -36,18 +36,18 @@ define POSTBUILDCMDS endef ifeq ($(config),ci) -OBJDIR = obj/gcc/dstw_run/ci +OBJDIR = ../build/linux/obj/ci/dstw_runtime DEFINES += -DNDEBUG ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) -s +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -s -pthread else ifeq ($(config),debug) -OBJDIR = obj/gcc/dstw_run/debug -DEFINES += -DDEBUG -DNDEBUG +OBJDIR = ../build/linux/obj/debug/dstw_runtime +DEFINES += -DDEBUG ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -pthread endif @@ -98,7 +98,7 @@ all: $(TARGET) $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) $(PRELINKCMDS) - @echo Linking dstw_run + @echo Linking dstw_runtime $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) @@ -119,7 +119,7 @@ else endif clean: - @echo Cleaning dstw_run + @echo Cleaning dstw_runtime ifeq (posix,$(SHELLTYPE)) $(SILENT) rm -f $(TARGET) $(SILENT) rm -rf $(GENERATED) diff --git a/make/systemtests_stop.make b/make/dstw_stop.make similarity index 85% rename from make/systemtests_stop.make rename to make/dstw_stop.make index 2c2dd8bf..53eca602 100644 --- a/make/systemtests_stop.make +++ b/make/dstw_stop.make @@ -19,9 +19,9 @@ endif # ############################################# RESCOMP = windres -TARGETDIR = bin -TARGET = $(TARGETDIR)/systemtests_stop -INCLUDES += -I../testing/testenv -I../cpputest/include -I../CppUTestSteps/TestSteps/include -I../specification -I../application/components +TARGETDIR = ../build/linux/bin +TARGET = $(TARGETDIR)/dstw_stop +INCLUDES += -I../testing/testenv -I../submodules/cpputest/include -I../submodules/CppUTestSteps/TestSteps/include -I../specification -I../application/components FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) @@ -36,18 +36,18 @@ define POSTBUILDCMDS endef ifeq ($(config),ci) -OBJDIR = obj/gcc/systemtests_stop/ci -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DNDEBUG +OBJDIR = ../build/linux/obj/ci/dstw_stop +DEFINES += -DNDEBUG ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) -s +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -s -pthread else ifeq ($(config),debug) -OBJDIR = obj/gcc/systemtests_stop/debug -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DDEBUG +OBJDIR = ../build/linux/obj/debug/dstw_stop +DEFINES += -DDEBUG ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -pthread endif @@ -74,7 +74,7 @@ all: $(TARGET) $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) $(PRELINKCMDS) - @echo Linking systemtests_stop + @echo Linking dstw_stop $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) @@ -95,7 +95,7 @@ else endif clean: - @echo Cleaning systemtests_stop + @echo Cleaning dstw_stop ifeq (posix,$(SHELLTYPE)) $(SILENT) rm -f $(TARGET) $(SILENT) rm -rf $(GENERATED) diff --git a/make/coverage_app.make b/make/gcov_app.make similarity index 87% rename from make/coverage_app.make rename to make/gcov_app.make index 12364567..1a6167bd 100644 --- a/make/coverage_app.make +++ b/make/gcov_app.make @@ -19,19 +19,14 @@ endif # ############################################# RESCOMP = windres -TARGETDIR = lib -TARGET = $(TARGETDIR)/libcoverage_app.a -OBJDIR = obj/gcc/coverage_app -DEFINES += -DDEBUG -DCPPUTEST_USE_LONG_LONG=0 -INCLUDES += -I../testing/testenv -I../cpputest/include -I../CppUTestSteps/TestSteps/include -I../specification -I../application/components +TARGETDIR = ../build/linux/lib +TARGET = $(TARGETDIR)/libgcov_app.a +INCLUDES += -I../testing/testenv -I../submodules/cpputest/include -I../submodules/CppUTestSteps/TestSteps/include -I../specification -I../application/components FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -fprofile-arcs -ftest-coverage -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -fprofile-arcs -ftest-coverage ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) LIBS += LDDEPS += -ALL_LDFLAGS += $(LDFLAGS) LINKCMD = $(AR) -rcs "$@" $(OBJECTS) define PREBUILDCMDS endef @@ -40,6 +35,22 @@ endef define POSTBUILDCMDS endef +ifeq ($(config),ci) +OBJDIR = ../build/linux/obj/ci/gcov_app +DEFINES += -DNDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -fprofile-arcs -ftest-coverage +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -fprofile-arcs -ftest-coverage +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -s -pthread + +else ifeq ($(config),debug) +OBJDIR = ../build/linux/obj/debug/gcov_app +DEFINES += -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -fprofile-arcs -ftest-coverage +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -fprofile-arcs -ftest-coverage +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -pthread + +endif + # Per File Configurations # ############################################# @@ -85,7 +96,7 @@ all: $(TARGET) $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) $(PRELINKCMDS) - @echo Linking coverage_app + @echo Linking gcov_app $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) @@ -106,7 +117,7 @@ else endif clean: - @echo Cleaning coverage_app + @echo Cleaning gcov_app ifeq (posix,$(SHELLTYPE)) $(SILENT) rm -f $(TARGET) $(SILENT) rm -rf $(GENERATED) diff --git a/make/coverage_tests.make b/make/gcov_tests.make similarity index 88% rename from make/coverage_tests.make rename to make/gcov_tests.make index 00de9940..518cc4dc 100644 --- a/make/coverage_tests.make +++ b/make/gcov_tests.make @@ -19,19 +19,14 @@ endif # ############################################# RESCOMP = windres -TARGETDIR = bin -TARGET = $(TARGETDIR)/coverage_tests -OBJDIR = obj/gcc/coverage_tests -DEFINES += -DDEBUG -DCPPUTEST_USE_LONG_LONG=0 -INCLUDES += -I../testing/testenv -I../cpputest/include -I../CppUTestSteps/TestSteps/include -I../specification -I../application/components +TARGETDIR = ../build/linux/bin +TARGET = $(TARGETDIR)/gcov_tests +INCLUDES += -I../testing/testenv -I../submodules/cpputest/include -I../submodules/CppUTestSteps/TestSteps/include -I../specification -I../application/components FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += lib/libcoverage_app.a -lgcov -lcppu_test -LDDEPS += lib/libcoverage_app.a -ALL_LDFLAGS += $(LDFLAGS) -Llib -pthread --coverage +LIBS += ../build/linux/lib/libgcov_app.a ../build/linux/lib/libcpputest.a -lgcov +LDDEPS += ../build/linux/lib/libgcov_app.a ../build/linux/lib/libcpputest.a LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) define PREBUILDCMDS endef @@ -40,6 +35,22 @@ endef define POSTBUILDCMDS endef +ifeq ($(config),ci) +OBJDIR = ../build/linux/obj/ci/gcov_tests +DEFINES += -DNDEBUG -DCPPUTEST_USE_LONG_LONG=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -s -pthread --coverage + +else ifeq ($(config),debug) +OBJDIR = ../build/linux/obj/debug/gcov_tests +DEFINES += -DDEBUG -DCPPUTEST_USE_LONG_LONG=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -pthread --coverage + +endif + # Per File Configurations # ############################################# @@ -109,7 +120,7 @@ all: $(TARGET) $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) $(PRELINKCMDS) - @echo Linking coverage_tests + @echo Linking gcov_tests $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) @@ -130,7 +141,7 @@ else endif clean: - @echo Cleaning coverage_tests + @echo Cleaning gcov_tests ifeq (posix,$(SHELLTYPE)) $(SILENT) rm -f $(TARGET) $(SILENT) rm -rf $(GENERATED) @@ -163,10 +174,10 @@ endif # File Rules # ############################################# -$(OBJDIR)/TestSteps.o: ../CppUTestSteps/TestSteps/src/TestSteps.cpp +$(OBJDIR)/TestSteps.o: ../submodules/CppUTestSteps/TestSteps/src/TestSteps.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestStepsPlugin.o: ../CppUTestSteps/TestSteps/src/TestStepsPlugin.cpp +$(OBJDIR)/TestStepsPlugin.o: ../submodules/CppUTestSteps/TestSteps/src/TestStepsPlugin.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/TCP_Client.o: ../testing/testenv/TCP/src/TCP_Client.cpp diff --git a/make/lib_cpputest.make b/make/lib_cpputest.make deleted file mode 100644 index e3d5a917..00000000 --- a/make/lib_cpputest.make +++ /dev/null @@ -1,48 +0,0 @@ -# Alternative GNU Make workspace makefile autogenerated by Premake - -ifndef config - config=ci -endif - -ifndef verbose - SILENT = @ -endif - -ifeq ($(config),ci) - cppu_test_config = ci - -else ifeq ($(config),debug) - cppu_test_config = debug - -else - $(error "invalid configuration $(config)") -endif - -PROJECTS := cppu_test - -.PHONY: all clean help $(PROJECTS) - -all: $(PROJECTS) - -cppu_test: -ifneq (,$(cppu_test_config)) - @echo "==== Building cppu_test ($(cppu_test_config)) ====" - @${MAKE} --no-print-directory -C . -f cppu_test.make config=$(cppu_test_config) -endif - -clean: - @${MAKE} --no-print-directory -C . -f cppu_test.make clean - -help: - @echo "Usage: make [config=name] [target]" - @echo "" - @echo "CONFIGURATIONS:" - @echo " ci" - @echo " debug" - @echo "" - @echo "TARGETS:" - @echo " all (default)" - @echo " clean" - @echo " cppu_test" - @echo "" - @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/make/tests.make b/make/moduletests.make similarity index 51% rename from make/tests.make rename to make/moduletests.make index 761d45a3..919d6095 100644 --- a/make/tests.make +++ b/make/moduletests.make @@ -19,88 +19,35 @@ endif # ############################################# RESCOMP = windres +TARGETDIR = ../build/linux/bin +TARGET = $(TARGETDIR)/moduletests +INCLUDES += -I../testing/testenv -I../submodules/cpputest/include -I../submodules/CppUTestSteps/TestSteps/include -I../specification -I../application/components FORCE_INCLUDE += ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += -lcppu_test -LDDEPS += +LIBS += ../build/linux/lib/libcpputest.a +LDDEPS += ../build/linux/lib/libcpputest.a LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -define PRELINKCMDS -endef - -ifeq ($(config),ci) -TARGETDIR = bin -TARGET = $(TARGETDIR)/tests_ci -OBJDIR = obj/gcc/tests/ci -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DNDEBUG -INCLUDES += -I../testing/testenv -I../cpputest/include -I../CppUTestSteps/TestSteps/include -I../specification -I../application/components -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) -Llib -s -pthread -define PREBUILDCMDS -endef -define POSTBUILDCMDS -endef - -else ifeq ($(config),debug) -TARGETDIR = bin -TARGET = $(TARGETDIR)/tests_debug -OBJDIR = obj/gcc/tests/debug -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DDEBUG -INCLUDES += -I../testing/testenv -I../cpputest/include -I../CppUTestSteps/TestSteps/include -I../specification -I../application/components -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) -Llib -pthread define PREBUILDCMDS endef -define POSTBUILDCMDS -endef - -else ifeq ($(config),dev) -TARGETDIR = bin -TARGET = $(TARGETDIR)/tests_dev -OBJDIR = obj/gcc/tests/dev -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DDEBUG -INCLUDES += -I../testing/testenv -I../cpputest/include -I../CppUTestSteps/TestSteps/include -I../specification -I../application/components -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) -Llib -pthread -define PREBUILDCMDS +define PRELINKCMDS endef define POSTBUILDCMDS endef -else ifeq ($(config),bullseye) -TARGETDIR = bin -TARGET = $(TARGETDIR)/tests_bullseye -OBJDIR = obj/gcc/tests/bullseye -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DNDEBUG -INCLUDES += -I../testing/testenv -I../cpputest/include -I../CppUTestSteps/TestSteps/include -I../specification -I../application/components +ifeq ($(config),ci) +OBJDIR = ../build/linux/obj/ci/moduletests +DEFINES += -DNDEBUG -DCPPUTEST_USE_LONG_LONG=0 ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) -Llib -s -pthread -define PREBUILDCMDS - @echo Running prebuild commands - cov01 -1 --no-banner -endef -define POSTBUILDCMDS - @echo Running postbuild commands - ./bullseye.sh -endef +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -s -pthread -else ifeq ($(config),tmp) -TARGETDIR = bin -TARGET = $(TARGETDIR)/tests_tmp -OBJDIR = obj/gcc/tests/tmp -DEFINES += -DCPPUTEST_USE_LONG_LONG=0 -DDEBUG -INCLUDES += -I../testing/testenv -I../cpputest/include -I../CppUTestSteps/TestSteps/include -I../specification -I../application/components -I../devel +else ifeq ($(config),debug) +OBJDIR = ../build/linux/obj/debug/moduletests +DEFINES += -DDEBUG -DCPPUTEST_USE_LONG_LONG=0 ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall -ALL_LDFLAGS += $(LDFLAGS) -Llib -pthread -define PREBUILDCMDS -endef -define POSTBUILDCMDS -endef +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -pthread endif @@ -114,21 +61,35 @@ endif GENERATED := OBJECTS := +GENERATED += $(OBJDIR)/BAS_01.o +GENERATED += $(OBJDIR)/BAS_02.o GENERATED += $(OBJDIR)/BAS_Provider.o +GENERATED += $(OBJDIR)/COM_01.o +GENERATED += $(OBJDIR)/COM_02.o +GENERATED += $(OBJDIR)/COM_03.o +GENERATED += $(OBJDIR)/COM_04.o GENERATED += $(OBJDIR)/Com.o GENERATED += $(OBJDIR)/Comparator.o GENERATED += $(OBJDIR)/Dispatcher.o +GENERATED += $(OBJDIR)/LCR_01.o +GENERATED += $(OBJDIR)/LCR_02.o GENERATED += $(OBJDIR)/LCR_Provider.o GENERATED += $(OBJDIR)/LCR_X.o GENERATED += $(OBJDIR)/Log.o GENERATED += $(OBJDIR)/M_Instances.o GENERATED += $(OBJDIR)/Reader.o +GENERATED += $(OBJDIR)/SIG_01.o +GENERATED += $(OBJDIR)/SIG_02.o GENERATED += $(OBJDIR)/SIG_Provider.o GENERATED += $(OBJDIR)/SIG_X.o +GENERATED += $(OBJDIR)/SYS_01.o +GENERATED += $(OBJDIR)/SYS_02.o GENERATED += $(OBJDIR)/TCP.o GENERATED += $(OBJDIR)/TCP_Client.o GENERATED += $(OBJDIR)/TCP_Com.o GENERATED += $(OBJDIR)/TSW.o +GENERATED += $(OBJDIR)/TSW_01.o +GENERATED += $(OBJDIR)/TSW_02.o GENERATED += $(OBJDIR)/TSW_Provider.o GENERATED += $(OBJDIR)/TestGroupBase.o GENERATED += $(OBJDIR)/TestLib.o @@ -138,21 +99,35 @@ GENERATED += $(OBJDIR)/TestStepsPlugin.o GENERATED += $(OBJDIR)/installComparators.o GENERATED += $(OBJDIR)/ostreamHelpers.o GENERATED += $(OBJDIR)/ostreams.o +OBJECTS += $(OBJDIR)/BAS_01.o +OBJECTS += $(OBJDIR)/BAS_02.o OBJECTS += $(OBJDIR)/BAS_Provider.o +OBJECTS += $(OBJDIR)/COM_01.o +OBJECTS += $(OBJDIR)/COM_02.o +OBJECTS += $(OBJDIR)/COM_03.o +OBJECTS += $(OBJDIR)/COM_04.o OBJECTS += $(OBJDIR)/Com.o OBJECTS += $(OBJDIR)/Comparator.o OBJECTS += $(OBJDIR)/Dispatcher.o +OBJECTS += $(OBJDIR)/LCR_01.o +OBJECTS += $(OBJDIR)/LCR_02.o OBJECTS += $(OBJDIR)/LCR_Provider.o OBJECTS += $(OBJDIR)/LCR_X.o OBJECTS += $(OBJDIR)/Log.o OBJECTS += $(OBJDIR)/M_Instances.o OBJECTS += $(OBJDIR)/Reader.o +OBJECTS += $(OBJDIR)/SIG_01.o +OBJECTS += $(OBJDIR)/SIG_02.o OBJECTS += $(OBJDIR)/SIG_Provider.o OBJECTS += $(OBJDIR)/SIG_X.o +OBJECTS += $(OBJDIR)/SYS_01.o +OBJECTS += $(OBJDIR)/SYS_02.o OBJECTS += $(OBJDIR)/TCP.o OBJECTS += $(OBJDIR)/TCP_Client.o OBJECTS += $(OBJDIR)/TCP_Com.o OBJECTS += $(OBJDIR)/TSW.o +OBJECTS += $(OBJDIR)/TSW_01.o +OBJECTS += $(OBJDIR)/TSW_02.o OBJECTS += $(OBJDIR)/TSW_Provider.o OBJECTS += $(OBJDIR)/TestGroupBase.o OBJECTS += $(OBJDIR)/TestLib.o @@ -163,116 +138,6 @@ OBJECTS += $(OBJDIR)/installComparators.o OBJECTS += $(OBJDIR)/ostreamHelpers.o OBJECTS += $(OBJDIR)/ostreams.o -ifeq ($(config),ci) -GENERATED += $(OBJDIR)/BAS_01.o -GENERATED += $(OBJDIR)/BAS_02.o -GENERATED += $(OBJDIR)/COM_01.o -GENERATED += $(OBJDIR)/COM_02.o -GENERATED += $(OBJDIR)/COM_03.o -GENERATED += $(OBJDIR)/COM_04.o -GENERATED += $(OBJDIR)/LCR_01.o -GENERATED += $(OBJDIR)/LCR_02.o -GENERATED += $(OBJDIR)/SIG_01.o -GENERATED += $(OBJDIR)/SIG_02.o -GENERATED += $(OBJDIR)/SYS_01.o -GENERATED += $(OBJDIR)/SYS_02.o -GENERATED += $(OBJDIR)/TSW_01.o -GENERATED += $(OBJDIR)/TSW_02.o -OBJECTS += $(OBJDIR)/BAS_01.o -OBJECTS += $(OBJDIR)/BAS_02.o -OBJECTS += $(OBJDIR)/COM_01.o -OBJECTS += $(OBJDIR)/COM_02.o -OBJECTS += $(OBJDIR)/COM_03.o -OBJECTS += $(OBJDIR)/COM_04.o -OBJECTS += $(OBJDIR)/LCR_01.o -OBJECTS += $(OBJDIR)/LCR_02.o -OBJECTS += $(OBJDIR)/SIG_01.o -OBJECTS += $(OBJDIR)/SIG_02.o -OBJECTS += $(OBJDIR)/SYS_01.o -OBJECTS += $(OBJDIR)/SYS_02.o -OBJECTS += $(OBJDIR)/TSW_01.o -OBJECTS += $(OBJDIR)/TSW_02.o - -else ifeq ($(config),debug) -GENERATED += $(OBJDIR)/BAS_01.o -GENERATED += $(OBJDIR)/BAS_02.o -GENERATED += $(OBJDIR)/COM_01.o -GENERATED += $(OBJDIR)/COM_02.o -GENERATED += $(OBJDIR)/COM_03.o -GENERATED += $(OBJDIR)/COM_04.o -GENERATED += $(OBJDIR)/LCR_01.o -GENERATED += $(OBJDIR)/LCR_02.o -GENERATED += $(OBJDIR)/SIG_01.o -GENERATED += $(OBJDIR)/SIG_02.o -GENERATED += $(OBJDIR)/SYS_01.o -GENERATED += $(OBJDIR)/SYS_02.o -GENERATED += $(OBJDIR)/TSW_01.o -GENERATED += $(OBJDIR)/TSW_02.o -OBJECTS += $(OBJDIR)/BAS_01.o -OBJECTS += $(OBJDIR)/BAS_02.o -OBJECTS += $(OBJDIR)/COM_01.o -OBJECTS += $(OBJDIR)/COM_02.o -OBJECTS += $(OBJDIR)/COM_03.o -OBJECTS += $(OBJDIR)/COM_04.o -OBJECTS += $(OBJDIR)/LCR_01.o -OBJECTS += $(OBJDIR)/LCR_02.o -OBJECTS += $(OBJDIR)/SIG_01.o -OBJECTS += $(OBJDIR)/SIG_02.o -OBJECTS += $(OBJDIR)/SYS_01.o -OBJECTS += $(OBJDIR)/SYS_02.o -OBJECTS += $(OBJDIR)/TSW_01.o -OBJECTS += $(OBJDIR)/TSW_02.o - -else ifeq ($(config),dev) -GENERATED += $(OBJDIR)/DT_01.o -GENERATED += $(OBJDIR)/DT_02.o -GENERATED += $(OBJDIR)/DT_03.o -OBJECTS += $(OBJDIR)/DT_01.o -OBJECTS += $(OBJDIR)/DT_02.o -OBJECTS += $(OBJDIR)/DT_03.o - -else ifeq ($(config),bullseye) -GENERATED += $(OBJDIR)/BAS_01.o -GENERATED += $(OBJDIR)/BAS_02.o -GENERATED += $(OBJDIR)/COM_01.o -GENERATED += $(OBJDIR)/COM_02.o -GENERATED += $(OBJDIR)/COM_03.o -GENERATED += $(OBJDIR)/COM_04.o -GENERATED += $(OBJDIR)/LCR_01.o -GENERATED += $(OBJDIR)/LCR_02.o -GENERATED += $(OBJDIR)/SIG_01.o -GENERATED += $(OBJDIR)/SIG_02.o -GENERATED += $(OBJDIR)/SYS_01.o -GENERATED += $(OBJDIR)/SYS_02.o -GENERATED += $(OBJDIR)/TSW_01.o -GENERATED += $(OBJDIR)/TSW_02.o -OBJECTS += $(OBJDIR)/BAS_01.o -OBJECTS += $(OBJDIR)/BAS_02.o -OBJECTS += $(OBJDIR)/COM_01.o -OBJECTS += $(OBJDIR)/COM_02.o -OBJECTS += $(OBJDIR)/COM_03.o -OBJECTS += $(OBJDIR)/COM_04.o -OBJECTS += $(OBJDIR)/LCR_01.o -OBJECTS += $(OBJDIR)/LCR_02.o -OBJECTS += $(OBJDIR)/SIG_01.o -OBJECTS += $(OBJDIR)/SIG_02.o -OBJECTS += $(OBJDIR)/SYS_01.o -OBJECTS += $(OBJDIR)/SYS_02.o -OBJECTS += $(OBJDIR)/TSW_01.o -OBJECTS += $(OBJDIR)/TSW_02.o - -else ifeq ($(config),tmp) -GENERATED += $(OBJDIR)/COM_01.o -GENERATED += $(OBJDIR)/COM_02.o -GENERATED += $(OBJDIR)/COM_03.o -GENERATED += $(OBJDIR)/COM_04.o -OBJECTS += $(OBJDIR)/COM_01.o -OBJECTS += $(OBJDIR)/COM_02.o -OBJECTS += $(OBJDIR)/COM_03.o -OBJECTS += $(OBJDIR)/COM_04.o - -endif - # Rules # ############################################# @@ -281,7 +146,7 @@ all: $(TARGET) $(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) $(PRELINKCMDS) - @echo Linking tests + @echo Linking moduletests $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) @@ -302,7 +167,7 @@ else endif clean: - @echo Cleaning tests + @echo Cleaning moduletests ifeq (posix,$(SHELLTYPE)) $(SILENT) rm -f $(TARGET) $(SILENT) rm -rf $(GENERATED) @@ -335,12 +200,6 @@ endif # File Rules # ############################################# -$(OBJDIR)/TestSteps.o: ../CppUTestSteps/TestSteps/src/TestSteps.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TestStepsPlugin.o: ../CppUTestSteps/TestSteps/src/TestStepsPlugin.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/BAS_Provider.o: ../application/components/BAS/src/BAS_Provider.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" @@ -380,6 +239,12 @@ $(OBJDIR)/TSW.o: ../application/components/TSW/src/TSW.cpp $(OBJDIR)/TSW_Provider.o: ../application/components/TSW/src/TSW_Provider.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TestSteps.o: ../submodules/CppUTestSteps/TestSteps/src/TestSteps.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TestStepsPlugin.o: ../submodules/CppUTestSteps/TestSteps/src/TestStepsPlugin.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/TCP_Client.o: ../testing/testenv/TCP/src/TCP_Client.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" @@ -407,8 +272,6 @@ $(OBJDIR)/TestLib.o: ../testing/testenv/testlib/src/TestLib.cpp $(OBJDIR)/TestMain.o: ../testing/testenv/testlib/src/TestMain.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - -ifeq ($(config),ci) $(OBJDIR)/BAS_01.o: ../testing/tests/moduletests/BAS/BAS_01.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" @@ -452,121 +315,6 @@ $(OBJDIR)/TSW_02.o: ../testing/tests/moduletests/TSW/TSW_02.cpp @echo "$(notdir $<)" $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -else ifeq ($(config),debug) -$(OBJDIR)/BAS_01.o: ../testing/tests/moduletests/BAS/BAS_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/BAS_02.o: ../testing/tests/moduletests/BAS/BAS_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_01.o: ../testing/tests/moduletests/COM/COM_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_02.o: ../testing/tests/moduletests/COM/COM_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_03.o: ../testing/tests/moduletests/COM/COM_03.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_04.o: ../testing/tests/moduletests/COM/COM_04.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/LCR_01.o: ../testing/tests/moduletests/LCR/LCR_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/LCR_02.o: ../testing/tests/moduletests/LCR/LCR_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SIG_01.o: ../testing/tests/moduletests/SIG/SIG_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SIG_02.o: ../testing/tests/moduletests/SIG/SIG_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SYS_01.o: ../testing/tests/moduletests/SYS/SYS_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SYS_02.o: ../testing/tests/moduletests/SYS/SYS_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TSW_01.o: ../testing/tests/moduletests/TSW/TSW_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TSW_02.o: ../testing/tests/moduletests/TSW/TSW_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - -else ifeq ($(config),dev) -$(OBJDIR)/DT_01.o: ../testing/tests/devtests/DT_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/DT_02.o: ../testing/tests/devtests/DT_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/DT_03.o: ../testing/tests/devtests/DT_03.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - -else ifeq ($(config),bullseye) -$(OBJDIR)/BAS_01.o: ../testing/tests/moduletests/BAS/BAS_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/BAS_02.o: ../testing/tests/moduletests/BAS/BAS_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_01.o: ../testing/tests/moduletests/COM/COM_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_02.o: ../testing/tests/moduletests/COM/COM_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_03.o: ../testing/tests/moduletests/COM/COM_03.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_04.o: ../testing/tests/moduletests/COM/COM_04.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/LCR_01.o: ../testing/tests/moduletests/LCR/LCR_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/LCR_02.o: ../testing/tests/moduletests/LCR/LCR_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SIG_01.o: ../testing/tests/moduletests/SIG/SIG_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SIG_02.o: ../testing/tests/moduletests/SIG/SIG_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SYS_01.o: ../testing/tests/moduletests/SYS/SYS_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/SYS_02.o: ../testing/tests/moduletests/SYS/SYS_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TSW_01.o: ../testing/tests/moduletests/TSW/TSW_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/TSW_02.o: ../testing/tests/moduletests/TSW/TSW_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - -else ifeq ($(config),tmp) -$(OBJDIR)/COM_01.o: ../testing/tests/moduletests/COM/COM_01.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_02.o: ../testing/tests/moduletests/COM/COM_02.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_03.o: ../testing/tests/moduletests/COM/COM_03.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/COM_04.o: ../testing/tests/moduletests/COM/COM_04.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - -endif - -include $(OBJECTS:%.o=%.d) ifneq (,$(PCH)) -include $(PCH_PLACEHOLDER).d diff --git a/make/premake5.lua b/make/premake5.lua index f4f0b8d6..e8c0621b 100644 --- a/make/premake5.lua +++ b/make/premake5.lua @@ -1,193 +1,164 @@ -- ============================================================ --- premake5 build rules for gcc (gmake2): +-- premake5 build settings -- ============================================================ -include 'premake5_settings.lua' buildoptions_gcc = '-std=c++17 -pedantic-errors -Werror -Wall' --- ============================================================ --- > lib_cpputest.make --- cpputest lib --- configurations: --- - ci --- - debug debug mode --- ============================================================ -workspace 'lib_cpputest' - filter { 'action:gmake*' } - configurations { 'ci', 'debug' } - language 'C++' - objdir 'obj/gcc/%{prj.name}/%{cfg.name}' - defines { defines_test } +buildoptions_vs = '/std:c++17 /MP' +buildoptions_vs_app = buildoptions_vs .. ' /W4 /wd4100 /wd4103' +buildoptions_vs_test = buildoptions_vs_app .. ' /wd4127 /D_WINSOCK_DEPRECATED_NO_WARNINGS' +buildoptions_vs_cpputest = buildoptions_vs_app .. ' /DCPPUTEST_MEM_LEAK_DETECTION_DISABLED /wd4611 /wd4996' - filter { 'configurations:ci' } - defines { 'NDEBUG' } +base_cpputest = '../submodules/cpputest' +includedirs_cpputest = { base_cpputest .. '/include' } - filter { 'configurations:debug' } - defines { 'DEBUG' } - symbols 'On' +base_teststeps = '../submodules/CppUTestSteps/TestSteps' - project 'cppu_test' - kind 'StaticLib' - targetdir 'lib' - files { files_cpputest_gcc } - includedirs { includedirs_cpputest } - buildoptions { buildoptions_gcc .. ' -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED' } +includedirs_app = { + '../specification', + '../application/components' +} +files_app = { '../application/components/**.cpp'} --- ============================================================ --- > tests.make --- app and tests at once runtime --- -> bin/tests_{config} --- configurations: --- - ci module tests --- - debug module tests debug mode --- - dev developer tests debug mode --- - bullseye module tests with bullseye coverage --- - tmp temporary tests --- ============================================================ -workspace 'tests' - filter { 'action:gmake*' } - configurations { 'ci', 'debug', 'dev', 'bullseye', 'tmp' } - language 'C++' - objdir 'obj/gcc/%{prj.name}/%{cfg.name}' - targetsuffix '_%{cfg.name}' - buildoptions { buildoptions_gcc } - linkoptions { linkoptions_test_gcc } +includedirs_testenv = { '../testing/testenv' } +files_testenv = { + '../testing/testenv/**.cpp', + base_teststeps .. '/src/*.cpp' +} - project 'tests' - kind 'ConsoleApp' - defines { defines_test } +includedirs_test = { + includedirs_testenv, + includedirs_cpputest, + base_teststeps .. '/include', + includedirs_app +} +defines_test = { 'CPPUTEST_USE_LONG_LONG=0' } + +files_moduletest = { '../testing/tests/moduletests/**.cpp' } - targetdir 'bin' - libdirs { 'lib' } - includedirs { includedirs_test } - links { links_test_gcc } - files { files_testenv, files_app } - - filter { 'configurations:ci' } - defines { 'NDEBUG' } - files { files_moduletest } - - filter { 'configurations:debug' } - defines { 'DEBUG' } - symbols 'On' - files { files_moduletest } - - filter { 'configurations:dev' } - defines { 'DEBUG' } - symbols 'On' - files { files_devtest } - - filter { 'configurations:bullseye' } - defines { 'NDEBUG' } - files { files_moduletest } - prebuildcommands { 'cov01 -1 --no-banner' } - postbuildcommands { './bullseye.sh' } - - filter { 'configurations:tmp' } - defines { 'DEBUG' } - symbols 'On' - includedirs { includedirs_qnd } - files { - '../testing/tests/moduletests/COM/*.cpp' - } - -- ============================================================ --- > coverage.make --- - coverage instrumented application (static lib) --- - module tests only runtime --- -> bin/coverage_tests_{config} +-- premake5 build rules -- ============================================================ -workspace 'coverage' - filter { 'action:gmake*' } - configurations { 'ci' } - language 'C++' - objdir 'obj/gcc/%{prj.name}' - includedirs { includedirs_test } +workspace 'DSTW' + configurations { 'ci', 'debug' } + language 'C++' + targetdir '../build/%{_TARGET_OS}/bin' + objdir '../build/%{_TARGET_OS}/obj' + kind 'ConsoleApp' + libdirs { '../build/%{_TARGET_OS}/lib' } + + filter { 'action:vs*' } + buildoptions { buildoptions_vs_test } + links { 'ws2_32' } + warnings 'high' + + filter { 'action:gmake*' } buildoptions { buildoptions_gcc } + linkoptions { '-pthread' } - defines { 'DEBUG', defines_test } - symbols 'On' + filter { 'configurations:ci' } + defines { 'NDEBUG' } - project 'coverage_app' - kind 'StaticLib' - targetdir 'lib' - files { files_app } - buildoptions {'-fprofile-arcs -ftest-coverage' } + filter { 'configurations:debug' } + defines { 'DEBUG' } + symbols 'On' - project 'coverage_tests' - kind 'ConsoleApp' - targetdir 'bin' - libdirs { 'lib' } - links { 'coverage_app', 'gcov', links_test_gcc } - linkoptions { linkoptions_test_gcc, '--coverage' } - files { files_testenv, files_moduletest } + -- ============================================================ + -- cpputest + -- ============================================================ + project 'cpputest' + kind 'StaticLib' + targetdir '../build/%{_TARGET_OS}/lib' + defines { 'NDEBUG' } + + defines { defines_test, 'CPPUTEST_MEM_LEAK_DETECTION_DISABLED' } + includedirs { includedirs_cpputest } + files { + base_cpputest .. '/src/CppUTest/*.cpp', + base_cpputest .. '/src/CppUTestExt/*.cpp' + } + + filter { 'action:vs*' } + buildoptions { buildoptions_vs_cpputest } + files { base_cpputest .. '/src/Platforms/VisualCpp/*.cpp' } + + filter { 'action:gmake*' } + files { base_cpputest .. '/src/Platforms/Gcc/*.cpp' } + + -- ============================================================ + -- module tests / dev tests + -- ============================================================ + project 'moduletests' + files { files_app, files_testenv, files_moduletest } + includedirs { includedirs_test } + defines { defines_test } + links { 'cpputest' } --- ============================================================ --- > systemtests.make --- - run tests only runtime --- configurations: --- - ci module tests --- ============================================================ -workspace 'systemtests' - filter { 'action:gmake*' } - configurations { 'ci', 'debug' } - language 'C++' - objdir 'obj/gcc/%{prj.name}' - buildoptions { buildoptions_gcc } + filter { 'action:vs*' } + links { 'winmm' } + project 'devtests' + files { files_app, files_testenv, '../testing/tests/devtests/*.cpp' } + includedirs { includedirs_test, '../devel' } defines { defines_test } + links { 'cpputest' } - filter { 'configurations:ci' } - defines { 'NDEBUG' } + filter { 'action:vs*' } + links { 'winmm' } - filter { 'configurations:debug' } - defines { 'DEBUG' } - symbols 'On' + -- ============================================================ + -- system tests + -- ============================================================ + -- run first + project 'dstw_gen' + includedirs { includedirs_test } + files { + '../testing/gendata/genDataMain.cpp', + '../testing/testenv/testlib/src/TestLib.cpp' + } + + -- run second in background + -- must be unstrumented for coverage + project 'dstw_runtime' + files { files_app, '../application/main/*.cpp' } + includedirs { includedirs_app } + + -- run third + project 'systemtests' + files { files_testenv, '../testing/tests/systemtests/SYST_*.cpp' } + includedirs { includedirs_test } + defines { defines_test, 'REQUIRE_PARAM' } + links { 'cpputest' } - project 'systemtests_stop' - kind 'ConsoleApp' - targetdir 'bin' - files { files_dstw_stop } - includedirs { includedirs_test } + filter { 'action:vs*' } + links { 'winmm' } - project 'systemtests_run' - kind 'ConsoleApp' - targetdir 'bin' - libdirs { 'lib' } - links { links_test_gcc } - files { files_testenv, files_systemtest } - includedirs { includedirs_test } - linkoptions { linkoptions_test_gcc } --- ============================================================ --- > dstw.make --- data generator and application runtime --- ============================================================ -workspace 'dstw' - filter { 'action:gmake*' } - configurations { 'ci', 'debug' } - language 'C++' - objdir 'obj/gcc/%{prj.name}' - targetdir 'bin' - buildoptions { buildoptions_gcc } - - filter { 'configurations:ci' } - defines { 'NDEBUG' } + -- run last to stop application in background + project 'dstw_stop' + files { + '../testing/tests/systemtests/stopAppMain.cpp', + '../testing/testenv/TCP/src/TCP_Client.cpp' + } + includedirs { includedirs_test } - filter { 'configurations:debug' } - defines { 'DEBUG' } - symbols 'On' + project 'gcov_app' + filter { 'action:vs*' } - project 'dstw_gen' - kind 'ConsoleApp' + filter { 'action:gmake*' } + kind 'StaticLib' + targetdir '../build/%{_TARGET_OS}/lib' includedirs { includedirs_test } - defines { 'NDEBUG', defines_test } - files { files_gendata } + files { files_app } + buildoptions {'-fprofile-arcs -ftest-coverage' } - project 'dstw_run' - kind 'ConsoleApp' - includedirs { includedirs_app } - defines { defines_app } - files { files_app, files_app_main } + project 'gcov_tests' + filter { 'action:vs*' } + filter { 'action:gmake*' } + files { files_testenv, files_moduletest } + includedirs { includedirs_test } + defines { defines_test } + links { 'gcov_app', 'gcov', 'cpputest' } + linkoptions { '--coverage' } diff --git a/make/premake5_settings.lua b/make/premake5_settings.lua deleted file mode 100644 index a24d4103..00000000 --- a/make/premake5_settings.lua +++ /dev/null @@ -1,97 +0,0 @@ --- ============================================================ --- common premake5 build settings gcc & VS --- ============================================================ - -base_cpputest = '../cpputest' - -includedirs_cpputest = { - base_cpputest .. '/include' -} - -base_teststeps = '../CppUTestSteps/TestSteps' - -includedirs_teststeps = { - base_teststeps .. '/include' -} - -files_teststeps = { - base_teststeps .. '/src/*.cpp' -} - -includedirs_app = { - '../specification', - '../application/components' -} - -includedirs_testenv = { - '../testing/testenv' -} - -includedirs_test = { - includedirs_testenv, - includedirs_cpputest, - includedirs_teststeps, - includedirs_app -} - -includedirs_runtests = { - includedirs_app, - includedirs_testenv, - includedirs_cpputest, - includedirs_teststeps -} - -includedirs_qnd = { - '../devel' -} - -files_app = { - '../application/components/**.cpp' -} - -files_app_main = { - '../application/main/*.cpp' -} - -files_testenv = { - '../testing/testenv/**.cpp', - files_teststeps -} - -defines_test = { - 'CPPUTEST_USE_LONG_LONG=0' -} - -defines_app = { 'NDEBUG' } - -files_moduletest = { '../testing/tests/moduletests/**.cpp' } -files_systemtest = { '../testing/tests/systemtests/SYST_*.cpp' } -files_devtest = { '../testing/tests/devtests/*.cpp' } -files_dstw_stop = { - '../testing/tests/systemtests/stopAppMain.cpp', - '../testing/testenv/TCP/src/TCP_Client.cpp' -} - -files_gendata = { - '../testing/gendata/genDataMain.cpp', - '../testing/testenv/testlib/src/TestLib.cpp' -} - -links_test_gcc = { 'cppu_test' } - -files_cpputest = { - base_cpputest .. '/src/CppUTest/*.cpp', - base_cpputest .. '/src/CppUTestExt/*.cpp' -} - -files_cpputest_vs = { - files_cpputest, - base_cpputest .. '/src/Platforms/VisualCpp/*.cpp' -} - -files_cpputest_gcc = { - files_cpputest, - base_cpputest .. '/src/Platforms/Gcc/*.cpp' -} - -linkoptions_test_gcc = { '-pthread' } \ No newline at end of file diff --git a/make/premake5_vs.lua b/make/premake5_vs.lua deleted file mode 100644 index c471f95a..00000000 --- a/make/premake5_vs.lua +++ /dev/null @@ -1,116 +0,0 @@ --- ============================================================ --- premake5 build rules for VS --- ============================================================ - -include 'premake5_settings.lua' - --- ============================================================ --- general setup --- warning level: 4 (high) --- multi processor build --- --- suppressed warnings application: --- - 4100 unreferenced formal parameter --- - 4103 change of alignement with header inclusion --- this is intended behaviour of packBegin.h / packEnd.h --- additional suppressed warnings test code: --- - 4127 suggested 'if constexpr' --- warning caused by CppUTest headers code --- ============================================================ -buildoptions_vs = '/std:c++17 /MP' -buildoptions_vs_app = buildoptions_vs .. ' /W4 /wd4100 /wd4103' -buildoptions_vs_test = buildoptions_vs_app .. ' /wd4127 /D_WINSOCK_DEPRECATED_NO_WARNINGS' -buildoptions_vs_cpputest = buildoptions_vs_app .. ' -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED' --- ============================================================ --- > dstw.sln --- configurations: --- - ci no debug --- - debug debug mode --- - dev debug mode --- ============================================================ -workspace 'dstw' - filter { 'action:vs*' } - configurations { 'ci', 'debug', 'dev' } - language 'C++' - objdir 'obj/%{prj.name}/%{cfg.name}' - kind 'ConsoleApp' - targetdir 'exe' - libdirs { 'lib' } - warnings 'high' - - filter { 'configurations:ci' } - defines { 'NDEBUG' } - - filter { 'configurations:debug' } - defines { 'DEBUG' } - symbols 'On' - - filter { 'configurations:dev' } - defines { 'DEBUG' } - symbols 'On' - - -- ============================================================ - -- common - -- ============================================================ - project 'cpputest' - kind 'StaticLib' - targetdir 'lib' - buildoptions { buildoptions_vs_cpputest } - includedirs { includedirs_cpputest } - files { files_cpputest_vs } - - -- ============================================================ - -- module tests - -- configurations: - -- - ci module tests - -- - debug module tests debug mode - -- - dev developer tests debug mode - -- ============================================================ - -- must be unstrumented for coverage - project 'moduletests' - buildoptions { buildoptions_vs_test } - includedirs { includedirs_test } - links { 'winmm', 'ws2_32', 'cpputest' } - - files { files_app, files_testenv } - - filter { 'configurations:ci' } - files { files_moduletest } - - filter { 'configurations:debug' } - files { files_moduletest } - - filter { 'configurations:dev' } - files { files_devtest } - - -- ============================================================ - -- system tests - -- ============================================================ - -- run first - project 'dstw_gen' - buildoptions { buildoptions_vs_app } - includedirs { includedirs_test } - files { files_gendata } - - -- run second in background - -- must be unstrumented for coverage - project 'dstw_run' - buildoptions { buildoptions_vs_app } - includedirs { includedirs_app } - files { files_app, files_app_main } - links { 'ws2_32' } - - -- run third - project 'systemtests_run' - buildoptions { buildoptions_vs_test } - includedirs { includedirs_test } - files { files_systemtest, files_testenv } - links { 'winmm', 'ws2_32', 'cpputest' } - - -- run last to stop application in background - project 'dstw_stop' - buildoptions { buildoptions_vs_test } - includedirs { includedirs_test } - files { files_dstw_stop } - links { 'ws2_32' } - diff --git a/make/runGcov.sh b/make/runGcov.sh index f2939f77..0ca4a1d1 100644 --- a/make/runGcov.sh +++ b/make/runGcov.sh @@ -3,29 +3,21 @@ # run coverage using gcov # ==================================== cd $(dirname $0) +myDir=$(pwd) +cd .. +repo=$(pwd) +appDir=../application/components +buildDir=$repo/build +objDir=linux/obj/debug/gcov_app +bindir=$buildDir/linux/bin -help() -{ - echo "Usage: $(basename $0) [options]" - echo "run coverage using gcov" - echo "options:" - echo "-s show uncovered file content" - echo "-h this help" - exit -} - - -show=0 -while getopts hs option; do - case $option in - (h) help;; - (s) show=1;; - esac -done -shift $(($OPTIND - 1)) - +cd $myDir +make -j config=debug gcov_app gcov_tests -gcov -o obj/gcc/coverage_app ../application/components/*/src/*.cpp > /dev/null 2> /dev/null +cd $buildDir +rm -f *.gcov +$bindir/gcov_tests > /dev/null +gcov -o $objDir $appDir/*/src/*.cpp > /dev/null 2> /dev/null out () { printf "%-25s: %4d\n" $1 $2 @@ -33,24 +25,17 @@ out () { out files $(ls *.cpp.gcov | wc -l) tot=0 -failed=() for cf in *.cpp.gcov; do nuc=$(cat $cf | grep '#####:' | wc -l) if test $nuc -ne 0; then if test $tot -eq 0; then echo; echo uncovered LOC:; fi tot=$((tot+nuc)) out ${cf%.*} $nuc - failed+=($cf) - ret=1 fi done if test $tot -ne 0; then out TOTAL $tot - if test $show -eq 1; then - for cf in ${failed[*]}; do - cat $cf - done - fi else echo OK fi -exit $tot \ No newline at end of file +rm *.gcov +exit $tot diff --git a/make/runSub.cmd b/make/runSub.cmd new file mode 100644 index 00000000..f071a7fd --- /dev/null +++ b/make/runSub.cmd @@ -0,0 +1,7 @@ +@echo off +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 8d3935b7..7b3351ad 100644 --- a/make/runSystemTests.cmd +++ b/make/runSystemTests.cmd @@ -3,34 +3,36 @@ rem ==================================== rem run system tests in windows rem ==================================== rem created by ChatGPT +SETLOCAL +cd /d %~dp0 +set myDir=%cd% +cd .. +set buildDir=%cd%\build +set bindir=windows\bin +cd %myDir% +msbuild DSTW.sln -t:dstw_gen,dstw_runtime,systemtests,dstw_stop +if %errorlevel% neq 0 exit /b %errorlevel% -cd /d "%~dp0" -set ret=0 -set bins=dstw_gen.exe dstw_run.exe systemtests_run.exe systemtests_stop.exe -for %%I in (%bins%) do ( - if not exist exe\%%I ( - echo not found: exe\%%I - set /a ret+=1 - ) -) +set tmpfile=tmp_%random%.txt -if %ret% neq 0 exit /b %ret% +cd %buildDir% -exe\systemtests_stop.exe +%binDir%\dstw_stop.exe timeout /t 1 /nobreak >nul rem gen required proj data file -exe\dstw_gen.exe +%binDir%\dstw_gen.exe rem start app in background -start /B exe\dstw_run.exe 1 +echo run > %tmpfile% +start /B %myDir%\runSub.cmd %tmpfile% %binDir%\dstw_runtime.exe 1 rem run tests after a second timeout /t 1 /nobreak >nul -exe\systemtests_run.exe -b -v +%binDir%\systemtests.exe -b -v set ret=%errorlevel% rem stop app anyway -exe\systemtests_stop.exe +%binDir%\dstw_stop.exe +:wait timeout /t 1 /nobreak >nul +if exist %tmpfile% goto wait -pause exit /b %ret% - diff --git a/make/runSystemTests.sh b/make/runSystemTests.sh index 84b49547..969cef4c 100644 --- a/make/runSystemTests.sh +++ b/make/runSystemTests.sh @@ -5,31 +5,31 @@ # created by Manfred Sorgo cd $(dirname $0) -ret=0 -bins="dstw_gen dstw_run systemtests_run systemtests_stop" -for bin in $bins; do - if test ! -f bin/$bin; then - echo "bin/$bin not found" - ret+=(1) - fi -done +myDir=$(pwd) +cd .. +buildDir=$(pwd)/build +bindir=linux/bin + +cd $myDir +make -j dstw_gen dstw_runtime dstw_stop systemtests -if test $ret -ne 0; then exit $ret; fi +cd $buildDir +ret=0 -bin/systemtests_stop +$bindir/dstw_stop sleep 1 # gen required proj data file -bin/dstw_gen +$bindir/dstw_gen # start app in background -bin/dstw_run 1 & pid=$! -sleep 1 +$bindir/dstw_runtime X & pid=$! +sleep 2 # run tests -bin/systemtests_run -b -v +$bindir/systemtests -b -v ret=$((ret+$?)) # stop app -bin/systemtests_stop +$bindir/dstw_stop if ! wait $pid; then ret=$((ret+1)) diff --git a/make/systemtests.make b/make/systemtests.make index 90b547f8..de2c10e4 100644 --- a/make/systemtests.make +++ b/make/systemtests.make @@ -1,4 +1,4 @@ -# Alternative GNU Make workspace makefile autogenerated by Premake +# Alternative GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -8,51 +8,184 @@ ifndef verbose SILENT = @ endif +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq ($(shell echo "test"), "test") + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +TARGETDIR = ../build/linux/bin +TARGET = $(TARGETDIR)/systemtests +INCLUDES += -I../testing/testenv -I../submodules/cpputest/include -I../submodules/CppUTestSteps/TestSteps/include -I../specification -I../application/components +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += ../build/linux/lib/libcpputest.a +LDDEPS += ../build/linux/lib/libcpputest.a +LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + ifeq ($(config),ci) - systemtests_stop_config = ci - systemtests_run_config = ci +OBJDIR = ../build/linux/obj/ci/systemtests +DEFINES += -DNDEBUG -DCPPUTEST_USE_LONG_LONG=0 -DREQUIRE_PARAM +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++17 -pedantic-errors -Werror -Wall +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -s -pthread else ifeq ($(config),debug) - systemtests_stop_config = debug - systemtests_run_config = debug +OBJDIR = ../build/linux/obj/debug/systemtests +DEFINES += -DDEBUG -DCPPUTEST_USE_LONG_LONG=0 -DREQUIRE_PARAM +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++17 -pedantic-errors -Werror -Wall +ALL_LDFLAGS += $(LDFLAGS) -L../build/linux/lib -pthread -else - $(error "invalid configuration $(config)") endif -PROJECTS := systemtests_stop systemtests_run +# Per File Configurations +# ############################################# + -.PHONY: all clean help $(PROJECTS) +# File sets +# ############################################# -all: $(PROJECTS) +GENERATED := +OBJECTS := -systemtests_stop: -ifneq (,$(systemtests_stop_config)) - @echo "==== Building systemtests_stop ($(systemtests_stop_config)) ====" - @${MAKE} --no-print-directory -C . -f systemtests_stop.make config=$(systemtests_stop_config) +GENERATED += $(OBJDIR)/Comparator.o +GENERATED += $(OBJDIR)/M_Instances.o +GENERATED += $(OBJDIR)/SYST_01.o +GENERATED += $(OBJDIR)/TCP_Client.o +GENERATED += $(OBJDIR)/TestGroupBase.o +GENERATED += $(OBJDIR)/TestLib.o +GENERATED += $(OBJDIR)/TestMain.o +GENERATED += $(OBJDIR)/TestSteps.o +GENERATED += $(OBJDIR)/TestStepsPlugin.o +GENERATED += $(OBJDIR)/installComparators.o +GENERATED += $(OBJDIR)/ostreamHelpers.o +GENERATED += $(OBJDIR)/ostreams.o +OBJECTS += $(OBJDIR)/Comparator.o +OBJECTS += $(OBJDIR)/M_Instances.o +OBJECTS += $(OBJDIR)/SYST_01.o +OBJECTS += $(OBJDIR)/TCP_Client.o +OBJECTS += $(OBJDIR)/TestGroupBase.o +OBJECTS += $(OBJDIR)/TestLib.o +OBJECTS += $(OBJDIR)/TestMain.o +OBJECTS += $(OBJDIR)/TestSteps.o +OBJECTS += $(OBJDIR)/TestStepsPlugin.o +OBJECTS += $(OBJDIR)/installComparators.o +OBJECTS += $(OBJDIR)/ostreamHelpers.o +OBJECTS += $(OBJDIR)/ostreams.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking systemtests + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif -systemtests_run: -ifneq (,$(systemtests_run_config)) - @echo "==== Building systemtests_run ($(systemtests_run_config)) ====" - @${MAKE} --no-print-directory -C . -f systemtests_run.make config=$(systemtests_run_config) +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: - @${MAKE} --no-print-directory -C . -f systemtests_stop.make clean - @${MAKE} --no-print-directory -C . -f systemtests_run.make clean - -help: - @echo "Usage: make [config=name] [target]" - @echo "" - @echo "CONFIGURATIONS:" - @echo " ci" - @echo " debug" - @echo "" - @echo "TARGETS:" - @echo " all (default)" - @echo " clean" - @echo " systemtests_stop" - @echo " systemtests_run" - @echo "" - @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file + @echo Cleaning systemtests +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)/TestSteps.o: ../submodules/CppUTestSteps/TestSteps/src/TestSteps.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TestStepsPlugin.o: ../submodules/CppUTestSteps/TestSteps/src/TestStepsPlugin.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TCP_Client.o: ../testing/testenv/TCP/src/TCP_Client.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Comparator.o: ../testing/testenv/comparators/src/Comparator.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/installComparators.o: ../testing/testenv/comparators/src/installComparators.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/ostreamHelpers.o: ../testing/testenv/comparators/src/ostreamHelpers.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/ostreams.o: ../testing/testenv/comparators/src/ostreams.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/M_Instances.o: ../testing/testenv/mocks/src/M_Instances.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TestGroupBase.o: ../testing/testenv/testlib/src/TestGroupBase.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TestLib.o: ../testing/testenv/testlib/src/TestLib.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/TestMain.o: ../testing/testenv/testlib/src/TestMain.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/SYST_01.o: ../testing/tests/systemtests/SYST_01.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/scripts/sompy.py b/scripts/sompy.py index af5c32df..c418a39d 100644 --- a/scripts/sompy.py +++ b/scripts/sompy.py @@ -1,5 +1,5 @@ from sys import path as syspath from os.path import dirname, abspath, join -sompath = abspath(join(dirname(__file__), '../sompy/somutil')) +sompath = abspath(join(dirname(__file__), '../submodules/sompy/somutil')) if sompath not in syspath: syspath.insert(0, sompath) diff --git a/sompy b/sompy deleted file mode 160000 index 9dc194c5..00000000 --- a/sompy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9dc194c50052c6b3ee48c43387036b4fbb44b86a diff --git a/specification/ifs/DataTypes.h b/specification/ifs/DataTypes.h index 030dc1b7..fcf7dfa8 100644 --- a/specification/ifs/DataTypes.h +++ b/specification/ifs/DataTypes.h @@ -18,46 +18,54 @@ // Com telegrams element identifier constexpr auto ComNameSize = 12; -struct ComName +struct ComAddr { CHAR chars[ComNameSize]; - inline ComName() = default; - inline ComName(const ComName& src) + inline ComAddr() = default; + inline ComAddr(const ComAddr& src) { Mem::cpy(chars, src.chars); } - inline bool operator>(const ComName& b) const + inline bool operator>(const ComAddr& b) const { return Mem::cmp(chars, b.chars) > 0; } }; -static_assert(ComNameSize == sizeof(ComName)); +static_assert(ComNameSize == sizeof(ComAddr)); // standard telegram size constexpr auto ComTelegramSize = ComNameSize + 8; +constexpr auto ComDataSize = 8; + // Com telegrams data struct ComData { UINT8 param1 = PARAM_UNDEF; UINT8 param2 = PARAM_UNDEF; - UINT8 reserve[6]; + UINT8 param3 = PARAM_UNDEF; + UINT8 param4 = PARAM_UNDEF; + UINT8 param5 = PARAM_UNDEF; + UINT8 param6 = PARAM_UNDEF; + UINT8 param7 = PARAM_UNDEF; + UINT8 param8 = PARAM_UNDEF; }; +static_assert(ComDataSize == sizeof(ComData)); // Com telegram struct ComTele { - ComName name; + ComAddr addr; ComData data; }; -static_assert(ComTelegramSize == sizeof(ComTele)); +static_assert(ComNameSize + ComDataSize == sizeof(ComTele)); // project items struct ProjItem { - ComName name; + ComAddr addr; UINT8 type; UINT8 reserve[7]; }; diff --git a/specification/ifs/I_Dispatcher.h b/specification/ifs/I_Dispatcher.h index 979a27af..9ee26905 100644 --- a/specification/ifs/I_Dispatcher.h +++ b/specification/ifs/I_Dispatcher.h @@ -24,7 +24,7 @@ class I_Dispatcher // - own processing element position // and shall receive: // - dispatcher id (position of responsible dispatcher element) - virtual const PosRes assign(const ComName& name, E_Comp comp, size_t pos) = 0; + virtual const PosRes assign(const ComAddr& name, E_Comp comp, size_t pos) = 0; // field state telegrams shall be dispatched to components virtual void fromFld(const ComTele& tele) const = 0; diff --git a/specification/ifs/I_TCP.h b/specification/ifs/I_TCP.h index a67e03b4..2d3dcd8e 100644 --- a/specification/ifs/I_TCP.h +++ b/specification/ifs/I_TCP.h @@ -9,6 +9,13 @@ #include "DataTypes.h" +enum E_Select : INT8 +{ + SELECT_ERR = -1, + SELECT_NONE = 0, + SELECT_READY = 1 +}; + class I_TCP { public: @@ -31,10 +38,7 @@ class I_TCP virtual bool listen(INT32 socket) const = 0; // read select a socket - // -1 on error - // 0 if no socket is ready - // 1 if socket is ready - virtual INT32 select(INT32 socket) const = 0; + virtual E_Select select(INT32 socket) const = 0; // accept a connection virtual INT32 accept(INT32 socket) const = 0; diff --git a/CppUTestSteps b/submodules/CppUTestSteps similarity index 100% rename from CppUTestSteps rename to submodules/CppUTestSteps diff --git a/cpputest b/submodules/cpputest similarity index 100% rename from cpputest rename to submodules/cpputest diff --git a/submodules/sombin b/submodules/sombin new file mode 160000 index 00000000..784ae01b --- /dev/null +++ b/submodules/sombin @@ -0,0 +1 @@ +Subproject commit 784ae01b02461e246b7e2fc3969bf3a9173aa4c4 diff --git a/submodules/sompy b/submodules/sompy new file mode 160000 index 00000000..15bb4709 --- /dev/null +++ b/submodules/sompy @@ -0,0 +1 @@ +Subproject commit 15bb470954eca7bd0442574c6c835034e60e3481 diff --git a/testing/README.md b/testing/README.md index 93d0da76..969b11b8 100644 --- a/testing/README.md +++ b/testing/README.md @@ -33,7 +33,7 @@ If testing a single application module (SUT, software under test) ### sample: test of dispatcher #### mocks and calls scheme -![test Dispatcher](../specification/doc/test_dispatcher.svg) +![test Dispatcher](../specification/doc/test_dispatcher.svg) #### sample test code with comments @@ -47,7 +47,7 @@ with comments STEP(1) // prepare expected telegram for TSW - nameElement(teleExp, 1, "TSW"); + adrrElement(teleExp, 1, "TSW"); // describe expectation for mock: // Com method toFld must be called with telegram m_Com().expectToFld(teleExp); @@ -59,15 +59,15 @@ with comments ``` ## system tests -Here we have +Here we have - a DSTW application built without any test code -- a test application +- a test application The system tests take place that way: - At startup the DSTW application reads project data provided for testing -- The test application then communicates via TCP +- The test application then communicates via TCP -![system tests](../specification/doc/sys_tests.svg) +![system tests](../specification/doc/sys_tests.svg) ## code coverage - [coverage tools](coverage_tools.md) diff --git a/testing/coverage_bullseye.md b/testing/coverage_bullseye.md index d5a413c6..21c120e2 100644 --- a/testing/coverage_bullseye.md +++ b/testing/coverage_bullseye.md @@ -1,53 +1,54 @@ # current bullseye coverage +14.11.2024 -### modTests 16.10.2024 19:38:34,49 +### modTests ``` Directory Function Coverage C/D Coverage ------------------------------- ----------------- ---------------- -application/components/ 128 / 128 = 100% 315 / 316 = 99% -application/components/BAS/ 25 / 25 = 100% 39 / 39 = 100% +application/components/ 144 / 144 = 100% 315 / 316 = 99% +application/components/BAS/ 27 / 27 = 100% 39 / 39 = 100% application/components/BAS/src/ 1 / 1 = 100% 14 / 14 = 100% -application/components/COM/ 32 / 32 = 100% 79 / 80 = 98% -application/components/COM/src/ 31 / 31 = 100% 79 / 80 = 98% -application/components/LCR/ 15 / 15 = 100% 40 / 40 = 100% -application/components/LCR/src/ 11 / 11 = 100% 40 / 40 = 100% -application/components/SIG/ 30 / 30 = 100% 95 / 95 = 100% -application/components/SIG/src/ 24 / 24 = 100% 95 / 95 = 100% -application/components/SYS/ 15 / 15 = 100% 40 / 40 = 100% -application/components/SYS/src/ 13 / 13 = 100% 40 / 40 = 100% -application/components/TSW/ 11 / 11 = 100% 22 / 22 = 100% -application/components/TSW/src/ 8 / 8 = 100% 22 / 22 = 100% +application/components/COM/ 40 / 40 = 100% 79 / 80 = 98% +application/components/COM/src/ 39 / 39 = 100% 79 / 80 = 98% +application/components/LCR/ 16 / 16 = 100% 40 / 40 = 100% +application/components/LCR/src/ 12 / 12 = 100% 40 / 40 = 100% +application/components/SIG/ 31 / 31 = 100% 95 / 95 = 100% +application/components/SIG/src/ 25 / 25 = 100% 95 / 95 = 100% +application/components/SYS/ 18 / 18 = 100% 40 / 40 = 100% +application/components/SYS/src/ 16 / 16 = 100% 40 / 40 = 100% +application/components/TSW/ 12 / 12 = 100% 22 / 22 = 100% +application/components/TSW/src/ 9 / 9 = 100% 22 / 22 = 100% specification/ 5 / 5 = 100% 0 / 0 specification/codebase/ 2 / 2 = 100% 0 / 0 specification/ifs/ 3 / 3 = 100% 0 / 0 ------------------------------- ----------------- ---------------- -Total 133 / 133 = 100% 315 / 316 = 99% +Total 149 / 149 = 100% 315 / 316 = 99% covmin 100,99 passed ``` -### sysTests 16.10.2024 19:39:10,30 +### sysTests ``` Directory Function Coverage C/D Coverage ------------------------------- ----------------- ---------------- -application/ 100 / 143 = 69% 107 / 322 = 33% -application/components/ 99 / 142 = 69% 104 / 316 = 32% -application/components/BAS/ 21 / 25 = 84% 30 / 39 = 76% +application/ 114 / 159 = 71% 107 / 322 = 33% +application/components/ 113 / 158 = 71% 104 / 316 = 32% +application/components/BAS/ 21 / 27 = 77% 30 / 39 = 76% application/components/BAS/src/ 1 / 1 = 100% 9 / 14 = 64% -application/components/COM/ 31 / 32 = 96% 49 / 80 = 61% -application/components/COM/src/ 30 / 31 = 96% 49 / 80 = 61% -application/components/LCR/ 5 / 15 = 33% 1 / 40 = 2% -application/components/LCR/src/ 2 / 11 = 18% 1 / 40 = 2% -application/components/SIG/ 5 / 30 = 16% 1 / 95 = 1% -application/components/SIG/src/ 2 / 24 = 8% 1 / 95 = 1% -application/components/SYS/ 28 / 29 = 96% 18 / 40 = 45% -application/components/SYS/src/ 12 / 13 = 92% 18 / 40 = 45% -application/components/TSW/ 9 / 11 = 81% 5 / 22 = 22% -application/components/TSW/src/ 6 / 8 = 75% 5 / 22 = 22% +application/components/COM/ 39 / 40 = 97% 49 / 80 = 61% +application/components/COM/src/ 38 / 39 = 97% 49 / 80 = 61% +application/components/LCR/ 6 / 16 = 37% 1 / 40 = 2% +application/components/LCR/src/ 3 / 12 = 25% 1 / 40 = 2% +application/components/SIG/ 6 / 31 = 19% 1 / 95 = 1% +application/components/SIG/src/ 3 / 25 = 12% 1 / 95 = 1% +application/components/SYS/ 31 / 32 = 96% 18 / 40 = 45% +application/components/SYS/src/ 15 / 16 = 93% 18 / 40 = 45% +application/components/TSW/ 10 / 12 = 83% 5 / 22 = 22% +application/components/TSW/src/ 7 / 9 = 77% 5 / 22 = 22% application/main/ 1 / 1 = 100% 3 / 6 = 50% specification/ 5 / 5 = 100% 0 / 0 specification/codebase/ 2 / 2 = 100% 0 / 0 specification/ifs/ 3 / 3 = 100% 0 / 0 ------------------------------- ----------------- ---------------- -Total 105 / 148 = 70% 107 / 322 = 33% +Total 119 / 164 = 72% 107 / 322 = 33% covmin 50,30 passed ``` diff --git a/testing/testenv/TCP/src/TCP_Client.cpp b/testing/testenv/TCP/src/TCP_Client.cpp index 5342a3f2..906c42df 100644 --- a/testing/testenv/TCP/src/TCP_Client.cpp +++ b/testing/testenv/TCP/src/TCP_Client.cpp @@ -60,8 +60,14 @@ namespace test bool TCP_Client::recv(PTR data, INT32 size) const { fd_set readfds; +#ifdef _WIN32 +#pragma warning(disable:4389) +#endif FD_ZERO(&readfds); FD_SET(mSocket, &readfds); +#ifdef _WIN32 +#pragma warning(default:4389) +#endif timeval timeout{0, 50000}; bool ok = false; if ( diff --git a/testing/testenv/comparators/ostreamHelpers.h b/testing/testenv/comparators/ostreamHelpers.h index eb79d05d..76cd7c91 100644 --- a/testing/testenv/comparators/ostreamHelpers.h +++ b/testing/testenv/comparators/ostreamHelpers.h @@ -31,36 +31,51 @@ // begin of ostream operator declaration #define OSTREAM_DEC(NAME) OSTREAM_DEF(NAME); +// standard output begin of elements +#define OUT_BEGIN(NAME) \ + std::setw(OUT_FILL_W) << std::setfill(OUT_FILL_C) << std::left << #NAME << ':' << ' ' + // output line for standard types #define DOUT(NAME) \ - std::setw(OUT_FILL_W) << std::setfill(OUT_FILL_C) << std::left << #NAME << ':' << ' ' << d.NAME << std::endl + OUT_BEGIN(NAME) << d.NAME << std::endl // output line for fixed character types #define DFIX(NAME) \ - std::setw(OUT_FILL_W) << std::setfill(OUT_FILL_C) << std::left << #NAME << ':' << ' ' << fixC(d.NAME) << std::endl + OUT_BEGIN(NAME) << fixT(d.NAME) << std::endl + +// output line for UINT8 arrays +#define DU8X(NAME) \ + OUT_BEGIN(NAME) << fixU(d.NAME) << std::endl -// helper struct for fixed character types -struct FixChar +// helper struct for fixed array types +template +struct FixArr { - const CONST_C_STRING str; + const T *const ptr; const size_t size; - inline FixChar(const CONST_C_STRING str, const size_t size): - str(str), + inline FixArr(const T* ptr, const size_t size): + ptr(ptr), size(size) {} - NOCOPY(FixChar) - NODEF(FixChar) + NOCOPY(FixArr) + NODEF(FixArr) }; // the streamable call -template -inline const FixChar fixC(const CHAR (&str)[N]) +template +inline const FixArr fixT(const T (&ptr)[N]) { - return FixChar(str, N); + return FixArr(ptr, N); } +// template +// using fixT = fixT; + +// template +// using fixU = fixT; + // stream FixChar as rvalue -std::ostream& operator << (std::ostream& os, const FixChar&& d); +std::ostream& operator << (std::ostream& os, const FixArr&& d); // make sure UINT8 output is numerical inline std::ostream& operator << (std::ostream& os, const UINT8 u) diff --git a/testing/testenv/comparators/ostreams.h b/testing/testenv/comparators/ostreams.h index 67461abb..c92526e1 100644 --- a/testing/testenv/comparators/ostreams.h +++ b/testing/testenv/comparators/ostreams.h @@ -12,7 +12,7 @@ #include OSTREAM_DEC(ComData) -OSTREAM_DEC(ComName) +OSTREAM_DEC(ComAddr) OSTREAM_DEC(ComTele) OSTREAM_DEC(PosRes) OSTREAM_DEC(ProjItem) diff --git a/testing/testenv/comparators/src/installComparators.cpp b/testing/testenv/comparators/src/installComparators.cpp index 1a075a81..ee249481 100644 --- a/testing/testenv/comparators/src/installComparators.cpp +++ b/testing/testenv/comparators/src/installComparators.cpp @@ -12,7 +12,7 @@ namespace test { void installComparators(MockSupportPlugin& plugin) { - ADD_COMP(ComName) + ADD_COMP(ComAddr) ADD_COMP(ComData) ADD_COMP(ComTele) } diff --git a/testing/testenv/comparators/src/ostreamHelpers.cpp b/testing/testenv/comparators/src/ostreamHelpers.cpp index eb53704e..9fc7ed9f 100644 --- a/testing/testenv/comparators/src/ostreamHelpers.cpp +++ b/testing/testenv/comparators/src/ostreamHelpers.cpp @@ -2,9 +2,9 @@ #include -std::ostream& operator << (std::ostream& os, const FixChar&& d) +std::ostream& operator << (std::ostream& os, const FixArr&& d) { - const CHAR* p = &d.str[0]; + const CHAR* p = &d.ptr[0]; for (size_t n = 0; n < d.size; ++n, ++p) { os << (isprint(*p) ? *p : OUT_NOPR_C); diff --git a/testing/testenv/comparators/src/ostreams.cpp b/testing/testenv/comparators/src/ostreams.cpp index cbe830d0..494c48ab 100644 --- a/testing/testenv/comparators/src/ostreams.cpp +++ b/testing/testenv/comparators/src/ostreams.cpp @@ -6,18 +6,19 @@ OSTREAM_DEF(ComData) return os << DOUT(param1) << DOUT(param2) + << DOUT(param3) ; } -OSTREAM_DEF(ComName) +OSTREAM_DEF(ComAddr) { - return os << fixC(d.chars); + return os << fixT(d.chars); } OSTREAM_DEF(ComTele) { return os - << DOUT(name) + << DOUT(addr) << d.data ; } @@ -33,7 +34,7 @@ OSTREAM_DEF(PosRes) OSTREAM_DEF(ProjItem) { return os - << DOUT(name) + << DOUT(addr) << DOUT(type) ; } diff --git a/testing/testenv/mocks/M_Dispatcher.h b/testing/testenv/mocks/M_Dispatcher.h index e1a2bc9f..dd38bf61 100644 --- a/testing/testenv/mocks/M_Dispatcher.h +++ b/testing/testenv/mocks/M_Dispatcher.h @@ -33,14 +33,14 @@ namespace test expect("index"); } - inline const PosRes assign(const ComName& name, E_Comp comp, size_t pos) override + inline const PosRes assign(const ComAddr& name, E_Comp comp, size_t pos) override { - const INT32 i = call("assign").TPARAM(ComName, name).PARAM(comp).PARAM(pos).RETURN_DEF_INT(0); + const INT32 i = call("assign").TPARAM(ComAddr, name).PARAM(comp).PARAM(pos).RETURN_DEF_INT(0); return i < 0 ? PosRes {false} : PosRes {true, static_cast(i)}; } - inline void expectAssign(const ComName& name, E_Comp comp, size_t pos, INT32 ret = 0) const + inline void expectAssign(const ComAddr& name, E_Comp comp, size_t pos, INT32 ret = 0) const { - expect("assign").TPARAM(ComName, name).PARAM(comp).PARAM(pos).AND_RETURN(ret); + expect("assign").TPARAM(ComAddr, name).PARAM(comp).PARAM(pos).AND_RETURN(ret); } inline void fromFld(const ComTele& tele) const override diff --git a/testing/testenv/mocks/M_TCP.h b/testing/testenv/mocks/M_TCP.h index c4dafdd8..07121303 100644 --- a/testing/testenv/mocks/M_TCP.h +++ b/testing/testenv/mocks/M_TCP.h @@ -71,11 +71,11 @@ namespace test expect("listen").PARAM(socket).AND_RETURN_BOOL(ret); } - inline INT32 select(INT32 socket) const + inline E_Select select(INT32 socket) const { - return call("select").PARAM(socket).RETURN_DEF_INT(0); + return static_cast(call("select").PARAM(socket).RETURN_DEF_INT(0)); } - inline void expectSelect(INT32 socket, INT32 ret = 0) const + inline void expectSelect(INT32 socket, E_Select ret = SELECT_NONE) const { expect("select").PARAM(socket).AND_RETURN(ret); } diff --git a/testing/testenv/testlib/GenProjData.h b/testing/testenv/testlib/GenProjData.h index ce10b3bc..28628ae7 100644 --- a/testing/testenv/testlib/GenProjData.h +++ b/testing/testenv/testlib/GenProjData.h @@ -65,10 +65,10 @@ namespace test inline const ProjItem& lcr(size_t pos) const { return mLCRs.at(pos); } inline const ProjItem& seg(size_t pos) const { return mSEGs.at(pos); } - inline const ComName& tswName(size_t pos) const { return tsw(pos).name; } - inline const ComName& sigName(size_t pos) const { return sig(pos).name; } - inline const ComName& lcrName(size_t pos) const { return lcr(pos).name; } - inline const ComName& segName(size_t pos) const { return seg(pos).name; } + inline const ComAddr& tswAddr(size_t pos) const { return tsw(pos).addr; } + inline const ComAddr& sigAddr(size_t pos) const { return sig(pos).addr; } + inline const ComAddr& lcrAddr(size_t pos) const { return lcr(pos).addr; } + inline const ComAddr& segAddr(size_t pos) const { return seg(pos).addr; } void setSigType(size_t pos, UINT8 type) { @@ -116,7 +116,7 @@ namespace test { vec.resize(num); for (auto& elem : vec) { - nameElement(elem, num--, what); + adrrElement(elem, num--, what); } } diff --git a/testing/testenv/testlib/TestLib.h b/testing/testenv/testlib/TestLib.h index b5280a01..5cd9838b 100644 --- a/testing/testenv/testlib/TestLib.h +++ b/testing/testenv/testlib/TestLib.h @@ -12,25 +12,25 @@ namespace test { - // preset ComName for testing - void genComName(ComName& cName, UINT32 num, CONST_C_STRING name = "ELM"); + // preset ComAddr for testing + void genComAddr(ComAddr& cName, UINT32 num, CONST_C_STRING addr = "ELM"); template - void nameElement(T& elem, UINT32 num, CONST_C_STRING name = "ELM") + void adrrElement(T& elem, UINT32 num, CONST_C_STRING addr = "ELM") { - genComName(elem.name, num, name); + genComAddr(elem.addr, num, addr); } - const ComName& genComName(UINT32 num, CONST_C_STRING name = "ELM"); + const ComAddr& genComAddr(UINT32 num, CONST_C_STRING addr = "ELM"); - inline bool operator==(const ComName& n1, const ComName& n2) + inline bool operator==(const ComAddr& n1, const ComAddr& n2) { return Mem::cmp(n1.chars, n2.chars) == 0; } // avoid "not used" warning - template - void play(const T&) + template + void play(const T&...) {} // exchangeable non const reference diff --git a/testing/testenv/testlib/src/TestLib.cpp b/testing/testenv/testlib/src/TestLib.cpp index 4435dcea..a04abf53 100644 --- a/testing/testenv/testlib/src/TestLib.cpp +++ b/testing/testenv/testlib/src/TestLib.cpp @@ -6,23 +6,21 @@ namespace test { - const ComName& genComName(const UINT32 num, const CONST_C_STRING name) + const ComAddr& genComAddr(const UINT32 num, const CONST_C_STRING addr) { - static ComName cName; - genComName(cName, num, name); - return cName; + static ComAddr cAddr; + genComAddr(cAddr, num, addr); + return cAddr; } - void genComName(ComName& cName, UINT32 num, CONST_C_STRING name) + void genComAddr(ComAddr& cAddr, UINT32 num, CONST_C_STRING addr) { - std::memset(cName.chars, ' ', ComNameSize); - static CHAR buf[sizeof(ComName) + 1]; - const int sz = std::snprintf(buf, sizeof(buf), "%s %03u ", name, num); + std::memset(cAddr.chars, ' ', ComNameSize); + static CHAR buf[sizeof(ComAddr) + 1]; + const int sz = std::snprintf(buf, sizeof(buf), "%s %03u ", addr, num); if (sz > 0) { - std::memcpy(cName.chars, buf, sz - 1); + std::memcpy(cAddr.chars, buf, sz - 1); } } - - } // namespace diff --git a/testing/testenv/testlib/src/TestMain.cpp b/testing/testenv/testlib/src/TestMain.cpp index 656ead1f..653c9a6c 100644 --- a/testing/testenv/testlib/src/TestMain.cpp +++ b/testing/testenv/testlib/src/TestMain.cpp @@ -11,5 +11,9 @@ int main(const INT32 argc, const CONST_C_STRING* const argv) TestStepsPlugin::setup(); test::installComparators(TestStepsPlugin::instance()); +#ifdef REQUIRE_PARAM + return argc > 1 ? CommandLineTestRunner::RunAllTests(argc, argv) : 0; +#else return CommandLineTestRunner::RunAllTests(argc, argv); +#endif } diff --git a/testing/tests/devtests/DT_02.cpp b/testing/tests/devtests/DT_02.cpp index 3a187e18..bd138a6f 100644 --- a/testing/tests/devtests/DT_02.cpp +++ b/testing/tests/devtests/DT_02.cpp @@ -19,14 +19,14 @@ namespace test CHAR chars[10] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; std::ostringstream os; - os << fixC(chars); + os << fixT(chars); STRCMP_EQUAL("0123456789", os.str().c_str()); STEP(2) chars[4] = 0; chars[7] = 127; os.str(""); - os << fixC(chars); + os << fixT(chars); STRCMP_EQUAL("0123*56*89", os.str().c_str()); } } diff --git a/testing/tests/devtests/DT_03.cpp b/testing/tests/devtests/DT_03.cpp index 367fbabf..38c58026 100644 --- a/testing/tests/devtests/DT_03.cpp +++ b/testing/tests/devtests/DT_03.cpp @@ -12,7 +12,6 @@ namespace test { - TEST_GROUP_BASE(DT_03, TestGroupBase) {}; // test type: equivalence class test @@ -28,8 +27,8 @@ namespace test for (UINT32 n = 0; n < CAPTSW; ++n) { LSTEP(n) - const ComName& name = genComName(CAPTSW - n, "TSW"); - L_CHECK_TRUE(name == projData.pTSW()[n].name) + const ComAddr& addr = genComAddr(CAPTSW - n, "TSW"); + L_CHECK_TRUE(addr == projData.pTSW()[n].addr) } ENDSTEPS() @@ -40,8 +39,8 @@ namespace test for (UINT32 n = 0; n < CAPSIG; ++n) { LSTEP(n) - const ComName& name = genComName(CAPSIG - n, "SIG"); - L_CHECK_TRUE(name == projData.pSIG()[n].name) + const ComAddr& addr = genComAddr(CAPSIG - n, "SIG"); + L_CHECK_TRUE(addr == projData.pSIG()[n].addr) } ENDSTEPS() @@ -52,8 +51,8 @@ namespace test for (UINT32 n = 0; n < CAPLCR; ++n) { LSTEP(n) - const ComName& name = genComName(CAPLCR - n, "LCR"); - L_CHECK_TRUE(name == projData.pLCR()[n].name) + const ComAddr& addr = genComAddr(CAPLCR - n, "LCR"); + L_CHECK_TRUE(addr == projData.pLCR()[n].addr) } ENDSTEPS() @@ -64,8 +63,8 @@ namespace test for (UINT32 n = 0; n < CAPSEG; ++n) { LSTEP(n) - const ComName& name = genComName(CAPSEG - n, "SEG"); - L_CHECK_TRUE(name == projData.pSEG()[n].name) + const ComAddr& addr = genComAddr(CAPSEG - n, "SEG"); + L_CHECK_TRUE(addr == projData.pSEG()[n].addr) } ENDSTEPS() } diff --git a/testing/tests/moduletests/BAS/BAS_02.cpp b/testing/tests/moduletests/BAS/BAS_02.cpp index 91f00f2f..cbdaa56c 100644 --- a/testing/tests/moduletests/BAS/BAS_02.cpp +++ b/testing/tests/moduletests/BAS/BAS_02.cpp @@ -1,11 +1,11 @@ // ============================================================ -// test of NcpIndex +// test of AcpIndex // - should also cover all methods of container class Index // ============================================================ // created by Manfred Sorgo #include -#include +#include namespace test { @@ -16,7 +16,7 @@ namespace test // add and find data TEST(BAS_02, T01) { - NcpIndex indx; + AcpIndex indx; const UINT8 tSize = 10; const UINT8 tOffs = tSize - 1; @@ -24,7 +24,7 @@ namespace test STEP(1) for (UINT8 n = 0; n < tSize; ++n) { - indx.add(genComName(tOffs - n), n, n); + indx.add(genComAddr(tOffs - n), n, n); } STEP(2) @@ -38,11 +38,11 @@ namespace test for (UINT8 n = 0; n < tSize; ++n) { LSTEP(n) - const auto& cn = genComName(tOffs - n); + const auto& cn = genComAddr(tOffs - n); const auto fnd = indx.find(cn); L_CHECK_TRUE(fnd.valid) L_CHECK_EQUAL(static_cast(tOffs - n), fnd.pos) - const bool eq = (cn == indx.at(fnd).name); + const bool eq = (cn == indx.at(fnd).addr); L_CHECK_TRUE(eq) } ENDSTEPS() @@ -53,14 +53,14 @@ namespace test // after successful index TEST(BAS_02, T02) { - NcpIndex indx; + AcpIndex indx; // no data added STEP(1) { const auto ok = indx.index(); L_CHECK_TRUE(ok); - const auto fnd = indx.find(genComName(1)); + const auto fnd = indx.find(genComAddr(1)); L_CHECK_FALSE(fnd.valid) } @@ -69,13 +69,13 @@ namespace test STEP(2) for (UINT8 n = 0; n < 10; ++n) { - indx.add(genComName(n), n, n); - indx.add(genComName(n + 10), n, n); + indx.add(genComAddr(n), n, n); + indx.add(genComAddr(n + 10), n, n); } { const auto ok = indx.index(); L_CHECK_TRUE(ok); - const auto fnd = indx.find(genComName(20)); + const auto fnd = indx.find(genComAddr(20)); L_CHECK_FALSE(fnd.valid) } } @@ -83,12 +83,12 @@ namespace test // failure of index due to duplicate data TEST(BAS_02, T03) { - NcpIndex indx; + AcpIndex indx; // no data added STEP(1) - indx.add(genComName(1), 1, 1); - indx.add(genComName(1), 2, 3); + indx.add(genComAddr(1), 1, 1); + indx.add(genComAddr(1), 2, 3); const auto ok = indx.index(); L_CHECK_FALSE(ok); } diff --git a/testing/tests/moduletests/COM/COM_02.cpp b/testing/tests/moduletests/COM/COM_02.cpp index 67f78a49..aa20a677 100644 --- a/testing/tests/moduletests/COM/COM_02.cpp +++ b/testing/tests/moduletests/COM/COM_02.cpp @@ -73,7 +73,7 @@ namespace test // select returns 0 STEP(5) - m_TCP().expectSelect(validSocket, 0); + m_TCP().expectSelect(validSocket, SELECT_NONE); ok = listener.select(); CHECK_N_CLEAR() L_CHECK_TRUE(ok) @@ -81,7 +81,7 @@ namespace test // select returns 1 // accept returns true STEP(6) - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP_Con_Fld().expectAccept(validSocket, true); ok = listener.select(); CHECK_N_CLEAR() @@ -90,7 +90,7 @@ namespace test // select returns -1 STEP(7) expectComerr(); - m_TCP().expectSelect(validSocket, -1); + m_TCP().expectSelect(validSocket, SELECT_ERR); m_TCP().expectClose(validSocket); ok = listener.select(); CHECK_N_CLEAR() @@ -100,7 +100,7 @@ namespace test // accept returns false STEP(8) expectComerr(); - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP_Con_Fld().expectAccept(validSocket, false); m_TCP().expectClose(validSocket); ok = listener.select(); @@ -130,7 +130,7 @@ namespace test L_CHECK_TRUE(ok) STEP(2) - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP_Con_Gui().expectAccept(validSocket, true); ok = listener.select(); CHECK_N_CLEAR() @@ -153,7 +153,7 @@ namespace test L_CHECK_TRUE(ok) STEP(2) - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP_Con_Ctrl().expectAccept(validSocket, true); ok = listener.select(); CHECK_N_CLEAR() diff --git a/testing/tests/moduletests/COM/COM_03.cpp b/testing/tests/moduletests/COM/COM_03.cpp index 92d9f5af..47b46dd1 100644 --- a/testing/tests/moduletests/COM/COM_03.cpp +++ b/testing/tests/moduletests/COM/COM_03.cpp @@ -62,7 +62,7 @@ namespace test // select returns 0 no activity STEP(5) - m_TCP().expectSelect(validSocket, 0); + m_TCP().expectSelect(validSocket, SELECT_NONE); ok = client.select(); CHECK_N_CLEAR() L_CHECK_TRUE(ok) @@ -73,7 +73,7 @@ namespace test STEP(6) { const ComTele tele{{}, {101, 202}}; - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP().expectRecv(validSocket, tele); m_Dispatcher().expectFromFld(tele); ok = client.select(); @@ -84,7 +84,7 @@ namespace test // select returns -1 error STEP(7) expectComerr(); - m_TCP().expectSelect(validSocket, -1); + m_TCP().expectSelect(validSocket, SELECT_ERR); m_TCP().expectClose(); ok = client.select(); CHECK_N_CLEAR() @@ -112,7 +112,7 @@ namespace test STEP(2) { const ComTele tele{{}, {111, 212}}; - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP().expectRecv(validSocket, tele); m_Dispatcher().expectFromGui(tele); ok = client.select(); @@ -132,7 +132,7 @@ namespace test // select returns 1 activity // recv returns close event STEP(4) - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP().expectRecv(validSocket, sizeof(ComTele), 0); m_TCP().expectClose(); ok = client.select(); @@ -160,7 +160,7 @@ namespace test STEP(2) { const ComTele tele{{}, {COM_CTRL_STOP - 1, COM_CTRL_STOP}}; - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP().expectRecv(validSocket, tele); ok = client.select(); CHECK_N_CLEAR() @@ -172,7 +172,7 @@ namespace test STEP(3) { const ComTele tele1{{}, {COM_CTRL_STOP, COM_CTRL_STOP}}; - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP().expectRecv(validSocket, tele1); m_Com().expectStop(); ok = client.select(); @@ -185,7 +185,7 @@ namespace test STEP(4) { const ComTele tele1{{}, {COM_CTRL_PING, COM_CTRL_PING}}; - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP().expectRecv(validSocket, tele1); m_TCP().expectSend(validSocket, sizeof(ComTele)); ok = client.select(); @@ -198,7 +198,7 @@ namespace test STEP(5) { const ComTele tele1{{}, {COM_CTRL_RE_GUI, COM_CTRL_RE_GUI}}; - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP().expectRecv(validSocket, tele1); m_Dispatcher().expectReGui(); ok = client.select(); @@ -211,7 +211,7 @@ namespace test STEP(5) { const ComTele tele1{{}, {PARAM_UNKNOWN, PARAM_UNKNOWN}}; - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP().expectRecv(validSocket, tele1); ok = client.select(); CHECK_N_CLEAR() @@ -221,7 +221,7 @@ namespace test // recv returns invalid size STEP(7) expectComerr(); - m_TCP().expectSelect(validSocket, 1); + m_TCP().expectSelect(validSocket, SELECT_READY); m_TCP().expectRecv(validSocket, sizeof(ComTele), sizeof(ComTele) - 1); m_TCP().expectClose(); ok = client.select(); diff --git a/testing/tests/moduletests/LCR/LCR_02.cpp b/testing/tests/moduletests/LCR/LCR_02.cpp index d6dd1760..53ccc35c 100644 --- a/testing/tests/moduletests/LCR/LCR_02.cpp +++ b/testing/tests/moduletests/LCR/LCR_02.cpp @@ -28,8 +28,8 @@ namespace test I_Provider& prv = LCR_Provider::instance(); STEP(1) - m_Dispatcher().expectAssign(mData.lcrName(0), COMP_LCR, 0, 0); - m_Dispatcher().expectAssign(mData.lcrName(1), COMP_LCR, 1, 1); + m_Dispatcher().expectAssign(mData.lcrAddr(0), COMP_LCR, 0, 0); + m_Dispatcher().expectAssign(mData.lcrAddr(1), COMP_LCR, 1, 1); prv.load(mData.pLCR(), mData.numLCR()); CHECK_N_CLEAR() L_CHECK_EQUAL(2, prv.size()) @@ -46,8 +46,8 @@ namespace test mData.setLcrType(1, TYPE_LCR_UBK + 100); STEP(1) - m_Dispatcher().expectAssign(mData.lcrName(0), COMP_LCR, 0, 0); - m_Dispatcher().expectAssign(mData.lcrName(1), COMP_LCR, 1, 1); + m_Dispatcher().expectAssign(mData.lcrAddr(0), COMP_LCR, 0, 0); + m_Dispatcher().expectAssign(mData.lcrAddr(1), COMP_LCR, 1, 1); m_Log().expectLog(COMP_LCR, RET_ERR_STARTUP); prv.load(mData.pLCR(), mData.numLCR()); CHECK_N_CLEAR() @@ -62,8 +62,8 @@ namespace test I_Provider& prv = LCR_Provider::instance(); STEP(1) - m_Dispatcher().expectAssign(mData.lcrName(0), COMP_LCR, 0, 0); - m_Dispatcher().expectAssign(mData.lcrName(1), COMP_LCR, 1, -1); + m_Dispatcher().expectAssign(mData.lcrAddr(0), COMP_LCR, 0, 0); + m_Dispatcher().expectAssign(mData.lcrAddr(1), COMP_LCR, 1, -1); m_Log().expectLog(COMP_LCR, RET_ERR_STARTUP); prv.load(mData.pLCR(), mData.numLCR()); CHECK_N_CLEAR() diff --git a/testing/tests/moduletests/SIG/SIG_02.cpp b/testing/tests/moduletests/SIG/SIG_02.cpp index 9181e11d..b0a9a833 100644 --- a/testing/tests/moduletests/SIG/SIG_02.cpp +++ b/testing/tests/moduletests/SIG/SIG_02.cpp @@ -29,9 +29,9 @@ namespace test I_Provider& prv = SIG_Provider::instance(); STEP(1) - m_Dispatcher().expectAssign(mData.sigName(0), COMP_SIG, 0, 0); - m_Dispatcher().expectAssign(mData.sigName(1), COMP_SIG, 1, 1); - m_Dispatcher().expectAssign(mData.sigName(2), COMP_SIG, 2, 2); + m_Dispatcher().expectAssign(mData.sigAddr(0), COMP_SIG, 0, 0); + m_Dispatcher().expectAssign(mData.sigAddr(1), COMP_SIG, 1, 1); + m_Dispatcher().expectAssign(mData.sigAddr(2), COMP_SIG, 2, 2); prv.load(mData.pSIG(), mData.numSIG()); CHECK_N_CLEAR() L_CHECK_EQUAL(3, prv.size()) @@ -49,9 +49,9 @@ namespace test mData.setSigType(2, TYPE_SIG_H + 100); STEP(1) - m_Dispatcher().expectAssign(mData.sigName(0), COMP_SIG, 0, 0); - m_Dispatcher().expectAssign(mData.sigName(1), COMP_SIG, 1, 1); - m_Dispatcher().expectAssign(mData.sigName(2), COMP_SIG, 2, 2); + m_Dispatcher().expectAssign(mData.sigAddr(0), COMP_SIG, 0, 0); + m_Dispatcher().expectAssign(mData.sigAddr(1), COMP_SIG, 1, 1); + m_Dispatcher().expectAssign(mData.sigAddr(2), COMP_SIG, 2, 2); m_Log().expectLog(COMP_SIG, RET_ERR_STARTUP); prv.load(mData.pSIG(), mData.numSIG()); CHECK_N_CLEAR() @@ -66,9 +66,9 @@ namespace test I_Provider& prv = SIG_Provider::instance(); STEP(1) - m_Dispatcher().expectAssign(mData.sigName(0), COMP_SIG, 0, 0); - m_Dispatcher().expectAssign(mData.sigName(1), COMP_SIG, 1, 1); - m_Dispatcher().expectAssign(mData.sigName(2), COMP_SIG, 2, -1); + m_Dispatcher().expectAssign(mData.sigAddr(0), COMP_SIG, 0, 0); + m_Dispatcher().expectAssign(mData.sigAddr(1), COMP_SIG, 1, 1); + m_Dispatcher().expectAssign(mData.sigAddr(2), COMP_SIG, 2, -1); m_Log().expectLog(COMP_SIG, RET_ERR_STARTUP); prv.load(mData.pSIG(), mData.numSIG()); CHECK_N_CLEAR() diff --git a/testing/tests/moduletests/SYS/SYS_01.cpp b/testing/tests/moduletests/SYS/SYS_01.cpp index 64a51a21..ee7d5254 100644 --- a/testing/tests/moduletests/SYS/SYS_01.cpp +++ b/testing/tests/moduletests/SYS/SYS_01.cpp @@ -34,7 +34,7 @@ namespace test const size_t wSize = sizeof(ProjItem) * n * 4 + sizeof(ComSetup) + dev; - for (size_t n = 0; n < wSize; ++n) + for (size_t i = 0; i < wSize; ++i) { os << ' '; } diff --git a/testing/tests/moduletests/SYS/SYS_02.cpp b/testing/tests/moduletests/SYS/SYS_02.cpp index e4c37175..d196a001 100644 --- a/testing/tests/moduletests/SYS/SYS_02.cpp +++ b/testing/tests/moduletests/SYS/SYS_02.cpp @@ -13,10 +13,10 @@ namespace test { I_Dispatcher& dsp = Dispatcher::instance(); dsp.clear(); - dsp.assign(genComName(1, "TSW"), COMP_TSW, 1); - dsp.assign(genComName(2, "SIG"), COMP_SIG, 2); - dsp.assign(genComName(3, "LCR"), COMP_LCR, 3); - dsp.assign(genComName(4, "SEG"), COMP_SEG, 4); + dsp.assign(genComAddr(1, "TSW"), COMP_TSW, 1); + dsp.assign(genComAddr(2, "SIG"), COMP_SIG, 2); + dsp.assign(genComAddr(3, "LCR"), COMP_LCR, 3); + dsp.assign(genComAddr(4, "SEG"), COMP_SEG, 4); dsp.index(); } }; @@ -33,21 +33,21 @@ namespace test ComTele tele{{}, data}; STEP(1) - nameElement(tele, 1, "TSW"); + adrrElement(tele, 1, "TSW"); m_TSW_Provider().expectSize(2); m_TSW().expectFromFld(data); dsp.fromFld(tele); CHECK_N_CLEAR() STEP(2) - nameElement(tele, 2, "SIG"); + adrrElement(tele, 2, "SIG"); m_SIG_Provider().expectSize(3); m_SIG().expectFromFld(data); dsp.fromFld(tele); CHECK_N_CLEAR() STEP(3) - nameElement(tele, 3, "LCR"); + adrrElement(tele, 3, "LCR"); m_LCR_Provider().expectSize(4); m_LCR().expectFromFld(data); dsp.fromFld(tele); @@ -55,14 +55,14 @@ namespace test STEP(4) // SEG not part of current implementation - nameElement(tele, 4, "SEG"); + adrrElement(tele, 4, "SEG"); dsp.fromFld(tele); CHECK_N_CLEAR() STEP(5) // not assigned m_Log().expectLog(COMP_SYS, RET_ERR_MATCH); - nameElement(tele, 2, "TSW"); + adrrElement(tele, 2, "TSW"); dsp.fromFld(tele); CHECK_N_CLEAR() } @@ -78,21 +78,21 @@ namespace test ComTele tele{{}, data}; STEP(1) - nameElement(tele, 1, "TSW"); + adrrElement(tele, 1, "TSW"); m_TSW_Provider().expectSize(2); m_TSW().expectFromGui(data); dsp.fromGui(tele); CHECK_N_CLEAR() STEP(2) - nameElement(tele, 2, "SIG"); + adrrElement(tele, 2, "SIG"); m_SIG_Provider().expectSize(3); m_SIG().expectFromGui(data); dsp.fromGui(tele); CHECK_N_CLEAR() STEP(3) - nameElement(tele, 3, "LCR"); + adrrElement(tele, 3, "LCR"); m_LCR_Provider().expectSize(4); m_LCR().expectFromGui(data); dsp.fromGui(tele); @@ -100,14 +100,14 @@ namespace test STEP(4) // SEG not part of current implementation - nameElement(tele, 4, "SEG"); + adrrElement(tele, 4, "SEG"); dsp.fromGui(tele); CHECK_N_CLEAR() STEP(5) // not assigned m_Log().expectLog(COMP_SYS, RET_ERR_MATCH); - nameElement(tele, 2, "TSW"); + adrrElement(tele, 2, "TSW"); dsp.fromGui(tele); CHECK_N_CLEAR() } @@ -124,25 +124,25 @@ namespace test ComTele teleExp{{}, data}; STEP(1) - nameElement(teleExp, 1, "TSW"); + adrrElement(teleExp, 1, "TSW"); m_Com().expectToFld(teleExp); dsp.toFld(0, data); CHECK_N_CLEAR() STEP(2) - nameElement(teleExp, 2, "SIG"); + adrrElement(teleExp, 2, "SIG"); m_Com().expectToFld(teleExp); dsp.toFld(1, data); CHECK_N_CLEAR() STEP(3) - nameElement(teleExp, 3, "LCR"); + adrrElement(teleExp, 3, "LCR"); m_Com().expectToFld(teleExp); dsp.toFld(2, data); CHECK_N_CLEAR() STEP(4) - nameElement(teleExp, 4, "SEG"); + adrrElement(teleExp, 4, "SEG"); m_Com().expectToFld(teleExp); dsp.toFld(3, data); CHECK_N_CLEAR() @@ -165,25 +165,25 @@ namespace test ComTele teleExp{{}, data}; STEP(1) - nameElement(teleExp, 1, "TSW"); + adrrElement(teleExp, 1, "TSW"); m_Com().expectToGui(teleExp); dsp.toGui(0, data); CHECK_N_CLEAR() STEP(2) - nameElement(teleExp, 2, "SIG"); + adrrElement(teleExp, 2, "SIG"); m_Com().expectToGui(teleExp); dsp.toGui(1, data); CHECK_N_CLEAR() STEP(3) - nameElement(teleExp, 3, "LCR"); + adrrElement(teleExp, 3, "LCR"); m_Com().expectToGui(teleExp); dsp.toGui(2, data); CHECK_N_CLEAR() STEP(4) - nameElement(teleExp, 4, "SEG"); + adrrElement(teleExp, 4, "SEG"); m_Com().expectToGui(teleExp); dsp.toGui(3, data); CHECK_N_CLEAR() @@ -203,11 +203,11 @@ namespace test dsp.clear(); E_Comp comp = (E_Comp) 255; - dsp.assign(genComName(1, "TSW"), comp, 1); + dsp.assign(genComAddr(1, "TSW"), comp, 1); dsp.index(); STEP(1) - const ComTele tele{genComName(1, "TSW"), {99, 111}}; + const ComTele tele{genComAddr(1, "TSW"), {99, 111}}; dsp.fromFld(tele); CHECK_N_CLEAR() @@ -222,10 +222,10 @@ namespace test { I_Dispatcher& dsp = Dispatcher::instance(); dsp.clear(); - dsp.assign(genComName(1, "TSW"), COMP_TSW, 1); - dsp.assign(genComName(1, "TSW"), COMP_TSW, 2); - dsp.assign(genComName(3, "LCR"), COMP_LCR, 3); - dsp.assign(genComName(4, "SEG"), COMP_SEG, 4); + dsp.assign(genComAddr(1, "TSW"), COMP_TSW, 1); + dsp.assign(genComAddr(1, "TSW"), COMP_TSW, 2); + dsp.assign(genComAddr(3, "LCR"), COMP_LCR, 3); + dsp.assign(genComAddr(4, "SEG"), COMP_SEG, 4); CHECK_N_CLEAR() m_Log().expectLog(COMP_SYS, RET_ERR_STARTUP); @@ -244,7 +244,7 @@ namespace test const ComData data{33, 44}; ComTele tele{{}, data}; - nameElement(tele, 1, "TSW"); + adrrElement(tele, 1, "TSW"); STEP(1) m_TSW_Provider().expectSize(1); diff --git a/testing/tests/moduletests/TSW/TSW_02.cpp b/testing/tests/moduletests/TSW/TSW_02.cpp index 0e9f67da..b0631f82 100644 --- a/testing/tests/moduletests/TSW/TSW_02.cpp +++ b/testing/tests/moduletests/TSW/TSW_02.cpp @@ -22,8 +22,8 @@ namespace test I_Provider& prv = TSW_Provider::instance(); STEP(1) - m_Dispatcher().expectAssign(mData.tswName(0), COMP_TSW, 0, 0); - m_Dispatcher().expectAssign(mData.tswName(1), COMP_TSW, 1, 1); + m_Dispatcher().expectAssign(mData.tswAddr(0), COMP_TSW, 0, 0); + m_Dispatcher().expectAssign(mData.tswAddr(1), COMP_TSW, 1, 1); prv.load(mData.pTSW(), mData.numTSW()); CHECK_N_CLEAR() L_CHECK_EQUAL(2, prv.size()) @@ -41,8 +41,8 @@ namespace test I_Provider& prv = TSW_Provider::instance(); STEP(1) - m_Dispatcher().expectAssign(mData.tswName(0), COMP_TSW, 0, 0); - m_Dispatcher().expectAssign(mData.tswName(1), COMP_TSW, 1, -1); + m_Dispatcher().expectAssign(mData.tswAddr(0), COMP_TSW, 0, 0); + m_Dispatcher().expectAssign(mData.tswAddr(1), COMP_TSW, 1, -1); m_Log().expectLog(COMP_TSW, RET_ERR_STARTUP); prv.load(mData.pTSW(), mData.numTSW()); CHECK_N_CLEAR() diff --git a/testing/tests/systemtests/SYST_01.cpp b/testing/tests/systemtests/SYST_01.cpp index b0fa8466..fdf9d2cf 100644 --- a/testing/tests/systemtests/SYST_01.cpp +++ b/testing/tests/systemtests/SYST_01.cpp @@ -59,7 +59,7 @@ namespace test { // send ping telegram STEP(1) - const ComTele ts{genComName(22, "PING"), { COM_CTRL_PING, COM_CTRL_PING }}; + const ComTele ts{genComAddr(22, "PING"), { COM_CTRL_PING, COM_CTRL_PING }}; clientCtrl.expectRecv(ts); clientCtrl.send(ts); recvAll(); @@ -86,7 +86,7 @@ namespace test for (UINT16 n = 1; n < TEST_NUM_TSW; n += 10) { STEP(n) - const ComName cname {genComName(n, "TSW")}; + const ComAddr cname {genComAddr(n, "TSW")}; const ComTele txg{cname, { TSW_CMD_WU, PARAM_UNDEF }}; clientGui.send(txg); recvAll(); @@ -99,7 +99,7 @@ namespace test for (UINT16 n = 1; n < TEST_NUM_TSW; n += 10) { STEP(n) - const ComName cname {genComName(n, "TSW")}; + const ComAddr cname {genComAddr(n, "TSW")}; const ComTele txf{cname, { TSW_STATE_LEFT, PARAM_UNDEF }}; clientGui.expectRecv(txf); clientFld.send(txf); @@ -113,7 +113,7 @@ namespace test for (UINT16 n = 1; n < TEST_NUM_TSW; n += 10) { STEP(n) - const ComName cname {genComName(n, "TSW")}; + const ComAddr cname {genComAddr(n, "TSW")}; const ComTele txgs{cname, { TSW_CMD_WU, PARAM_UNDEF }}; const ComTele txfr{cname, { TSW_STATE_RIGHT, PARAM_UNDEF }}; const ComTele txgr{cname, { TSW_STATE_WAIT_RIGHT, PARAM_UNDEF }};