History log of /gem5/tests/tests.py
Revision Date Author Comments
# 13540:da30e62884ee 10-Jan-2019 Andrea Mondelli <andrea.mondelli@ucf.edu>

misc: updated shabang for python script

The default python on MacOS doesn’t have an alias to python2.
The official python version supported in gem5 is Python2.7.

This patch updates the shabang according to the version required in gem5.

Change-Id: I9533c0f7858b5b3cab0ef101be1ee5cd718105b0
Reviewed-on: https://gem5-review.googlesource.com/c/15375
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>


# 12575:16ada03839d9 09-Mar-2018 Giacomo Travaglini <giacomo.travaglini@arm.com>

tests: Python regression scripts using new print function

Change-Id: I92060da4537e4ff1c0ff665f2f6ffc3850c50e88
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8892
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>


# 11976:d1f151ee0e08 21-Apr-2017 Andreas Sandberg <andreas.sandberg@arm.com>

tests: Remove unused options from tests.py

The test sub-command in tests.py incorrectly accepts various
formatting options in its usage string. These options aren't needed
since the test command doesn't produce any output.

Change-Id: I6d4731aa32a25a2286aa66548eaa0154a9392f79
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2840
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>


# 11917:6b5cded90c35 01-Sep-2016 Nikos Nikoleris <nikos.nikoleris@arm.com>

tests: Warn not fail when reading invalid pickle status files

With this change, the test script will output a warning when it reads
an incomplete (e.g., when a regression is still running) or corrupt
status file instead of throwing an exception. When the scipt is used
to show the results the corrupt file is skipped; when it is used to
test if all regressions run successfully it will return an error value
(2).

Change-Id: Ie7d9b457b200e3abc7ae6238e3efbf3d18cf4297
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2320
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>


# 11836:3195e72010da 14-Feb-2017 Curtis Dunham <Curtis.Dunham@arm.com>

tests: check for gem5 binary before tests

Provides a helpful error when tests.py is invoked without the gem5 binary.

Before:
Running 0 tests

After:
gem5 binary 'quick/...' not an executable file

Change-Id: I1566802206c9e21ca89bd03e91db22844168a085
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>


# 11828:36b064696175 10-Feb-2017 Jason Lowe-Power <jason@lowepower.com>

misc: Update #!env calls for python to explicit version

In some newer Linux distributions, env python default to Python 3.0. This
patch explicitly uses "python2" instead of just "python" for all scripts
that use #!

Reported-by: Sanchayan Maity <maitysanchayan@gmail.com>
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>


# 11543:b5435e0310c7 20-Jun-2016 Andreas Sandberg <andreas.sandberg@arm.com>

tests: Add a test command to get test status as an exit code

Add a "test" command to tests.py that queries a test pickle file and
returns different exit codes depending on the outcome of the tests in
the file. The following exit codes can currently be returned:

* 0: All tests were successful or skipped.

* 1: General fault in the script such as incorrect parameters or
failing to parse a pickle file.

* 2: At least one test failed to run. This is what the summary
formatter usually shows as a 'FAILED'.

* 3: All tests ran correctly, but at least one failed to verify
its output. When displaying test output using the summary
formatter, such a test would show up as 'CHANGED'.

The command can be invoked like this:

./tests/tests.py test `find build/ARM/tests/opt/ -name status.pickle`

Change-Id: I7e6bc661516f38ff08dfda7c4359a1e10bf97864
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>


# 11482:2ca1efb451e4 26-May-2016 Andreas Sandberg <andreas.sandberg@arm.com>

tests: Add test infrastructure as a Python module

Implement gem5's test infrastructure as a Python module and a run
script that can be used without scons. The new implementation has
several features that were lacking from the previous test
infrastructure such as support for multiple output formats, automatic
runtime tracking, and better support for being run in a cluster
environment.

Tests consist of one or more steps (TestUnit). Units are run in two
stages, the first a run stage and then a verify stage. Units in the
verify stage are automatically skipped if any unit run stage wasn't
run. The library currently contains TestUnit implementations that run
gem5, diff stat files, and diff output files.

Existing tests are implemented by the ClassicTest class and "just
work". New tests can that don't rely on the old "run gem5 once and
diff output" strategy can be implemented by subclassing the Test base
class or ClassicTest.

Test results can be output in multiple formats. The module currently
supports JUnit, text (short and verbose), and Python's pickle
format. JUnit output allows CI systems to automatically get more
information about test failures. The pickled output contains all state
necessary to reconstruct a tests results object and is mainly intended
for the build system and CI systems.

Since many JUnit parsers parsers assume that test suite names look
like Java package names. We currently output path-like names with
slashes separating components. Test names are translated according to
these rules:

* '.' -> '-"
* '/' -> '.'

The test tool, tests.py, supports the following features:

* Test listing. Example: ./tests.py list arm/quick

* Running tests. Example:
./tests.py run -o output.pickle --format pickle \
../build/ARM/gem5.opt \
quick/se/00.hello/arm/linux/simple-timing

* Displaying pickled results. Example:
./tests.py show --format summary *.pickle

Change-Id: I527164bd791237aacfc65e7d7c0b67b695c5d17c
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Joel Hestness <jthestness@gmail.com>