{"id":25391503,"url":"https://github.com/estnafinema0/yadro-cpp-test","last_synced_at":"2025-08-24T06:38:29.388Z","repository":{"id":276375382,"uuid":"929075467","full_name":"estnafinema0/Yadro-cpp-test","owner":"estnafinema0","description":"C++20 simulation of a computer club management system with token parsing, error reporting and unit/integration tests (Google Test).","archived":false,"fork":false,"pushed_at":"2025-02-25T13:41:43.000Z","size":162,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-15T07:33:19.744Z","etag":null,"topics":["cpp20","googletest","integration-testing","object-oriented-programming","parser","tokenizer","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/estnafinema0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-07T19:02:15.000Z","updated_at":"2025-02-25T13:41:47.000Z","dependencies_parsed_at":"2025-02-15T15:49:04.247Z","dependency_job_id":"bbc36c08-197a-4b6c-8566-2c48716f3a5f","html_url":"https://github.com/estnafinema0/Yadro-cpp-test","commit_stats":null,"previous_names":["estnafinema0/yadro","estnafinema0/yadro-cpp-test"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/estnafinema0/Yadro-cpp-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2FYadro-cpp-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2FYadro-cpp-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2FYadro-cpp-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2FYadro-cpp-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/estnafinema0","download_url":"https://codeload.github.com/estnafinema0/Yadro-cpp-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2FYadro-cpp-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271809007,"owners_count":24825631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp20","googletest","integration-testing","object-oriented-programming","parser","tokenizer","unit-testing"],"created_at":"2025-02-15T15:43:00.810Z","updated_at":"2025-08-24T06:38:29.338Z","avatar_url":"https://github.com/estnafinema0.png","language":"C++","readme":"# Computer Club Management System\n\nThis is a C++ object-oriented simulation of a computer club management system. The project is organized into clear modules that handle different parts of the system. The project includes unit tests for each module (using Google Test) as well as integration tests.\n\n---\n\n## Table of Contents\n\n- [Computer Club Management System](#computer-club-management-system)\n  - [Table of Contents](#table-of-contents)\n  - [Overview](#overview)\n  - [Setup and Build](#setup-and-build)\n    - [Install Prerequisites](#install-prerequisites)\n    - [Build](#build)\n  - [Run](#run)\n  - [Testing](#testing)\n    - [Unit Tests](#unit-tests)\n    - [Integration Tests](#integration-tests)\n  - [Usage Example](#usage-example)\n\n---\n\n## Overview\n\nA full description is available in Russian in the root directory as [Original_task.pdf](Yadro/Original_task.pdf).\n\nThe project features a clear modular structure. Each module has its own unit tests (written with Google Test). Integration tests for the whole project are also provided and include a bash script for automated execution.\n\nThe program processes a text file containing a club configuration and a sequence of events (client arrivals, seating, waiting, departures), applies business rules (such as not allowing a client to wait when tables are free and automatically seating waiting clients when a table is freed), and generates a detailed report that includes error events and revenue summaries for each table.\n\nKey modules include:\n\n- **Parser Module:** Reads and validates input from a text file.\n- **Time Module:** Converts string representations (in the format \"HH:MM\") into integer minutes (using `std::optional` for error handling).\n- **Club Module:** Implements the club's business logic for client management, seating, waiting, error reporting, and revenue calculation.\n- **Main:** Lauches the parsing and processing of events and outputs a final report.\n- **Unit Tests:** Written for [each module](Yadro/unit-tests) using Google Test.\n- **Integration Tests:** Five input and expected output files are located in the [tests folder](Yadro/tests), with a bash script for automated execution.\n\n---\n\n## Setup and Build\n\n### Install Prerequisites\n\nThe project is designed for a C++20 compiler. For testing, GNU Make and Google Test are also required.\n\nTo install Google Test, run:\n```bash\nsudo apt update\nsudo apt install libgtest-dev\n```\nThen build and install the libraries:\n```bash\ncd /usr/src/gtest\nsudo cmake .\nsudo make\nsudo cp lib/*.a /usr/lib\n```\n\n### Build\n\nIn the `Yadro/project` folder, run:\n```bash\nmake\n```\nThis command compiles the project and produces an executable named `main`.\n\nTo clean all object files, run:\n```bash\nmake clean\n```\n\n---\n\n## Run\n\nYou can run the main application from the `Yadro/project/` directory.  \nThe application requires a single argument: the input file (a test file with club instructions):\n\n```bash\n./main input_file.txt\n```\n\nFor example, to run an integration test:\n```bash\n./main ../tests/inputs/test1.in.txt\n```\n\nThe output will be printed to the console.\n\n---\n\n## Testing\n\n### Unit Tests\n\nUnit tests are organized into three groups `Yadro/unit-tests/time/`, `Yadro/unit-tests/parser/`, `Yadro/unit-tests/club/` for one module each.\n\n1. **Time tests** validate correct parsing and formatting of time strings.\n2. **Parser tests** checks that configuration lines and event lines are parsed correctly and that errors are detected as specified. If any errors detected the program stops (see the instruction). \n3. **Club tests** do the business logic for client management, seating, waiting queue handling, and end-of-day processing.\n\n\nChoose the module to check and in the chosen folder (`club`, `parser` and `time`) run:\n\n```bash\nmake\n./run_tests\n```\n\n### Integration Tests\n\nThe script iterates over all input files, runs the application, and compares the produced output with the expected output. Differences (if any happened) are displayed in the termanal.\n\nTo make test script executable in the `Yadro/tests/` folder, run: \n```bash\nchmod +x test_script.sh\n```\nRun the test script:\n```bash\n./test_script.sh\n```\n\n---\n\n## Usage Example\n\nExample of test file 1 (`test1.in.txt`):\n```\n3\n09:00 19:00\n10\n08:48 1 client1\n09:41 1 client1\n09:48 1 client2\n09:52 3 client1\n09:54 2 client1 1\n10:25 2 client2 2\n10:58 1 client3\n10:59 2 client3 3\n11:30 1 client4\n11:35 2 client4 2\n11:45 3 client4\n12:33 4 client1\n12:43 4 client2\n15:52 4 client4\n```\n\nWhen you run:\n```bash\n./main test1.in.txt\n```\n\nYou will see the following output in the terminal:\n```\n09:00\n08:48 1 client1\n08:48 13 NotOpenYet\n09:41 1 client1\n09:48 1 client2\n09:52 3 client1\n09:52 13 ICanWaitNoLonger!\n09:54 2 client1 1\n10:25 2 client2 2\n10:58 1 client3\n10:59 2 client3 3\n11:30 1 client4\n11:35 2 client4 2\n11:35 13 PlaceIsBusy\n11:45 3 client4\n12:33 4 client1\n12:33 12 client4 1\n12:43 4 client2\n15:52 4 client4\n19:00 11 client3\n19:00\n1 70 05:58\n2 30 02:18\n3 90 08:01\n```\n\n---\n\nThanks for checking!\n\n---","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festnafinema0%2Fyadro-cpp-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Festnafinema0%2Fyadro-cpp-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festnafinema0%2Fyadro-cpp-test/lists"}