Skip to content

Commit

Permalink
Removed batch size and strict options
Browse files Browse the repository at this point in the history
**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.
  • Loading branch information
Sir-NoChill committed Sep 8, 2024
1 parent ab79324 commit 92db975
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 0 additions & 4 deletions include/config/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -83,15 +81,13 @@ class Config {
// Option flags.
bool debug, time, memory;
int verbosity{0};
bool strict;

// The command timeout.
int64_t timeout;

// 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.
Expand Down
6 changes: 2 additions & 4 deletions src/config/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"};

Expand All @@ -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);
Expand Down

0 comments on commit 92db975

Please sign in to comment.