Skip to content

Commit

Permalink
trying to pass variables down
Browse files Browse the repository at this point in the history
  • Loading branch information
SonikaG committed Oct 19, 2017
1 parent b1dd1a0 commit 3a3b816
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions code/harness/Tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ int Tester::test_setup() {
return test_loader.get_instance()->setup();
}

int Tester::test_pass(string mountDir, string filesysSize){
return test_loader.get_instance()->pass(mountDir, filesysSize);
}

int Tester::test_run() {
return test_loader.get_instance()->run();
}
Expand Down
1 change: 1 addition & 0 deletions code/harness/Tester.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class Tester {
int test_load_class(const char* path);
void test_unload_class();
int test_setup();
int test_pass(std::string mountDir, std::string filesysSize);
int test_run();
int test_check_permutations(const int num_rounds);
int test_check_random_permutations(const int num_rounds);
Expand Down
3 changes: 2 additions & 1 deletion code/harness/c_harness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ int main(int argc, char** argv) {
****************************************************************************/
const unsigned int test_case_idx = optind;
const string path = argv[test_case_idx];
cout << test_dev << endl;
if(!(setenv("MOUNT_FS", test_dev.c_str(), 1))){
cerr << "Error setting environment variable MOUNT_FS" << endl;
}
Expand Down Expand Up @@ -228,7 +229,7 @@ int main(int argc, char** argv) {
}
test_harness.set_fs_type(fs_type);
test_harness.set_device(test_dev);

test_harness.test_pass(test_dev, filesize);
// Load the class being tested.
cout << "Loading test case" << endl;
if (test_harness.test_load_class(argv[test_case_idx]) != SUCCESS) {
Expand Down
3 changes: 1 addition & 2 deletions code/tests/BaseTestCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ namespace tests {

class BaseTestCase {
public:
std::string mountDir;
std::string fileSysSize;
virtual ~BaseTestCase() {};
virtual int setup() = 0;
virtual int run() = 0;
virtual int check_test(unsigned int last_checkpoint,
DataTestResult *test_result) = 0;
virtual int pass(std::string mountDir, std::string filesysSize) {}
};

typedef BaseTestCase *test_create_t();
Expand Down
3 changes: 3 additions & 0 deletions code/tests/rename_root_to_sub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ class rename_root_to_sub : public BaseTestCase {

return 0;
}
virtual int pass(std::string mountDir, std::string filesysSize){
std::cout << mountDir << " " << filesysSize << std::endl;
}

private:
char text[strlen(TEST_TEXT)];
Expand Down

0 comments on commit 3a3b816

Please sign in to comment.