Skip to content

Commit

Permalink
Som devel 20 (#68)
Browse files Browse the repository at this point in the history
* a not satisfying state

* a not satisfying state

* bullseye build interim (not working?)

* bullseye build interim (not working?)

* bullseye build, run & md

* minor improvements
  • Loading branch information
sorgom authored Oct 16, 2024
1 parent 78dba94 commit 25f5068
Show file tree
Hide file tree
Showing 23 changed files with 434 additions and 259 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ transitions_*.md

.obsidian

!_cov*.txt
!*/bullseye/_*.*
reports
24 changes: 12 additions & 12 deletions CLOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,50 @@
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 14 155 25 1128
C/C++ Header 17 179 148 646
C++ 14 145 25 1127
C/C++ Header 17 159 148 691
-------------------------------------------------------------------------------
SUM: 31 334 173 1774
SUM: 31 304 173 1818
-------------------------------------------------------------------------------
```
**testenv**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C/C++ Header 24 237 174 1116
C++ 9 41 0 217
C/C++ Header 24 218 175 1122
C++ 9 37 0 217
-------------------------------------------------------------------------------
SUM: 33 278 174 1333
SUM: 33 255 175 1339
-------------------------------------------------------------------------------
```
**moduletests**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 14 302 300 2376
C++ 14 290 299 2376
-------------------------------------------------------------------------------
SUM: 14 302 300 2376
SUM: 14 290 299 2376
-------------------------------------------------------------------------------
```
**systemtests**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 2 15 22 117
C++ 2 14 22 117
-------------------------------------------------------------------------------
SUM: 2 15 22 117
SUM: 2 14 22 117
-------------------------------------------------------------------------------
```
**specification**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C/C++ Header 14 97 142 309
C/C++ Header 14 85 142 346
-------------------------------------------------------------------------------
SUM: 14 97 142 309
SUM: 14 85 142 346
-------------------------------------------------------------------------------
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ The aim is to
- [AI usage](AI.md)
- [testing](testing/README.md)
- [transition tables](specification/doc/transition_tables.md)
- [code coverage](testing/coverage.md)
- [code coverage](testing/coverage_tools.md)
- [how to build](make/README.md)
- [current lines of code](CLOC.md)
2 changes: 1 addition & 1 deletion SIL4.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ Additional flags see header of [premake5_vs.lua](make/premake5_vs.lua)
## code coverage
Application code coverage by tests must be 100%.

See also [remarks on code coverage](testing/coverage.md)
See also [remarks on code coverage](testing/coverage_tools.md)
1 change: 0 additions & 1 deletion application/main/AppMain.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <SYS/IL.h>
#include <cstdio>
#include <iostream>
using std::cout, std::endl;
#include <iomanip>
Expand Down
24 changes: 24 additions & 0 deletions make/bullseye/_covbuild.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@echo off
if "%_me%" == "" exit /b 1
rem ========================================================================
rem Bullseye coverage: build step
rem ========================================================================

SETLOCAL
call cov01 -q %1

:next
shift
if "%1"=="" goto end
echo -- %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
exit /b 1
)
goto next
:end
15 changes: 15 additions & 0 deletions make/bullseye/_covdirs.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@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%
37 changes: 37 additions & 0 deletions make/bullseye/_covreport.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@echo off
if "%_me%" == "" exit /b 1
rem ========================================================================
rem Bullseye coverage: reporting
rem ========================================================================

if exist %testReport% (
echo - test errors
cat %testReport%
exit /b 1
)

if %_update% == 1 exit /b 0

set covMin=%minFunctionCov%,%minDecisionCov%

call covselect -qd
call covselect -q --import %excludeFile%

if %_genhtml% == 1 (
echo - html
call covhtml -q --allNum %covHtmlDir%
)

echo - report

echo ### %_me% %DATE% %TIME% > %covLog%
echo ``` >> %covLog%
cd %dstwDir%
call covdir -q --by-name --srcdir . >> %covLog%

set _result=failed
call covdir -q --checkmin %covMin%
if %errorlevel% == 0 set _result=passed
echo covmin %covMin% %_result% >> %covLog%
echo ``` >> %covLog%
cat %covLog%
96 changes: 96 additions & 0 deletions make/bullseye/_covstep1.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
@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%
set _cleanbuild=1
)

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
10 changes: 10 additions & 0 deletions make/bullseye/_runapp.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
if "%_me%" == "" exit /b 1
if "%tmpFile%" == "" exit /b 1
rem ========================================================================
rem system tests: run app in background
rem ========================================================================
echo running > %tmpFile%
call %exeDir%\dstw_run.exe loop >NUL
rm -f %tmpFile%
exit 0
Loading

0 comments on commit 25f5068

Please sign in to comment.