mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 05:46:03 +00:00
test(proot): address benchmark review findings
This commit is contained in:
1 parent
ac8d97e098
commit
2c3c135b52
9 files changed
+44
-10
No files matched your search
@@ -14,11 +14,22 @@ class FastPathSvcEncodingTest(unittest.TestCase):
|
||||
self.skipTest("cc is not available")
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
program = Path(directory) / "check.c"
|
||||
program.write_text(source.replace('"HEADER"', '"' + HEADER.with_name(header).as_posix() + '"'))
|
||||
program.write_text(source.replace('"HEADER"', '"' + (HEADER.parent / header).as_posix() + '"'))
|
||||
output = Path(directory) / "check"
|
||||
subprocess.run(["cc", "-O2", "-Wall", "-Wextra", "-Werror", str(program), "-o", str(output)], check=True)
|
||||
subprocess.run([str(output)], check=True, timeout=10)
|
||||
|
||||
def test_benchmark_checks_execute_with_ndebug(self):
|
||||
self.compile_check(r'''
|
||||
#define NDEBUG
|
||||
#include "HEADER"
|
||||
int main(void) {
|
||||
int calls = 0;
|
||||
assert(++calls == 1);
|
||||
return calls != 1;
|
||||
}
|
||||
''', "../bench/checks.h")
|
||||
|
||||
def test_stack_bounds_and_alternate_stack_fallback(self):
|
||||
self.compile_check(r'''
|
||||
#define _GNU_SOURCE
|
||||
|
||||
Reference in new issue
Block a user