From: Ciro Santilli Date: Wed, 11 Mar 2020 12:42:45 +0000 (+0000) Subject: tests: fix the memcheck test X-Git-Tag: v20.0.0.0~106 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e1117f2ba842009fb596680ac91b888491c7a9c;p=gem5.git tests: fix the memcheck test The file was raising due to the undefined constant `verifiers`, leading the test to be ignored. ./main.py list -v would show this as: ``` Traceback (most recent call last): File "/gem5/tests/../ext/testlib/loader.py", line 239, in load_file execfile(path, newdict, newdict) File "/gem5/tests/gem5/memcheck/test_memcheck.py", line 32, in verifiers=verifiers, NameError: name 'verifiers' is not defined Exception thrown while loading "/gem5/tests/gem5/memcheck/test_memcheck.py" Ignoring all tests in this file. ``` The test has been modified to have an empty verifiers list, which should still catch bugs since src/mem/mem_checker.cc has several asserts already which would be caught by the test system due to the exit status. Also make the following changes to the test: - move it to tests/gem5/memory/test.py with other memory tests. This makes it easier to see all the tests in the source in one go, and might make it easier to factor certain memory things out later on. - reduce --maxtick to a value that finishes in 7 seconds on a Lenovo ThinkPad P51. The previous value would take 50x longer, which feels too long for a single test. - enable --prefetchers to also stress a prefetcher in the test Change-Id: I58bd598b1142f349d25fa4fa4a8e41529e61a9ee Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26807 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/tests/gem5/memcheck/test_memcheck.py b/tests/gem5/memcheck/test_memcheck.py deleted file mode 100644 index 9709dd507..000000000 --- a/tests/gem5/memcheck/test_memcheck.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2020 The Regents of the University of California -# All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer; -# redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution; -# neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -from testlib import * - -gem5_verify_config( - name='test-memcheck', - fixtures=(), - verifiers=verifiers, - config=joinpath(config.base_dir, 'configs', 'example','memcheck.py'), - config_args=['-m', '100000000000'], - valid_isas=('NULL',), - valid_hosts=constants.supported_hosts, -) diff --git a/tests/gem5/memory/test.py b/tests/gem5/memory/test.py index 95c2903ef..af3af5c64 100644 --- a/tests/gem5/memory/test.py +++ b/tests/gem5/memory/test.py @@ -65,3 +65,13 @@ gem5_verify_config( config_args = [], valid_isas=(constants.null_tag,), ) + +gem5_verify_config( + name='test-memcheck', + fixtures=(), + verifiers=(), + config=joinpath(config.base_dir, 'configs', 'example','memcheck.py'), + config_args=['--maxtick', '2000000000', '--prefetchers'], + valid_isas=('NULL',), + valid_hosts=constants.supported_hosts, +)