|
25 | 25 | from __future__ import unicode_literals |
26 | 26 | import codecs |
27 | 27 | import os |
| 28 | +import platform |
| 29 | +import re |
28 | 30 | import textwrap |
29 | 31 | from copy import deepcopy |
30 | 32 |
|
@@ -1062,7 +1064,28 @@ def err_message(): |
1062 | 1064 | for test_grand_child in test_child.children: |
1063 | 1065 | exhale_grand_child = None |
1064 | 1066 | if test_grand_child.kind == "function": |
| 1067 | + # NOTE: First hit in macOS, possibly inbound with newer doxygen elsewhere. |
| 1068 | + # Matching child for [function] 'conversions::degrees_to_radians_s' with |
| 1069 | + # signature |
| 1070 | + # 'real(c_float) function conversions::degrees_to_radians_s(degrees_s)' |
| 1071 | + # not found! Considered signatures: |
| 1072 | + # real(c_double) function conversions::degrees_to_radians_d(real(c_double), intent(in)) |
| 1073 | + # real(c_float) function conversions::degrees_to_radians_s(real(c_float), intent(in)) |
| 1074 | + # real(c_double) function conversions::radians_to_degrees_d(real(c_double), intent(in)) |
| 1075 | + # real(c_float) function conversions::radians_to_degrees_s(real(c_float), intent(in)) |
| 1076 | + # |
| 1077 | + # ns::func(paramname) => ns::func(paramtype, param???) |
| 1078 | + # degrees_s real(c_float), intent(in) |
| 1079 | + # |
| 1080 | + # Coming from cpp_fortran_mixed conversions.f90, relates to docstring... |
1065 | 1081 | test_signature = test_grand_child.full_signature() |
| 1082 | + if platform.system() == "Darwin" and \ |
| 1083 | + test_grand_child.def_in_file.name == "conversions.f90": |
| 1084 | + test_signature = re.sub( |
| 1085 | + rf"(.*) (function ({test_grand_child.name}))\((.*)\)$", |
| 1086 | + r"\1 \2(\1, intent(in))", |
| 1087 | + test_signature |
| 1088 | + ) |
1066 | 1089 | considered_signatures = [] # for error reporting help in CI |
1067 | 1090 | for candidate in exhale_child.children: |
1068 | 1091 | if candidate.kind == "function": |
@@ -1308,6 +1331,29 @@ def set_error_string(s): |
1308 | 1331 |
|
1309 | 1332 | # Validate the return type, name, and signatures. |
1310 | 1333 | test_functions = set(f.full_signature() for f in test_overloads[key]) |
| 1334 | + # NOTE: see _compare_children notes on macOS and `degrees_s` above. |
| 1335 | + # AssertionError: Items in the first set but not the second: |
| 1336 | + # 'real(c_float) function conversions::degrees_to_radians_s(degrees_s)' |
| 1337 | + # Items in the second set but not the first: |
| 1338 | + # 'real(c_float) function conversions::degrees_to_radians_s(real(c_float), intent(in))' |
| 1339 | + # function degrees_to_radians_s(degrees_s) result(radians_s) |
| 1340 | + # function radians_to_degrees_s(radians_s) result(degrees_s) |
| 1341 | + # function degrees_to_radians_d(degrees_d) result(radians_d) |
| 1342 | + # function radians_to_degrees_d(radians_d) result(degrees_d) |
| 1343 | + if platform.system() == "Darwin" and any(re.match( |
| 1344 | + r"^real\(c_.*\) function conversions::.*_to_.*\(.*_[sd]\)$", f) |
| 1345 | + for f in test_functions): |
| 1346 | + fixed_test_functions = [] |
| 1347 | + for signature in test_functions: |
| 1348 | + func_name = re.sub( |
| 1349 | + r"real\(c_.*\) function (.*)\(.*", r"\1", signature |
| 1350 | + ) |
| 1351 | + fixed_test_functions.append(re.sub( |
| 1352 | + rf"(.*) (function ({func_name}))\((.*)\)$", |
| 1353 | + r"\1 \2(\1, intent(in))", |
| 1354 | + signature |
| 1355 | + )) |
| 1356 | + test_functions = set(fixed_test_functions) |
1311 | 1357 | # TODO: fix template specials |
1312 | 1358 | if test_functions == {"template <> int blargh(int)"}: |
1313 | 1359 | test_functions = {"int blargh(int)"} |
|
0 commit comments