Project Testing Drivers

ECE 250 students are not required to know this.

The driver file may be compiled into an executable which, when run, creates an instance of the tester class associated with the class being tested. The driver then calls the run() member function and, after the test run is complete, exits appropriately.

Suppose we are testing the class ClassName. The driver file would be:

/****************************************************
 * Class:   ClassNameDriver
 * Author:  Douglas Wilhelm Harder
 * Copyright (c) 2006 by Douglas Wilhelm Harder.  All rights reserved.
 *
 * Create an instance of the ClassNameTester class
 * and call the member function run().
 *
 * The member function run() will interpret the
 * input appropriately and exit when the interpreter
 * receives either the command 'exit' or and
 * end-of-file.
 ****************************************************/

#include "ClassNameTester.h"
#include <iostream>

int main() {
	ClassNameTester tester;

	std::cout << "Starting Test Run" << endl;

	tester.run();

	std::cout << "Finishing Test Run" << endl;
	dwharder/Algorithms_and_Data_Structures::allocation_table.summary();

	return 0;
}