Skip to content

Commit

Permalink
moved submodules (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorgom authored Nov 8, 2024
1 parent 76d4f53 commit 9f78ae3
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .gitHooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
cd $(git rev-parse --show-toplevel)

# path to sompy python scripts
sompy=$(pwd)/sompy/somutil
sompy=$(pwd)/submodules/sompy/somutil

# files regarded as text files to be cleaned
txts=
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# specific
build
sample_reports
lab
tmp.*
tmp_*.*
tmp/
stuff
*.cov
*.html
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[submodule "sompy"]
path = sompy
path = submodules/sompy
url = [email protected]:sorgom/sompy.git
branch = dev
[submodule "somcpp"]
path = somcpp
path = submodules/somcpp
url = [email protected]:sorgom/somcpp.git
branch = dev
8 changes: 4 additions & 4 deletions make/covbr2html.make
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ endif
RESCOMP = windres
TARGETDIR = ../build
TARGET = $(TARGETDIR)/covbr2html
INCLUDES += -I../code -I../somcpp/include
INCLUDES += -I../code -I../submodules/somcpp/include
FORCE_INCLUDE +=
ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 -std=c++17 -O3 -pedantic-errors -Wall
Expand Down Expand Up @@ -146,13 +146,13 @@ $(OBJDIR)/CovbrGlobber.o: ../code/CovbrGlobber.cpp
$(OBJDIR)/main.o: ../code/main.cpp
@echo "$(notdir $<)"
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/docOpts.o: ../somcpp/src/docOpts.cpp
$(OBJDIR)/docOpts.o: ../submodules/somcpp/src/docOpts.cpp
@echo "$(notdir $<)"
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/fglob.o: ../somcpp/src/fglob.cpp
$(OBJDIR)/fglob.o: ../submodules/somcpp/src/fglob.cpp
@echo "$(notdir $<)"
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/fio.o: ../somcpp/src/fio.cpp
$(OBJDIR)/fio.o: ../submodules/somcpp/src/fio.cpp
@echo "$(notdir $<)"
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"

Expand Down
11 changes: 7 additions & 4 deletions make/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ buildoptions_vs = '/std:c++17 /MP /W4 /O2 /Ot /wd4100 /wd4103'
-- /wd4244 illegal conversion
buildoptions_gcc = '-std=c++17 -O3 -pedantic-errors -Wall'

somcpp = '../submodules/somcpp/'
somsrc = somcpp .. 'src/'

workspace 'covbr2html'

configurations { 'ci', 'trace_on', 'trace_all' }
Expand All @@ -16,7 +19,7 @@ workspace 'covbr2html'
optimize 'Speed'
kind 'ConsoleApp'

includedirs { '../code', '../somcpp/include' }
includedirs { '../code', somcpp .. '/include' }

filter { 'action:vs*' }
warnings 'high'
Expand All @@ -35,9 +38,9 @@ workspace 'covbr2html'
project 'covbr2html'
files {
'../code/*.cpp',
'../somcpp/src/fglob.cpp',
'../somcpp/src/fio.cpp',
'../somcpp/src/docOpts.cpp',
somsrc .. 'fglob.cpp',
somsrc .. 'fio.cpp',
somsrc .. 'docOpts.cpp',
}

-- project 'lab'
Expand Down
2 changes: 1 addition & 1 deletion py/sompy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is used to add sompy/somutil to the sys.path
from sys import path as syspath
from os.path import dirname, abspath, join
sompy_path = abspath(join(dirname(__file__), '../sompy/somutil'))
sompy_path = abspath(join(dirname(__file__), '../submodules/sompy/somutil'))
if sompy_path not in syspath:
syspath.insert(0, sompy_path)
2 changes: 1 addition & 1 deletion sample_msbuild/sample_BullseyeCoverageExclusions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
exclude folder ../somcpp/
exclude folder ../submodules/somcpp/
21 changes: 10 additions & 11 deletions sample_msbuild/sample_msbuild.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,41 @@ cd ..
set buildDir=%CD%\build
set srcDir=%CD%\code
set makeDir=%CD%\make
set reportsDir=%CD%\sample_reports

set exe=%buildDir%\covbr2html.exe
set todoTxt=%buildDir%\todo_%~n0.txt
set buildReport=%buildDir%\buildReport.txt
set buildReport=%buildDir%\build.log

rem set code folder to base
rem activate macro coverage
set covcopt=--srcdir %srcDir% --macro
rem set individual coverage file
set covfile=%buildDir%\%~n0.cov

if exist %covfile% del %covfile%
if exist %todoTxt% del %todoTxt%
del /Q %covfile% %todoTxt% %reportsDir%\*.* >NUL 2>&1

cd %makeDir%

echo - gen
rem generate project files
rem exit unless premake5 is available
rem requires premake5
premake5 %vsVersion%
if %errorlevel% neq 0 exit /b %errorlevel%

echo - build
rem clean solution
rem exit unless msbuild is available
rem requires msbuild
msbuild covbr2html.sln -t:clean >NUL
if %errorlevel% neq 0 exit /b %errorlevel%

rem activate coverage instrumentation
rem exit unless cov01 is available
rem requires bullseye coverage tools
cov01 -q1
if %errorlevel% neq 0 exit /b %errorlevel%

rem build the project
rem turn of coverage instrumentation
rem build solution
rem turn off coverage instrumentation
msbuild covbr2html.sln > %buildReport%
set elevel=%errorlevel%
cov01 -q0
Expand All @@ -59,11 +59,10 @@ if %elevel% neq 0 (
)

echo - run
:run
rem run executable to generate coverage data
%exe% -h >NUL
%exe% -c %myDir%\todo_*.txt >NUL
del %mydir%\todo_*.html
del /Q %mydir%\todo_*.html 2>NUL

rem apply exclusions
covselect -qd --import %myDir%\sample_BullseyeCoverageExclusions
Expand All @@ -76,4 +75,4 @@ echo - todo html
rem generate covbr report
covbr -qu --srcdir . > %todoTxt%
rem generate html report using covbr2html
%exe% -c %todoTxt%
%exe% -cwo %reportsDir% %todoTxt%
Submodule sompy updated from 000000 to 15bb47

0 comments on commit 9f78ae3

Please sign in to comment.