Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add posix tests (waiting for lsb_vsx port merge) #126

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

adamdebek
Copy link
Contributor

Description

Add program to execute posix test suite

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx_posix/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx_posix/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx_posix/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx_posix/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx_posix/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx_posix/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx_posix/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx_posix/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx_posix/lsb_vsx_posix.c Outdated Show resolved Hide resolved
lsb_vsx_posix/lsb_vsx_posix.c Outdated Show resolved Hide resolved
@damianloew damianloew changed the title Add posix tests Add posix tests (waiting for lsb_vsx port merge) Nov 25, 2022
@adamdebek adamdebek force-pushed the adamdebek/lsb_vsx_tests branch 5 times, most recently from db28779 to 914851e Compare July 13, 2023 12:50
Copy link
Member

@mateusz-bloch mateusz-bloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just took a look at the Python code, not a full review.

test_name = []
test_status = Status.OK

NAME = r'(.+?)Execute(.+?)T\.(?P<name>.+?)\r+\n'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use one type of quotation mark in strings.
We mostly use black to format python code, which defaults to double quotation marks for strings. Basic use of tool is black -l 120 file_to_format.py

Suggested change
NAME = r'(.+?)Execute(.+?)T\.(?P<name>.+?)\r+\n'
NAME = r"(.+?)Execute(.+?)T\.(?P<name>.+?)\r+\n"

Comment on lines +39 to +40
if (line.find("IC") != -1 or line.find("TP") != -1 or line.find("TC") != -1 or line.find("Execute") != -1):
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be simplified.
Maybe something like this:

Suggested change
if (line.find("IC") != -1 or line.find("TP") != -1 or line.find("TC") != -1 or line.find("Execute") != -1):
continue
if any(keyword in line for keyword in ["IC", "TP", "TC", "Execute"]):
continue

Also parentheses are not necessary with if

Suggested change
if (line.find("IC") != -1 or line.find("TP") != -1 or line.find("TC") != -1 or line.find("Execute") != -1):
continue
if line.find("IC") != -1 or line.find("TP") != -1 or line.find("TC") != -1 or line.find("Execute") != -1:
continue

Comment on lines +48 to +49
result = Result(name=test_name, status=Status.FAIL)
result.status = Status.FAIL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why repeat code?

Suggested change
result = Result(name=test_name, status=Status.FAIL)
result.status = Status.FAIL
result = Result(name=test_name, status=Status.FAIL)

result = Result(name=test_name, status=Status.FAIL)
result.status = Status.FAIL

if (line.find("can't acquire exclusive lock") != -1):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be simplified
For example:

Suggested change
if (line.find("can't acquire exclusive lock") != -1):
if "can't acquire exclusive lock" in line:


if (line.find("can't acquire exclusive lock") != -1):
result.msg = '\t\t' + "can't acquire exclusive lock\n"
elif (line.find("can't exec") != -1):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elif (line.find("can't exec") != -1):
elif "can't exec" in line:

lsb_vsx_posix/lsb_vsx_posix.py Show resolved Hide resolved
- name: T.tmpfile
execute: lsb_vsx_posix T.tmpfile
- name: T.tmpnam
ignore: True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you know reasons for ignoring the test or if it is connected to the reported issue on github, you can leave a comment to provide information about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants