From 4ce826b24422d7296800c48ebc023875f8997252 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 23 Mar 2023 13:11:59 -0700 Subject: [PATCH] tests: Check if ARM/gem5.opt not built in test_hdf5.py This test was failing to load as ARM/gem5.opt is not built when this test is pased during the Weekly tests. This bug is highlighed here: https://gem5.atlassian.net/browse/GEM5-1073. Comments have been added explaining this issue and the test not fails more quitely. It, however, is not run. Change-Id: I1f26f541a15438f6124a7541c01d44f70647762a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69239 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- tests/gem5/stats/test_hdf5.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/gem5/stats/test_hdf5.py b/tests/gem5/stats/test_hdf5.py index 993534a61d..8775d22ad8 100644 --- a/tests/gem5/stats/test_hdf5.py +++ b/tests/gem5/stats/test_hdf5.py @@ -39,6 +39,12 @@ Test file for the hdf5 stats. It just runs an SE simulation with the hdf5 stats and checks that the simulation succeeds and the stats file exists. No specific checks on the stats are performed. + +**Important Note**: This test has a major design flaw, noted here: +https://gem5.atlassian.net/browse/GEM5-1073. +It will not run if the build/ARM/gem5.opt has not been built. As this is not +built prior to this test being processed during the Weekly run, this test is +not run. """ import re import os @@ -54,6 +60,12 @@ def have_hdf5(): have_hdf5_file = os.path.join( config.base_dir, "build", constants.arm_tag, "config", "have_hdf5.hh" ) + if not os.path.exists(have_hdf5_file): + # This will most likely happen if the file has yet to have been + # compiled. It should be noted that this case is likely. This is not + # a good test as checking if hdf5 is available requires compilation + # which is not assumed to be true at this stage in the test. + return False with open(have_hdf5_file) as f: content = f.read()