pinard/Pymacs

make check fails under Windows

Opened this issue · 1 comments

The command make check fails under Windows, due to the DOS-style line endings. For example, the first error received is:

Summary: one FAILED test, 166 good in 0.25 seconds.
Traceback (most recent call last):
  File "pytest", line 513, in <module>
    main(*sys.argv[1:])
  File "pytest", line 174, in main
    self.handle_module(file_name, module)
  File "pytest", line 323, in handle_module
    generator, None)
  File "pytest", line 356, in handle_function
    arguments[0], arguments[1:], instance)
  File "pytest", line 369, in launch_test
    self.delayed_setup_module[0](self.delayed_setup_module[1])
  File ".\t21_helper_works.py", line 10, in setup_module
    setup.start_python()
  File ".\setup.py", line 205, in start_python
    Python.services = Python()
  File ".\setup.py", line 141, in __init__
    assert text == '(version "0.25")\n', repr(text)
AssertionError: '(version "0.25")\r'
PProtocol error: `>' expected.
rotocol error: `>' expected.    

In this particular case, setup.py.in can be changed on Line 140 and Line 141 from:

text = self.receive()
assert text == '(version "@VERSION@")\n', repr(text)

to

text = self.receive().rstrip()
assert text == '(version "@VERSION@")', repr(text)

since the line termination characters are not relevant for these checks. This change will at least enable the further downstream tests to run, since many of them also fail to run under Windows.

Hello, Titus.

It would be fun adapting "make check" so it also works under Windows, and not only under Linux. I'm not sure about the best way to proceed. I very rarely (that is, almost never) use Windows myself, so I'm not in a good position to make it work. I'd rather rely on testers or contributors for this.

On the other hand, I'm not sure rstripping is the best avenue, as it effectively weakens the tests even on the Linux side. Maybe replacing '\r\n' by '\n' at appropriate places would do a better job, and even then, I'm not sure it is a good idea to do it too blindly. Python3 might be a blessing or a curse, I do not know. It surely adds its own bits of complexity, but it also forces us to clarify where we are handling text and where we are handling bytes.

Pymacs is far from having an extensive testing suite, and for the few tests it has, it would be better to not spoil them, and staying a bit strict. At least, this is how I feel this evening! :-) Any other opinion or suggestion?

François