adacore / e3-testsuite Goto Github PK
View Code? Open in Web Editor NEWe3 testsuite driver
License: GNU General Public License v3.0
e3 testsuite driver
License: GNU General Public License v3.0
Specifically, of typing.Protocol
in a couple of places:
e3-testsuite/src/e3/testsuite/fragment.py
Lines 40 to 42 in 7cbb936
e3-testsuite/src/e3/testsuite/report/display.py
Lines 78 to 80 in 7cbb936
There doesn't seem to be any specifically defined minimum Python version in this repo, but libadalang/langkit/e3-core do specify 3.7, so I guess this would inherit from that?
I'm facing an issue on GitHub Actions, when running e3-testsuite on windows. The issue concerns the rlimit tool from e3-core, I get the following message:
rlimit: cannot spawn process (error 0x5)
Looks like it's a known issue:
e3-testsuite/.github/workflows/ci.yaml
Lines 13 to 14 in a89b401
Is there something I should set in the GHA runner to make it work?
Thanks!
Dear e3-testsuite maintainer (😉),
Our main testsuite's driver is inheriting from the AdaCoreLegacyTestDriver and overrides its self.default_encoding with UTF-8
. This makes sense for our usecase, we do not deal with binary data but we do deal with UTF-8 characters, hence having properly rendered UTF-8 characters is better than having \x[0-F][0-F]
strings in our outputs.
Unfortunately, this does not work well on windows, some of our tests fail with the following backtrace:
Traceback (most recent call last):
File "C:\it\sbx\wave\x86_64-windows64\e3-for-testing\install\lib\site-packages\e3\testsuite\fragment.py", line 187, in run
self.return_value = self.data(self.previous_values, self.slot)
File "C:\it\sbx\wave\x86_64-windows64\e3-for-testing\install\lib\site-packages\e3\testsuite\driver\classic.py", line 478, in run_wrapper
self.set_up()
File "C:\it\sbx\wave\x86_64-windows64\e3-for-testing\install\lib\site-packages\e3\testsuite\driver\adacore.py", line 91, in set_up
self.argv = self.get_script_command_line()
File "C:\it\sbx\wave\x86_64-windows64\e3-for-testing\install\lib\site-packages\e3\testsuite\driver\adacore.py", line 170, in get_script_command_line
for line in f:
File "C:\it\sbx\wave\x86_64-windows64\e3-for-testing\install\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 193: character maps to <undefined>
This is because the test.sh contains UTF-8 characters, but the AdaCoreLegacyTestDriver opens test.sh files using the platform's default encoding.
The following patch seems to make things work again:
diff --git "a/C:\\it\\local\\e3\\lib\\site-packages\\e3\\testsuite\\driver\\adacore.py" b/tmp/driver.py
index 8625a50c9..af3e01642 100644
--- "a/C:\\it\\local\\e3\\lib\\site-packages\\e3\\testsuite\\driver\\adacore.py"
+++ b/tmp/driver.py
@@ -164,7 +164,7 @@ class AdaCoreLegacyTestDriver(DiffTestDriver):
new_script.append(". $TEST_SUPPORT_DIR/support.sh")
# Read all lines in the original test script
- with open(self.script_file) as f:
+ with open(self.script_file, encoding=self.default_encoding) as f:
# Get rid of potential whitespaces and CR at the end of
# each line.
for line in f:
@@ -177,10 +177,10 @@ class AdaCoreLegacyTestDriver(DiffTestDriver):
# Write the shell script and schedule its execution with "bash"
new_script_filename = self.working_dir("__test.sh")
- with open(new_script_filename, "w") as f:
+ with open(new_script_filename, "wb") as f:
for line in new_script:
- f.write(line)
- f.write("\n")
+ f.write(line.encode(self.default_encoding))
+ f.write(b"\n")
return ["bash", new_script_filename]
else: # os-specific
Since I'm not sure I have a complete understanding of the situation, I thought I'd open an issue instead of a PR, let me know if you need more information :)
In the following code:
e3-testsuite/src/e3/testsuite/driver/adacore.py
Lines 195 to 200 in f264352
The pattern substitute for the replacement of the path is buggy.
If the path is at the start of the line, it will replace some part of the previous line.
The issue comes from the first part of the regex:
rb"[^ '\"]*"
I suggest replacing this with:
rb"\S*"
Which takes care of whitespaces including the start of the line.
The text put in the <system-out>
node is already escaped for XML inclusion, but it needs to be stripped from control characters as well, such as �^[2J�^[H
which can be used to print coloured output in terminal. (Observed in the gnatfuzz testsuite)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.