Skip to content

Commit 649fc20

Browse files
committed
feat: Add comprehensive testing infrastructure
- Add GitHub Actions CI/CD workflow (.github/workflows/ci.yml) * Multi-platform testing (Ubuntu, Windows, macOS) * Qt 6.5.0+ compatibility * Automated test execution with CTest * Code coverage reporting - Restructure testing directories: * manual-testing/ - Easy manual tests with Qt Creator integration * tests/ - Professional QTest framework for CI/CD - Add QTest-based unit tests: * test_diff.cpp - Core diff algorithm validation * test_patch.cpp - Patch creation and application * test_match.cpp - Fuzzy matching operations * test_edge_cases.cpp - Boundary conditions and error handling - Add performance benchmarks: * test_performance.cpp - Algorithm speed and efficiency testing * Real-world scenario testing (code, config files, Unicode) * Noise sensitivity analysis - Add memory tests: * test_memory.cpp - Memory usage and leak detection * Large file memory efficiency testing - Improve manual testing: * Updated README with Qt Creator instructions * Optimized console output with std::cout * Progress indicators for long operations * Professional formatting and error handling - Remove duplicate files and clean up structure - All tests compatible with CTest for CI integration
1 parent 1632cff commit 649fc20

33 files changed

Lines changed: 1638 additions & 2712 deletions

.github/workflows/ci.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
name: Test on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
qt-version: ['6.5.0']
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install Qt
23+
uses: jurplel/install-qt-action@v3
24+
with:
25+
version: ${{ matrix.qt-version }}
26+
modules: 'qtbase'
27+
28+
- name: Configure CMake
29+
run: |
30+
cd tests
31+
cmake -B build -DCMAKE_BUILD_TYPE=Release
32+
33+
- name: Build tests
34+
run: |
35+
cd tests
36+
cmake --build build --config Release
37+
38+
- name: Run tests
39+
run: |
40+
cd tests
41+
ctest --test-dir build --output-on-failure --verbose
42+
43+
- name: Upload test results
44+
uses: actions/upload-artifact@v3
45+
if: failure()
46+
with:
47+
name: test-results-${{ matrix.os }}
48+
path: tests/build/Testing/
49+
50+
coverage:
51+
name: Code Coverage
52+
runs-on: ubuntu-latest
53+
if: github.event_name == 'push'
54+
55+
steps:
56+
- name: Checkout code
57+
uses: actions/checkout@v4
58+
59+
- name: Install Qt
60+
uses: jurplel/install-qt-action@v3
61+
with:
62+
version: '6.5.0'
63+
modules: 'qtbase'
64+
65+
- name: Install coverage tools
66+
run: |
67+
sudo apt-get update
68+
sudo apt-get install -y gcov lcov
69+
70+
- name: Configure CMake with coverage
71+
run: |
72+
cd tests
73+
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="--coverage"
74+
75+
- name: Build and test with coverage
76+
run: |
77+
cd tests
78+
cmake --build build
79+
ctest --test-dir build --output-on-failure
80+
81+
- name: Generate coverage report
82+
run: |
83+
cd tests
84+
lcov --capture --directory build --output-file coverage.info
85+
lcov --remove coverage.info '/usr/*' --output-file coverage.info
86+
lcov --list coverage.info
87+
88+
- name: Upload coverage to Codecov
89+
uses: codecov/codecov-action@v3
90+
with:
91+
file: tests/coverage.info
92+
fail_ci_if_error: false

0 commit comments

Comments
 (0)