Welcome to the C++ Programming Classroom! This repository is set up for automated testing and grading of C++ programming assignments.
This classroom provides a complete environment for C++ programming assignments with:
- β Automated Testing - Your code is tested automatically when you submit
- ποΈ CMake Build System - Professional C++ project structure
- π§ͺ Google Test Framework - Industry-standard unit testing
- π Autograding - Instant feedback on your submissions
- π― GitHub Actions CI/CD - Continuous integration and deployment
π c-programming-group2-sverghes/
βββ π assignments/ # All programming assignments
β βββ π assignment1/ # Hello World with Functions
β β βββ π src/ # Your source code (.cpp files)
β β βββ π include/ # Header files (.h/.hpp files)
β β βββ π tests/ # Unit tests
β β βββ CMakeLists.txt # Build configuration
β β βββ README.md # Assignment instructions
β βββ π assignment2/ # Future assignments...
βββ π template/ # Template for new assignments
βββ π .github/workflows/ # Automated testing configuration
βββ CMakeLists.txt # Main build configuration
βββ README.md # This file
- Git - for version control
- CMake (3.14+) - build system
- C++ Compiler - GCC 7+ or Clang 7+ or MSVC 2017+
- Internet connection - for downloading Google Test
-
Clone the repository
git clone <your-repo-url> cd c-programming-group2-sverghes
-
Build all assignments
mkdir build cd build cmake .. make
-
Run tests
ctest
-
Run a specific assignment
./assignments/assignment1/assignment1
cd assignments/assignment1 # or assignment2, etc.
Each assignment has a README.md
with:
- Objective and requirements
- Function specifications
- Expected inputs/outputs
- Grading criteria
- Write your header files in
include/
- Write your source code in
src/
- Follow the function signatures provided
# From the root directory
mkdir -p build && cd build
cmake ..
make
ctest # Run all tests
./assignments/assignment1/assignment1 # Run your program
git add .
git commit -m "Complete assignment 1"
git push
When you push code, GitHub Actions will:
- Build your project
- Run all tests
- Generate a grade report
- Provide feedback on what passed/failed
- Unit Tests - Test individual functions
- Integration Tests - Test complete programs
- Edge Cases - Test boundary conditions
- Code Quality - Check for warnings/errors
- Go to Actions tab in GitHub
- Click on the latest workflow run
- View the test results and grade report
- Download artifacts for detailed feedback
- β Use meaningful variable names
- β Add comments for complex logic
- β Follow consistent formatting
- β Handle edge cases appropriately
- π§ͺ Test your code before submitting
- π§ͺ Consider edge cases (empty inputs, negative numbers, etc.)
- π§ͺ Verify function return types match specifications
- π§ͺ Test with different input values
β Build Failures
- Check for syntax errors
- Ensure all required files exist
- Verify function signatures match headers
β Test Failures
- Read test output carefully
- Check expected vs actual values
- Verify your logic handles all cases
β Missing Files
- Ensure you have all required source files
- Check that headers are included properly
- Verify CMakeLists.txt references all files
Status: β
Available
Objective: Learn basic C++ functions, strings, and arithmetic
Due: Check assignment README for deadline
Key Learning Goals:
- Function declaration and definition
- String manipulation
- Basic arithmetic operations
- Boolean logic
-
Copy the template
cp -r template assignments/assignment3
-
Update the assignment
- Modify
CMakeLists.txt
with new assignment name - Write assignment-specific code and tests
- Update
README.md
with instructions
- Modify
-
Add to build system
# In root CMakeLists.txt add_subdirectory(assignments/assignment3)
- Edit
.github/workflows/autograder.yml
- Add custom test cases in each assignment's
tests/
directory - Modify grading criteria and point distribution
- C++ Reference: https://cppreference.com/
- CMake Documentation: https://cmake.org/documentation/
- Google Test Primer: https://google.github.io/googletest/primer.html
- Check the Issues tab for common problems
- Review failed test outputs in GitHub Actions
- Ask questions in class or office hours
This classroom repository is for educational purposes. Code submissions are subject to academic integrity policies.
Happy Coding! π― Remember to start early, test often, and don't hesitate to ask for help!