This project is a cross-platform Farm Management System built using C++, CMake, CTest, GoogleTest, and Doxygen. It supports various coverage reports and detailed documentation.
- CMake >= 3.12
- C++ Standard >= 11
- GoogleTest (for module testing)
- Visual Studio Community Edition (for Windows builds)
- Ninja (for WSL/Linux builds)
Run 1-configure-pre-commit.bat to copy the 1-pre-commit script to .git/hooks. This ensures:
- Checking the integrity of
README.md,.gitignore, and Doxygen files. - Code formatting using the Astyle tool.
Run 2-create-git-ignore.bat to generate a .gitignore file if it's missing.
Run 3-install-package-manager.bat to install Chocolatey and Scoop package managers.
Run 4-install-windows-environment.bat to set up all required tools and applications.
Open PowerShell as an administrator, navigate to the project folder in WSL, and run 4-install-wsl-environment.sh to configure the WSL environment.
Run 9-clean-configure-app-windows.bat to create a Visual Studio Community Edition project file. Alternatively, use CMake to generate the development environment manually.
Run 7-build-app-windows.bat to:
- Build the project.
- Run tests.
- Package binaries for deployment.
Additional scripts:
7-build-doc-windows.bat: Generate documentation only.8-build-test-windows.bat: Run tests only.
Run 7-build-app-linux.sh to perform similar operations as on Windows, tailored for the Linux environment.
Run 9-clean-project.bat to remove all generated outputs.
The Farm Management System uses the fstream library for file operations, including:
- file_read(): Reads data from files.
- file_write(): Overwrites all data in a file.
- file_update(): Updates a specific record.
- file_line_delete(): Deletes a specific record line.
- file_append(): Appends new records to the end of a file.
The system provides the following features:
-
Crop Records:
- Crop type
- Planting and harvest dates
- Field area
- Expected yield
-
Livestock Records:
- Livestock type
- Ear tag number
- Birth date
- Diet and weight
- Health status (e.g., illness, vet check-ups, death records)
-
Pest Records:
- Pest type and application details
- Crop type treated
- Pest schedule
-
Irrigation Records:
- Irrigated crop types
- Irrigation schedules
-
Vehicle Records:
- Vehicle type, model, purchase date
- Maintenance history and schedules
-
Equipment Records:
- Equipment type, model, purchase date
- Maintenance history and schedules
-
Crop Yield Reports:
- Sample size and expected harvest calculations.
-
Profit Reports:
- Crop costs, expected income, and profit.
-
Livestock Health Reports:
- Illness history, vet check dates, and health status.
- Tested using GoogleTest and CTest.
- Achieved 95% test coverage and 100% unit test success.
| Coverage Type | Windows OS | Linux OS (WSL-Ubuntu 20.04) |
|---|---|---|
| Line Based | ||
| Branch Based | ||
| Method Based |
| Windows OS | Linux OS (WSL-Ubuntu 20.04) | |
|---|---|---|
| Coverage Ratio |
Run 7-build-app-windows.bat to perform all build operations, including:
- Cleaning project outputs.
- Generating documentation.
- Running tests and collecting coverage data.
- Generating deployment-ready binaries.
Run 7-build-app-linux.sh to perform equivalent tasks in a Linux environment.