aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-10-14[LNT] Fix execfile Python 3 migrationHEADmasterThomas Preud'homme
Code change in revision r374687 introduced a memory leak because it opens a file for reading in order to execute its content but does not close it. This commit fixes the leak by putting the read and exec into open's context block. git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@374824 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-12[LNT] Python 3 support: adapt to removal of execfileThomas Preud'homme
Replace calls to execfile by calling exec on the result of calling compile on the result of calling open().read(). Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67822 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@374687 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-12[LNT] NFC: Fix order of globals and locals on execHubert Tong
Summary: Per https://docs.python.org/3/library/functions.html#exec, the globals parameter comes before the locals one. Since `globals` and `locals` refer to the same object for the call in question, we can remove `locals`, which will cause the globals parameter to be used for both the global and the local variables, thus keeping the same behavior. Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: thopre Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68903 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@374685 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-10[LNT] Python 3 support: stable showtests outputThomas Preud'homme
lnt showtests output depends on the iteration order of a set, which has no guarantee whatsoever. This makes the result of test tests/lnttool/showtests.shtest unstable in particular accross Python 2 and 3. This commit makes the lnt.tests constructor return a new sorted list instead of the set, thus guaranteeing a stable output of lnt showtests. It also lists tests in alphabetical order which makes it nicer for users. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: cmatthews Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68220 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@374305 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-10[LNT] Python 3 support: fix report version literalThomas Preud'homme
The upgrade_1_to_2 module stores a __report_version__ string literal in the Parameter column of the Run table which is declared as binary data. This does not work in Python 3 where strings/text and binary are different things. This commit changes it for a binary literal instead (introduced in Python 2.6). Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68105 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@374304 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-10[LNT] Python 3 support: adapt secret computationThomas Preud'homme
Computation of the secret when it is not supplied on the command line involves passing a string constructed with str to the sha1 function. However that function expects binary data which is a different type in Python3. This commit uses the bytes constructor as an additional step to convert from text to binary data. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68104 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@374303 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-10[LNT] Python 3 support: remove useless var-setting getterThomas Preud'homme
Both the ComparisonResult constructor and the stddev_mean getter set the readonly stddev_mean. While Python 2 accepts it, Python 3 throws errors (cannot set attribute and infinite recursion respectively). Since that attribute does not appear to be used anywhere, this commit removes all this code. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67882 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@374302 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-06[LNT] Python 3 support: fix text/binary confusion in importreportThomas Preud'homme
lnt importreport currently fails in Python 3 because it opens the input and output file in binary mode. Yet, as per documentation, this tools converts "*text based* key value pairs into a LNT json report file". The JSON file is output using the json module which expects a file opened in text mode so this commit changes the mode of both the input and output file to text. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68224 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373861 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-06[LNT] Python 3 support: stable profile getFunctions outputThomas Preud'homme
lnt profile getFunctions output depends on the iteration order of a dictionary, which is an implementation detail up to Python 3.6 (included). The test tests/lnttool/Profile.py is thus unstable accross architectures and Python versions. This commit adds a --sortkeys option to the getFunctions command to sort the keys in the dictionary when dumping it into json, thus allowing stable results of tests/lnttool/Profile.py by using this option. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68221 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373860 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-06[LNT] Python 3 support: update dependenciesThomas Preud'homme
Update dependencies to fix 2 python 3 related issues: - progressbar does not support Python 3 (use progressbar2 instead) - PyYAML 3.12 fails to install with Python 3.7 (issue #126, use PyYAML 3.13 instead) Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68126 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373859 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03[LNT] Python 3 support: fix text/binary confusion in profile supportThomas Preud'homme
There is confusion between text and binary in the checkFile method of the various profile format implementation modules. All of them compare the first few bytes read in text mode against an expected value. However, the header of the profile v1 contains some binary data, thus causing an error in Python 3 when reading a profile v1 file and calling any of the checkFile method. This commit changes the checkFile method to read binary data and compare against binary literals. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68222 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373617 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03[LNT] Python 3 support: fix convert to JSONThomas Preud'homme
Plistlib and json modules have conflicting requirements for their dump methods: Plistlib expects its file handle to be a writable binary file object while json expects it to be a writable text file object. This commit solves this issue by dumping the JSON into a temporary string which is encoded to UTF-8 (JSON format RFC 7159 requires UTF-8, UTF-16 or UTF-32 encoding and UTF-8 is the recommended default) before being output. This allows to keep delegating file opening to Click and avoid a refactoring to abstract the opening mode between supported formats. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68223 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373615 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03[LNT] NFC: Remove comment made outdated by rL373218Hubert Tong
git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373608 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30[LNT] Python 3 support: encode LNT report format in UTF-8Thomas Preud'homme
Summary: Change encoding of LNT report format to be a UTF-8 JSON file since that is the only encoding the json module can produce in Python 3. While this is an incompatible change of the output, the existing import of LNT report format already expects UTF-8 JSON. Therefore this fixes an import issue for format produced from there and does not change anything for already produced format which could not be imported and still cannot be imported. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68225 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373218 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-28[LNT] Remove dead codeThomas Preud'homme
Summary: Remove 2 blocks of dead code in LNT: - safediv() method which is not used anywhere - setting of derive_stat attribute of a MatrixDataRequest which is not used by anything. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68097 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373153 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-28[LNT] Python 3 support: get rid of calls to cmp builtinThomas Preud'homme
Get rid of calls to cmp builtins since it was removed in Python 3: - for the tests, the assignment to sortTestMethodsUsing is removed altogether since the default is the built-in ordering for strings; - for the call in the TestsuiteDB.Order class, we define the rich comparison methods that have replaced cmp; - for the stats module, we use equality expressions since only the equality value is needed. Note that one of the uses of cmp in the stats module is dead but removal of the dead code is kept for future work to keep a separation of concern between commits. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: mehdi_amini, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D67820 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373141 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27[LNT] Sort machines by ID as expected by test caseHubert Tong
Summary: `tests/lnttool/admin.shtest` fails in some environments because it expects the `list-machines` output in a certain order. Assuming ascending order, the matching sort would be the one based on the id. In particular, "localhost" follows "LNT" in both ASCII `strcmp` and also with case-insensitive sorting, and the test expects "localhost" first. I'm open to doing the sorting on the client side, but this patch sorts on the server side mainly to demonstrate that the expectation of the test was unwarranted given the state of the code. Sorting on the server side also benefits all clients, as opposed to just the ones that are part of this package. Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: cmatthews Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67884 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373129 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27Make the short version of --cmake-define -DChris Matthews
Because that is what it is in cmake as well. I think -D is a little easier to remember if you use cmake already. -C already matches. git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373111 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25[LNT][docs] Fix some typos.Volodymyr Sapsai
git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372922 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25[LNT] Python 3 support: adapt to zip returning an iteratorThomas Preud'homme
Summary: zip() returns a list in Python 2 but an iterator in Python 3. Fortunately, the only use is in the return statement in pairs() and the only call site of pairs() iterates over the result. This commit thus adds a docstrings for pairs to make it clear callers can only rely on the result being iterable. It also rename the parameter to not conflict with the list builtin function. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67819 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372826 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25[LNT] Python 3 support: adapt to renaming of raw_input to inputThomas Preud'homme
Summary: Replace calls to raw_input by calls to input() which is not evaluated as an expression in Python3. Import input from builtins to maintain current behavior on Python2. This was produced by running futurize's stage2 lib2to3.fixes.fix_raw_input. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67818 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372823 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25[LNT] Simplify population of alldata in lF_onewayThomas Preud'homme
Summary: Use a simpler iteration to populate alldata list in lF_oneway. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67959 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372822 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25[LNT] Python 3 support: adapt to map returning an iteratorThomas Preud'homme
Adapt calls to map() to the fact it returns an iterator in Python 3 when necessary. This was produced by running futurize's stage2 lib2to3.fixes.fix_map, with manual clean up to remove unecessary list wrapping and simplify the code. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67817 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372821 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25[LNT] Python 3 support: use int() instead of long()Thomas Preud'homme
Use int() rather than long() to interpret a string as a long integer since Python 3's integer are long by default. This was produced by running futurize's stage2 lib2to3.fixes.fix_long. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67816 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372820 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25[LNT] Python 3 support: adapt to filter returning an iteratorThomas Preud'homme
Adapt calls to filter() to the fact it returns an iterator in Python 3. This was produced by running futurize's stage2 lib2to3.fixes.fix_filter. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67815 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372819 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25[LNT] rename object variablesThomas Preud'homme
Rename variables named object to obj to avoid confusion with the object type. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67967 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372818 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25[LNT] Python 3 support: adapt to dict method returning viewsThomas Preud'homme
Adapt calls to dictionary's keys(), items() and values() to them returning a view in Python 3 when necessary, undoing unneeded changes in lnt/testing/__init__.py. Also replace calls to their iter relatives to use iter() instead and calls to the their views relatives to use the plains .keys(), .items() and .values(). This was produced by running futurize's stage2 lib2to3.fixes.fix_dict with manual intervention to clean up code and remove unnecessary list() wrapping. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67814 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372816 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-23[LNT] Python 3 support: print using print functionThomas Preud'homme
Use print function from future's print_function instead of a print statement since the latter does not exist in Python 3. This was produced by running futurize's stage1 libfuturize.fixes.fix_print_with_import. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67813 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372553 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-23[LNT] Python 3 support: Get next element with next builtinThomas Preud'homme
Use next() builtin rather than the .next() method to retrieve the next element of an iterator since the latter does not exist in Python 3. next() builtin was introduced in Python 2.6. This was produced by running futurize's stage1 libfuturize.fixes.fix_next_call. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67812 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372552 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-23[LNT] Python 3 support: Use absolute import by defaultThomas Preud'homme
Forces module import to be absolute by default on Python 2 since this is the default for Python 3. Adapts relative imports to use the relative import symtax 'from . import foo' or 'from .pkg import foo'. Also remove unnecessary circular import dependency between testsuite and testsuitedb by moving functions used by testsuite but currently in testsuitedb into module testsuite. Finally adds type hints into lnt.formats to avoid warnings from mypy due to change to relative import syntax. Changes to adapt syntax of relative import was produced by running futurize's stage1 libfuturize.fixes.fix_absolute_import, while breaking of circular dependency was done manually. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67811 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372551 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-21[LNT] Python 3 support: import reduce from functoolsThomas Preud'homme
Import reduce from functools since it was removed as a builtin in Python 3. reduce was added to functools in Python 2.6. This was produced by running futurize's stage1 lib2to3.fixes.fix_reduce. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67810 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372477 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-21[LNT] Python 3 support: use Python 3 idiomsThomas Preud'homme
Replace Python 2 idioms for their Python 3 counterparts. These includes: - replace calls to X.sort() optionally followed by .reverse() by calls to sorted(X) - replace while 1 by while True This was produced by running futurize's stage1 lib2to3.fixes.fix_idioms. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67809 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372476 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-21[LNT] Python 3 support: Fix exec syntaxThomas Preud'homme
Replace python2-specific exec statements with calls to exec builtins. This was produced by running futurize's stage1 lib2to3.fixes.fix_exec. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67808 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372474 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-21[LNT] Python 3 support: Fix except with named exceptionThomas Preud'homme
Use Python 3 syntax for except statement with named exception. This was produced by running futurize's stage1 lib2to3.fixes.fix_except. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67807 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372472 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-21[LNT] Python 3 support: get rid of apply builtin functionThomas Preud'homme
Replace calls to deprecated python2-specific apply builtin by direct function calls with explicit argument list unpacking. This was produced by running futurize's stage1 lib2to3.fixes.fix_apply. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67806 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372471 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-20[LNT] Python 3 support: Fix implicit package-relative importsHubert Tong
Summary: This patch replaces implicit package-relative imports with explicitly relative imports and makes further adjustments necessary to correct for circular import issues encountered when running with Python 2.7 following the initial changes. Finally, `from __future__ import absolute_import` is added to all of the files changed as part of this exercise. These changes help with running tests (without result submission) with Python 3. Reviewers: cmatthews, thopre, kristof.beyls, MaskRay Reviewed By: MaskRay Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67795 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372404 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-19[LNT] Add docker containerization filesThomas Preud'homme
LNT already strive to be easy to use both locally and in server mode. This patch adds containerization files in a new docker/ directory (which can later be renamed container/docker if more container gets supported). Creating the image becomes as easy as docker-compose build and running it is done via docker-compose up. The service described in docker-compose.yml uses postgres but the LNT image is controlled via DB_ variables and thus should work with any database engine. Note: I'm quite new to Docker so some reviews on Docker best practice would be much welcome. Reviewers: MatzeB, danilaml, kristof.beyls, cmatthews Reviewed By: cmatthews Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D65794 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372354 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-19[LNT] Add support for v2 fmt in test data libraryThomas Preud'homme
Add support for generating LNT JSON report file format in version 2 in the test data creation library. All unit tests introduced in earlier patch for existing code pass with this new code. Reviewers: MatzeB, danilaml, kristof.beyls, cmatthews Reviewed By: cmatthews Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D65751 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372322 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16[LNT] Python 3 support: Remove implicit tuple parameter unpacking on lambdasHubert Tong
Summary: Lambda changes split out and updated from D67535. Applies the `2to3 -f tuple_params` fixes, tweaks the variable naming, and updates the affected tuples to be named tuples. Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: thopre Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67582 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@371947 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-15[LNT] Python 3 support: Replace `raise E, V` with `raise E(V)`Hubert Tong
Summary: Mechanically changed `raise E, V` to `raise E(V)`. Split out from D67535. This patch covers the files found to be affected when running tests (without result submission). Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: thopre Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67581 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@371946 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-15[LNT] Python 3 support: Update `<>` and `None` comparisonsHubert Tong
Summary: Replaces comparisons using `!=`, `<>`, and `==` against `None` with the corresponding version of `is not None` and `is None`. Replaces `<>` with `!=`. As requested by reviewers, add spaces around operators on lines touched. Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: thopre Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67535 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@371945 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-15Subject: [LNT] Python 3 support: Update type comparisons and type namesHubert Tong
Summary: This patch is split out from D67535, updating type names (or, in one case, `type(1.4)`-style goodness) and updating type comparisons with use of `isinstance`. Additionally, changed a dictionary key lookup for a type mapping. As requested by reviewers in D67535, spaces are added after commas in what are now tuples of types. Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: thopre Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67587 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@371944 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-15[LNT] Python 3 support: Set up (client) setup requirementsHubert Tong
Summary: Changes required to allow setup of a LNT client with Python 3. - Use `PyModule_Create` instead of `Py_InitModule` - Drop `argparse` and `wsgiref` install requirements - Require Python 2.7 or higher in `setup.py`; Python 2.7 is needed for some Python 3 support idioms Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: cmatthews Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67533 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@371943 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13[LNT] Python 3 support: Minor automatic 2to3 fixupsHubert Tong
Summary: Automatic fixups done using `2to3`: - `2to3 -f numliterals` - `2to3 -f dict` - `2to3 -f map` - `2to3 -f exec` The `exec` call is additionally updated to have a string argument as noted by @thopre. The changes cover the files found to be affected when running tests (without result submission). Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: cmatthews Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67534 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@371896 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13[LNT] Python 3 support: print statementsHubert Tong
Summary: This patch applies `2to3 -f print` fixes, corrects the indentation mangled by `2to3` for multiline print statements, and adds `from __future__ import print_function` to each file that was modified. As requested on review, spaces are then added after commas separating arguments to `print`, separating function call arguments or tuple elements within arguments to `print`, etc. The changes cover the files found to be affected when running tests (without result submission). Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: cmatthews Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67532 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@371891 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13[LNT] Add unittests for test data creation libraryThomas Preud'homme
Add unit tests for existing code in the test data creation library ahead of a patch adding support for version 2 of the LNT JSON report file format to ensure no existing code is broken in the process. Differential Revision: https://reviews.llvm.org/D65747 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@368642 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05[LNT] Add missing method docstrings in lnt.testingThomas Preud'homme
Differential Revision: https://reviews.llvm.org/D65750 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@367924 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05[LNT] Wrap comments and docstrings at 72 charsThomas Preud'homme
As per PEP-008, wrap comments and docstrings in the test data creation library at 72 characters. Differential Revision: https://reviews.llvm.org/D65749 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@367923 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-05Fix runtest test-suite pgo + multisampling.Kristof Beyls
There were are at least 3 issues when combining --pgo with --exec-multisample: * Make clean was not called between a measurement run and the next profiling run. * Make all was only called on the first measurement run. * Cmake variable TEST_SUITE_PROFILE_USE=OFF was not set on the second and later profiling runs. These 3 issues are fixed by this patch. It is also questionable whether we need to run profile collection multiple times. With the instrumentation-based profile collection, the profiles should be deterministic between different runs, and hence there is no value in collecting profiles multiple times. However, if in the future there would also be support for collecting profiles e.g. based on performance counter sampling, the profiles might be non-deterministic in such a scenario and having multiple profiling runs could make a lot more sense. I'm leaving that discussion for another time. git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@365196 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-07in test_suite run_test function, opt and self.opt is same objectDanila Malyutin
Patch by Lily He Differential Revision: https://reviews.llvm.org/D61662 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@362787 91177308-0d34-0410-b5e6-96231b3b80d8