Skip to content

Написать тесты которые будут запускаться через cmake#14

Merged
netkeep80 merged 3 commits intonetkeep80:mainfrom
konard:issue-13-51916990de2e
Jan 27, 2026
Merged

Написать тесты которые будут запускаться через cmake#14
netkeep80 merged 3 commits intonetkeep80:mainfrom
konard:issue-13-51916990de2e

Conversation

@konard
Copy link
Copy Markdown
Contributor

@konard konard commented Jan 27, 2026

Summary

Добавлена полноценная система тестирования с использованием CTest, которая интегрируется с CMake и запускается командой ctest.

Изменения:

  • Добавлена конфигурация CTest в CMakeLists.txt с 5 тестовыми наборами
  • Добавлен скрипт cmake/test_save_load.cmake для тестирования сохранения/загрузки модели
  • Добавлен кросс-платформенный скрипт test.sh для удобного запуска тестов
  • Обновлен GitHub Actions workflow для использования ctest
  • Оптимизирована конфигурация extended.json для быстрого выполнения тестов

Тестовые наборы:

  1. test_simple_classification - Быстрый тест с классами yes/no (~0.3 сек)
  2. test_default_classification - Стандартный тест с 4 классами (~50 сек)
  3. test_benchmark_training_speed - Бенчмарк скорости обучения (~25 сек)
  4. test_model_save_load - Тест сохранения и загрузки модели (~0.3 сек)
  5. test_extended_classification - Тест с 5 классами (~10 сек)

Запуск тестов:

# Полная сборка и тестирование
./test.sh

# Только тесты (в директории build)
ctest -C Release

# Подробный вывод при ошибках
ctest -C Release --output-on-failure

# Запуск конкретного теста
ctest -C Release -R test_benchmark

# Показать доступные тесты
ctest -N

Метрики производительности:

Тест test_benchmark_training_speed выводит следующие метрики:

  • Время обучения в миллисекундах
  • Количество итераций обучения
  • Время на одну итерацию
  • Скорость обучения (классов/сек)
  • Скорость создания нейронов (нейронов/сек)

Test plan

  • Проверить сборку проекта (cmake --build)
  • Проверить работу ctest -C Release
  • Все 5 тестов проходят локально (100% tests passed)
  • Проверить CI на GitHub Actions (Linux, Windows, macOS)

Fixes

Fixes #13


🤖 Generated with Claude Code

konard and others added 2 commits January 27, 2026 18:59
Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: netkeep80#13
- Add CTest configuration to CMakeLists.txt with 5 test suites:
  - test_simple_classification: Quick test with yes/no classes
  - test_default_classification: Standard 4-class test
  - test_benchmark_training_speed: Performance benchmark
  - test_model_save_load: Model persistence test
  - test_extended_classification: Multi-class test
- Add cmake/test_save_load.cmake script for model save/load testing
- Add test.sh cross-platform test runner script
- Update GitHub Actions workflow to use 'ctest' command
- Update .gitignore to allow cmake/ directory scripts
- Simplify extended.json config for faster test execution

Tests can now be run with:
- ./test.sh (full build + test)
- ctest -C Release (in build directory)
- ctest --output-on-failure (verbose output)

Fixes netkeep80#13

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] Написать тесты которые будут запускаться через cmake Написать тесты которые будут запускаться через cmake Jan 27, 2026
@konard konard marked this pull request as ready for review January 27, 2026 18:15
@konard
Copy link
Copy Markdown
Contributor Author

konard commented Jan 27, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $3.990098 USD
  • Calculated by Anthropic: $2.541520 USD
  • Difference: $-1.448578 (-36.30%)
    📎 Log file uploaded as Gist (643KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented Jan 27, 2026

🔄 Auto-restart 1/3

Detected uncommitted changes from previous run. Starting new session to review and commit them.

Uncommitted files:

?? cmake_build.log
?? cmake_configure.log
?? ctest_output.log
?? ctest_output2.log

Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented Jan 27, 2026

🔄 Auto-restart 1/3 Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $1.164884 USD
  • Calculated by Anthropic: $0.662070 USD
  • Difference: $-0.502814 (-43.16%)
    📎 Log file uploaded as Gist (819KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented Jan 27, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $1.164884 USD
  • Calculated by Anthropic: $0.662070 USD
  • Difference: $-0.502814 (-43.16%)
    📎 Log file uploaded as Gist (822KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@netkeep80 netkeep80 merged commit ef21ba9 into netkeep80:main Jan 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Написать тесты которые будут запускаться через cmake

2 participants