remove-dependencies #20

Merged
moritz merged 7 commits from remove-dependencies into master 2025-10-19 11:35:01 +00:00
5 changed files with 33 additions and 14 deletions
Showing only changes of commit c94505dc0d - Show all commits

View File

@@ -35,13 +35,13 @@ jobs:
apt-cache policy libusb-1.0-0-dev
echo "=== End dependency package version ==="
- name: Build ptprnt debug
run: scripts/build.sh debug --coverage --test
run: scripts/build.sh -j2 debug --coverage --test
- name: Generate coverage
run: scripts/generate_coverage.sh --text
- name: Coverage report
run: cat ./coverageReport/coverage.txt
- name: build and release
run: scripts/build.sh release
- name: build release
run: scripts/build.sh -j2 release
- name: upload release binary
uses: actions/upload-artifact@v3
with:

View File

@@ -204,10 +204,10 @@ This is a modern C++20 rewrite of [ptouch-print](https://git.familie-radermacher
**Build script:**
```bash
# Release build
# Release build (tests disabled for faster builds)
./scripts/build.sh release
# Debug build
# Debug build (tests enabled)
./scripts/build.sh debug
# Debug with tests
@@ -223,6 +223,8 @@ This is a modern C++20 rewrite of [ptouch-print](https://git.familie-radermacher
./scripts/build.sh --help
```
**Note:** Tests are only built in debug mode to keep release builds fast and small. Release builds do not include test binaries or link against gtest/gmock.
**Running tests:**
```bash
# Using build script

View File

@@ -63,13 +63,20 @@ ptprnt_exe = executable(
)
### Unit tests
# Only build tests for debug builds or when explicitly enabled
build_tests = get_option('buildtype') == 'debug' or get_option('build_tests')
# GTest and GMock
gtest_proj = subproject('gtest')
gtest_dep = gtest_proj.get_variable('gtest_main_dep')
gmock_dep = gtest_proj.get_variable('gmock_main_dep')
if not gtest_dep.found()
if build_tests
# GTest and GMock
gtest_proj = subproject('gtest')
gtest_dep = gtest_proj.get_variable('gtest_main_dep')
gmock_dep = gtest_proj.get_variable('gmock_main_dep')
if not gtest_dep.found()
error('MESON_SKIP_TEST: gtest not installed.')
endif
endif
subdir('tests')
subdir('tests')
message('Tests enabled (buildtype=' + get_option('buildtype') + ')')
else
message('Tests disabled (use debug build or -Dbuild_tests=true to enable)')
endif

View File

@@ -2,3 +2,8 @@ option('usb_trace_only',
type: 'boolean',
value: false,
description: 'Enable USB trace mode: log USB data without sending to device (saves label tape during debugging)')
option('build_tests',
type: 'boolean',
value: false,
description: 'Build unit tests (automatically enabled for debug builds)')

View File

@@ -108,7 +108,12 @@ else
echo -e "${YELLOW}Warning: Coverage is only supported for debug builds, ignoring --coverage${NC}"
fi
echo -e "${BLUE}Building release version${NC}"
if [[ "${RUN_TESTS}" == true ]]; then
echo -e "${YELLOW}Warning: Tests are not built for release builds (use debug build for testing)${NC}"
RUN_TESTS=false
fi
echo -e "${BLUE}Building release version (tests disabled)${NC}"
fi
# Setup or reconfigure build directory