Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/test-symbol-check.py
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | def test_ELF(self): | ||||
1, | 1, | ||||
executable | executable | ||||
+ ": NEEDED library libutil.so.1 is not allowed\n" | + ": NEEDED library libutil.so.1 is not allowed\n" | ||||
+ executable | + executable | ||||
+ ": failed LIBRARY_DEPENDENCIES", | + ": failed LIBRARY_DEPENDENCIES", | ||||
), | ), | ||||
) | ) | ||||
# finally, check a conforming file that simply uses a math function | # finally, check a simple conforming binary | ||||
source = "test3.c" | source = "test3.c" | ||||
executable = "test3" | executable = "test3" | ||||
with open(source, "w", encoding="utf8") as f: | with open(source, "w", encoding="utf8") as f: | ||||
f.write(""" | f.write(""" | ||||
#include <math.h> | #include <stdio.h> | ||||
int main() | int main() | ||||
{ | { | ||||
return (int)pow(2.0, 4.0); | printf("42"); | ||||
return 0; | |||||
} | } | ||||
""") | """) | ||||
self.assertEqual(call_symbol_check(cc, source, executable, ["-lm"]), (0, "")) | self.assertEqual(call_symbol_check(cc, source, executable, []), (0, "")) | ||||
def test_MACHO(self): | def test_MACHO(self): | ||||
source = "test1.c" | source = "test1.c" | ||||
executable = "test1" | executable = "test1" | ||||
cc = determine_wellknown_cmd("CC", "clang") | cc = determine_wellknown_cmd("CC", "clang") | ||||
with open(source, "w", encoding="utf8") as f: | with open(source, "w", encoding="utf8") as f: | ||||
f.write(""" | f.write(""" | ||||
▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines |