Skip to content

Commit

Permalink
Adding following fixes for MS4
Browse files Browse the repository at this point in the history
1. A sample third party app.
2. Excluding 3rd party filters from default filter.
3. Added a script to clean the entire project.
4. Displaying Error for build fail in case of HIP Catch2.
5. Changing from amd -> hiptestsuite in examples/

Change-Id: Ifd9bbbbb16d1118d9cae1a5238188edea2f70890
  • Loading branch information
rupamc-amd authored and mohanmithur committed Oct 30, 2021
1 parent 8c4f685 commit fce8823
Show file tree
Hide file tree
Showing 15 changed files with 474 additions and 369 deletions.
22 changes: 22 additions & 0 deletions cleanPrj.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# This shell script removes all generated files/folders and cloned repositories
echo "Cleaning hip-testsuite project.."
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
rm -Rf report
rm -Rf src/hiptestsuite/applications/cuda_grep/CUDA-grep
rm -Rf src/hiptestsuite/applications/cuda_memtest/cuda_memtest
rm -Rf src/hiptestsuite/applications/hip_examples/GPU-STREAM
rm -Rf src/hiptestsuite/applications/hip_examples/HIP-Examples
rm -Rf src/hiptestsuite/applications/hip_examples/mixbench
rm -Rf src/hiptestsuite/applications/mgbench/mgbench
rm -Rf src/hiptestsuite/applications/hpc_apps/gridtools/boost_1_72_0
rm -Rf src/hiptestsuite/applications/hpc_apps/gridtools/GridTools
rm -Rf src/hiptestsuite/applications/hpc_apps/gridtools/gridtools
rm -Rf src/hiptestsuite/applications/hpc_apps/kokkos/kokkos
rm -Rf src/hiptestsuite/applications/hpc_apps/laghos/hypre*
rm -Rf src/hiptestsuite/applications/hpc_apps/laghos/Laghos
rm -Rf src/hiptestsuite/applications/hpc_apps/laghos/metis*
rm -Rf src/hiptestsuite/applications/hpc_apps/laghos/mfem
rm -Rf src/hiptestsuite/applications/hpc_apps/quicksilver/Quicksilver
rm -Rf src/hiptestsuite/conformance/HIP
4 changes: 2 additions & 2 deletions examples/examples/0.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

from pathlib import Path

from amd.TesterRepository import Tester
from amd.Test import TestData, TestResult
from hiptestsuite.TesterRepository import Tester
from hiptestsuite.Test import TestData, TestResult


class Test0(Tester):
Expand Down
6 changes: 3 additions & 3 deletions examples/examples/1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from amd.TesterRepository import Tester
from amd.Test import TestData, TestResult, Test
from amd.test_classifier import TestClassifier
from hiptestsuite.TesterRepository import Tester
from hiptestsuite.Test import TestData, TestResult, Test
from hiptestsuite.test_classifier import TestClassifier

from typing import List, Union

Expand Down
6 changes: 3 additions & 3 deletions examples/examples/2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from amd.TesterRepository import Tester
from amd.Test import TestData, TestResult, Test
from amd.test_classifier import TestClassifier
from hiptestsuite.TesterRepository import Tester
from hiptestsuite.Test import TestData, TestResult, Test
from hiptestsuite.test_classifier import TestClassifier

from typing import List, Union

Expand Down
6 changes: 3 additions & 3 deletions examples/examples/3.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from amd.TesterRepository import Tester
from amd.Test import HIPTestData, TestResult, Test
from amd.test_classifier import TestClassifier
from hiptestsuite.TesterRepository import Tester
from hiptestsuite.Test import HIPTestData, TestResult, Test
from hiptestsuite.test_classifier import TestClassifier

from typing import List, Union

Expand Down
4 changes: 2 additions & 2 deletions examples/examples/4.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from amd.TesterRepository import Tester
from amd.Test import TestResult, TestData, LogLocation, UserAccess
from hiptestsuite.TesterRepository import Tester
from hiptestsuite.Test import TestResult, TestData, LogLocation, UserAccess


class MyTestData(TestData, LogLocation, UserAccess):
Expand Down
6 changes: 3 additions & 3 deletions examples/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "src"))


from amd.TestersExecutor import TestersExecutor
from amd.TesterRepository import TesterRepository
from amd.list_tests import list_tests
from hiptestsuite.TestersExecutor import TestersExecutor
from hiptestsuite.TesterRepository import TesterRepository
from hiptestsuite.list_tests import list_tests
import cfg
import examples

Expand Down
5 changes: 4 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ def parse_args():


def main():
# Exclude tests from thirdparty folder
exclude_module_paths = ["hiptestsuite/thirdparty"]

if parse_args():
tester_executor: TestersExecutor = TestersExecutor()
tester_executor.config = cfg
tester_executor.executeTests()
tester_executor.executeTests(exclude_module_paths=exclude_module_paths)


if __name__ == "__main__":
Expand Down
8 changes: 6 additions & 2 deletions src/hiptestsuite/TestersExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TestersExecutor(ConfigProcessor):
def __init__(self):
ConfigProcessor.__init__(self)

def executeTests(self, tester_repository: TesterRepository=None):
def executeTests(self, tester_repository: TesterRepository=None, exclude_module_paths=None):
start_datetime = datetime.datetime.now()
config = self.config
log_location = config.log_location
Expand Down Expand Up @@ -76,7 +76,7 @@ def executeTests(self, tester_repository: TesterRepository=None):

test_selector: TestSelector = TestSelector(tester_repository=tester_repository)
test_selector.config = config
tests: List[Test] = test_selector.select_tests(log_location=timestamped_log_location)
tests: List[Test] = test_selector.select_tests(log_location=timestamped_log_location, exclude_module_paths=exclude_module_paths)
tests: List[Test] = sorted(tests, key=lambda x: x.test_name)
tests_status = dict()
tests_logs = dict()
Expand Down Expand Up @@ -240,6 +240,10 @@ def executeTests(self, tester_repository: TesterRepository=None):
with open(os.path.join(timestamped_log_location, 'report.json'), 'w+', encoding='utf-8') as f:
json.dump(json_root, f, ensure_ascii=False, indent=4)

print("")
print("Test Complete: Log file directory is " + relative_timestamped_log_location)



def get_os_name() -> str:
cmd = "awk -F= '/^NAME=/{print $2}' /etc/os-release"
Expand Down
Loading

0 comments on commit fce8823

Please sign in to comment.