From 92db9751d5ca63bfe1bf36548ad63b4d0e2d48c1 Mon Sep 17 00:00:00 2001 From: Ayrton Chilibeck Date: Sun, 8 Sep 2024 07:31:47 -0600 Subject: [PATCH] Removed batch size and strict options **Batch Size** Not necessary since the threads will just grab everything in their subpackage. In the future it would be nice to, instead of seperating based on packages: 1. Generate the set of all tests 2. Threads access batchSize tests at a time 3. Threads then keep referring back to the test pool for which tests need executing This would eliminate the need for constantly restarting threads, but would take a bit of a refactor to implement correctly. **Strict** I'm tired. I hate writing C++. I'm going to sleep. Here's my PR. --- include/config/Config.h | 4 ---- src/config/Config.cpp | 6 ++---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/config/Config.h b/include/config/Config.h index 8502952..be6622f 100644 --- a/include/config/Config.h +++ b/include/config/Config.h @@ -51,12 +51,10 @@ class Config { bool isTimed() const { return time; } bool isMemoryChecked() const { return memory; } int getVerbosity() const { return verbosity; } - bool isStrict() const { return strict; } // Config int getters. int64_t getTimeout() const { return timeout; } int64_t getNumThreads() const { return numThreads; } - int8_t getBatchSize() const { return batchSize; } // Initialisation verification. bool isInitialised() const { return initialised; } @@ -83,7 +81,6 @@ class Config { // Option flags. bool debug, time, memory; int verbosity{0}; - bool strict; // The command timeout. int64_t timeout; @@ -91,7 +88,6 @@ class Config { // Number of threads on which to run tests int64_t numThreads; // Number of tests for each thread to grab on each run - int8_t batchSize; // Is the config initialised or not and an appropriate error code. This // could be due to asking for help or a missing config file. diff --git a/src/config/Config.cpp b/src/config/Config.cpp index 65e6e29..7cad246 100644 --- a/src/config/Config.cpp +++ b/src/config/Config.cpp @@ -17,7 +17,7 @@ using JSON = nlohmann::json; namespace tester { -Config::Config(int argc, char** argv) : strict(false), timeout(2l), numThreads(1), batchSize(5) { +Config::Config(int argc, char** argv) : timeout(2l), numThreads(1) { CLI::App app{"CMPUT 415 testing utility"}; @@ -40,9 +40,7 @@ Config::Config(int argc, char** argv) : strict(false), timeout(2l), numThreads(1 // multithreading options app.add_option("-j", numThreads, "The number of threads on which to execute tests."); - app.add_flag("--strict", strict, "Set to strict timing mode."); - app.add_option("--batch-size", batchSize, "(ADVANCED) the number of tests for each thread to grab on each round of selection."); - + // Enforce that if a grade path is supplied, then a log file should be as well and vice versa gradeOpt->needs(solutionFailureLogOpt); solutionFailureLogOpt->needs(gradeOpt);