feat(cth-suite): use cheaper heuristic for schema modules
This commit is contained in:
parent
8f2a4f7b19
commit
24dfa41722
|
@ -470,9 +470,12 @@ clean_suite_state() ->
|
||||||
|
|
||||||
app_schema(App) ->
|
app_schema(App) ->
|
||||||
Mod = list_to_atom(atom_to_list(App) ++ "_schema"),
|
Mod = list_to_atom(atom_to_list(App) ++ "_schema"),
|
||||||
try is_list(Mod:roots()) of
|
try
|
||||||
true -> {ok, Mod};
|
Exports = Mod:module_info(exports),
|
||||||
false -> {error, schema_no_roots}
|
case lists:member({roots, 0}, Exports) of
|
||||||
|
true -> {ok, Mod};
|
||||||
|
false -> {error, schema_no_roots}
|
||||||
|
end
|
||||||
catch
|
catch
|
||||||
error:undef ->
|
error:undef ->
|
||||||
{error, schema_not_found}
|
{error, schema_not_found}
|
||||||
|
|
Loading…
Reference in New Issue