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

Tests: echo -n is not portable #670

Closed
mtelka opened this issue May 12, 2023 · 3 comments
Closed

Tests: echo -n is not portable #670

mtelka opened this issue May 12, 2023 · 3 comments

Comments

@mtelka
Copy link
Contributor

mtelka commented May 12, 2023

Some tests expects the echo command to support -n option. This is usually the case, but not always. Actually, the -n option for echo is not portable. Because of this some tests fails with errors like:

FAIL: test_no_interfere1 (tests.test.ExecutionContextTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "$(BUILD_DIR)/tests/test.py", line 3447, in test_no_interfere1
    self.assertEqual("TEST", out.getvalue())
AssertionError: 'TEST' != '-n TEST\n'
- TEST
+ -n TEST

Here is an example how various echo implementations works on OpenIndiana (and, AFAIK, on Solaris too):

$ /usr/bin/echo -n 123                             # Solaris/illumos echo
-n 123
$ /usr/ucb/echo -n 123                             # BSD echo
123$ /usr/gnu/bin/echo -n 123                      # GNU echo
123$

Yes, we do have three standalone echo implementations :-).

Documentation:

@mtelka
Copy link
Contributor Author

mtelka commented May 12, 2023

Here is a full list of tests with this failure:

FAIL: test_basic (tests.test.ExecutionContextTests)
FAIL: test_set_in_parent_function (tests.test.ExecutionContextTests)
FAIL: test_no_interfere1 (tests.test.ExecutionContextTests)
FAIL: test_stringio_output (tests.test.FunctionalTests)

@mtelka
Copy link
Contributor Author

mtelka commented Aug 7, 2023

Actually, this was fixed via 1f09994.

@amoffat
Copy link
Owner

amoffat commented Aug 7, 2023

Yes my mistake

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

No branches or pull requests

2 participants