diff --git a/DRAMSys/tests/start.pl b/DRAMSys/tests/start.pl index 43ff397f..a04a38e1 100755 --- a/DRAMSys/tests/start.pl +++ b/DRAMSys/tests/start.pl @@ -39,6 +39,13 @@ use strict; use Term::ANSIColor; use Time::localtime; +my $pathSelector = shift || ""; + +if($pathSelector eq "absolute") +{ + chdir("/home/test_dramsys/dram.vp.system/DRAMSys/tests") || die("chdir"); +} + my $timestamp_color = "green"; print color("red")," |||\n"; @@ -52,9 +59,9 @@ print color("red")," ||| ", color("green"),"DRAMSys Automated Test System\n" my $numberOfCores = `cat /proc/cpuinfo | grep processor | wc -l`; # Navigate to Build Folder -chdir("../../"); +chdir("../../") || die("chdir"); `mkdir build >/dev/null 2>&1`; -chdir("build/"); +chdir("build/") || die("chdir"); # Build the Project: my $starttime = time(); @@ -76,7 +83,7 @@ else # Find all tests: # Navigate to Build Folder -chdir("../DRAMSys/tests"); +chdir("../DRAMSys/tests") || die("chdir"); my @tests = split(/\n/,`find -iname test.pl`); # Run Tests: @@ -85,7 +92,7 @@ foreach(@tests) if($_ =~ /\.\/([\w\d]+)\/test\.pl/) { my $name = $1; - chdir("./$name"); + chdir("./$name") || die("chdir"); print color($timestamp_color), timestamp(), color("reset"),"Test: ".$name."\t"; $starttime = time(); `perl test.pl`; @@ -99,7 +106,7 @@ foreach(@tests) { print color("reset"),"[ ", color("red"), "fail", color("reset"), " ]\t", "(", $took, " seconds)\n"; } - chdir("../"); + chdir("../") || die("chdir"); } else {