remove-dependencies #20
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -63,7 +63,10 @@ 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')
|
||||
|
||||
if build_tests
|
||||
# GTest and GMock
|
||||
gtest_proj = subproject('gtest')
|
||||
gtest_dep = gtest_proj.get_variable('gtest_main_dep')
|
||||
@@ -73,3 +76,7 @@ if not gtest_dep.found()
|
||||
endif
|
||||
|
||||
subdir('tests')
|
||||
message('Tests enabled (buildtype=' + get_option('buildtype') + ')')
|
||||
else
|
||||
message('Tests disabled (use debug build or -Dbuild_tests=true to enable)')
|
||||
endif
|
||||
@@ -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)')
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user