Skip to content

Commit

Permalink
chreo(Trace): Add more test mods
Browse files Browse the repository at this point in the history
Add more support artifacts for testing
  • Loading branch information
ckoch-cars committed Aug 20, 2022
1 parent 2da2e37 commit 93fe933
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 44 deletions.
2 changes: 1 addition & 1 deletion lib/ex_factor/traces.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule ExFactor.Traces do
def setup do
Code.compiler_options(parser_options: [columns: true])
Code.compiler_options(debug_info: true, parser_options: [columns: true, token_metadata: true])
ExFactor.Server = Code.ensure_loaded!(ExFactor.Server)
ExFactor.Tracer = Code.ensure_loaded!(ExFactor.Tracer)

Expand Down
12 changes: 12 additions & 0 deletions test/support/example_five.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,16 @@ defmodule ExFactor.Support.ExampleFive do

def callers(mod), do: Callers.callers(mod)
def all_funcs(input), do: all_functions(input)
def more_funcs(path), do: Parser.public_functions(path)

def another_func(path) do
IO.puts "A functions"
end

def a_third_func(path) do
path
|> IO.puts()
|> IO.inspect()
|> IO.puts
end
end
12 changes: 12 additions & 0 deletions test/support/example_seven.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
defmodule ExFactor.Support.ExampleSeven do
@moduledoc """
Support module for `ExFactor` testing.
"""

alias ExFactor.Parser
alias ExFactor.Callers
import Parser

def callers(mod), do: Callers.callers(mod)
def all_funcs(input), do: all_functions(input)
end
115 changes: 72 additions & 43 deletions test/support/trace.ex
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,9 @@ defmodule ExFactor.Support.Trace do
{:remote_function, 2, nil, Module, :__put_attribute__, 4}
],
{"lib/ex_factor/formatter.ex", ExFactor.Formatter} => [
{:remote_function, 12, 24, Mix.Tasks.Format, :run, 1},
{:remote_function, 14, 17, Code, :format_file!, 1},
{:remote_function, 16, 16, File, :write!, 3},
{:remote_function, 12, 12, Enum, :map, 2},
{:remote_function, 11, nil, :erlang, :"=:=", 2},
{:remote_function, 11, nil, :erlang, :"=:=", 2},
{:remote_function, 11, nil, :erlang, :orelse, 2},
Expand Down Expand Up @@ -563,30 +565,31 @@ defmodule ExFactor.Support.Trace do
{:remote_function, 2, nil, Module, :__put_attribute__, 4}
],
{"lib/ex_factor/remover.ex", ExFactor.Remover} => [
{:remote_function, 112, 12, String, :to_atom, 1},
{:remote_function, 111, 33, :erlang, :is_binary, 1},
{:imported_function, 111, 33, Kernel, :is_binary, 1},
{:remote_function, 109, 35, ExFactor, :path, 1},
{:remote_function, 98, 10, File, :write, 3},
{:remote_function, 69, nil, String.Chars, :to_string, 1},
{:remote_function, 69, nil, String.Chars, :to_string, 1},
{:remote_function, 62, nil, String.Chars, :to_string, 1},
{:remote_function, 62, nil, String.Chars, :to_string, 1},
{:remote_function, 56, 28, Module, :split, 1},
{:remote_function, 56, 57, Enum, :join, 2},
{:remote_function, 51, nil, String.Chars, :to_string, 1},
{:remote_function, 51, nil, String.Chars, :to_string, 1},
{:remote_function, 50, nil, ArgumentError, :exception, 1},
{:remote_function, 50, nil, :erlang, :error, 1},
{:remote_function, 49, nil, :erlang, :"=:=", 2},
{:remote_function, 49, nil, :erlang, :"=:=", 2},
{:remote_function, 49, nil, :erlang, :orelse, 2},
{:remote_function, 48, nil, String.Chars, :to_string, 1},
{:remote_function, 48, nil, Regex, :compile!, 2},
{:remote_function, 47, 13, File, :read!, 1},
{:remote_function, 48, 15, String, :match?, 2},
{:remote_function, 45, 57, :erlang, :is_binary, 1},
{:imported_function, 45, 57, Kernel, :is_binary, 1},
{:remote_function, 121, 12, String, :to_atom, 1},
{:remote_function, 120, 33, :erlang, :is_binary, 1},
{:imported_function, 120, 33, Kernel, :is_binary, 1},
{:remote_function, 118, 35, ExFactor, :path, 1},
{:remote_function, 107, 10, File, :write, 3},
{:remote_function, 78, nil, String.Chars, :to_string, 1},
{:remote_function, 78, nil, String.Chars, :to_string, 1},
{:remote_function, 71, nil, String.Chars, :to_string, 1},
{:remote_function, 71, nil, String.Chars, :to_string, 1},
{:remote_function, 65, 28, Module, :split, 1},
{:remote_function, 65, 57, Enum, :join, 2},
{:remote_function, 60, nil, String.Chars, :to_string, 1},
{:remote_function, 60, nil, String.Chars, :to_string, 1},
{:remote_function, 59, nil, ArgumentError, :exception, 1},
{:remote_function, 59, nil, :erlang, :error, 1},
{:remote_function, 58, nil, :erlang, :"=:=", 2},
{:remote_function, 58, nil, :erlang, :"=:=", 2},
{:remote_function, 58, nil, :erlang, :orelse, 2},
{:remote_function, 57, nil, String.Chars, :to_string, 1},
{:remote_function, 57, nil, Regex, :compile!, 2},
{:remote_function, 56, 13, File, :read!, 1},
{:remote_function, 57, 15, String, :match?, 2},
{:remote_function, 54, 57, :erlang, :is_binary, 1},
{:imported_function, 54, 57, Kernel, :is_binary, 1},
{:remote_function, 47, 12, Map, :get, 3},
{:remote_function, 39, 45, :erlang, :-, 2},
{:imported_function, 39, 45, Kernel, :-, 2},
{:remote_function, 37, 33, :erlang, :-, 2},
Expand All @@ -610,24 +613,26 @@ defmodule ExFactor.Support.Trace do
{:remote_function, 18, 29, Keyword, :get, 2},
{:remote_function, 15, 18, Keyword, :fetch!, 2},
{:remote_function, 1, 1, :elixir_utils, :noop, 0},
{:remote_function, 115, nil, :elixir_module, :read_cache, 2},
{:remote_function, 115, nil, :elixir_def, :store_definition, 5},
{:remote_function, 111, nil, :elixir_module, :read_cache, 2},
{:remote_function, 111, nil, :elixir_def, :store_definition, 5},
{:remote_function, 109, nil, :elixir_module, :read_cache, 2},
{:remote_function, 109, nil, :elixir_def, :store_definition, 5},
{:remote_function, 97, nil, :elixir_module, :read_cache, 2},
{:remote_function, 97, nil, :elixir_def, :store_definition, 5},
{:remote_function, 87, nil, :elixir_module, :read_cache, 2},
{:remote_function, 87, nil, :elixir_def, :store_definition, 5},
{:remote_function, 77, nil, :elixir_module, :read_cache, 2},
{:remote_function, 77, nil, :elixir_def, :store_definition, 5},
{:remote_function, 66, nil, :elixir_module, :read_cache, 2},
{:remote_function, 66, nil, :elixir_def, :store_definition, 5},
{:remote_function, 60, nil, :elixir_module, :read_cache, 2},
{:remote_function, 60, nil, :elixir_def, :store_definition, 5},
{:remote_function, 55, nil, :elixir_module, :read_cache, 2},
{:remote_function, 55, nil, :elixir_def, :store_definition, 5},
{:remote_function, 124, nil, :elixir_module, :read_cache, 2},
{:remote_function, 124, nil, :elixir_def, :store_definition, 5},
{:remote_function, 120, nil, :elixir_module, :read_cache, 2},
{:remote_function, 120, nil, :elixir_def, :store_definition, 5},
{:remote_function, 118, nil, :elixir_module, :read_cache, 2},
{:remote_function, 118, nil, :elixir_def, :store_definition, 5},
{:remote_function, 106, nil, :elixir_module, :read_cache, 2},
{:remote_function, 106, nil, :elixir_def, :store_definition, 5},
{:remote_function, 96, nil, :elixir_module, :read_cache, 2},
{:remote_function, 96, nil, :elixir_def, :store_definition, 5},
{:remote_function, 86, nil, :elixir_module, :read_cache, 2},
{:remote_function, 86, nil, :elixir_def, :store_definition, 5},
{:remote_function, 75, nil, :elixir_module, :read_cache, 2},
{:remote_function, 75, nil, :elixir_def, :store_definition, 5},
{:remote_function, 69, nil, :elixir_module, :read_cache, 2},
{:remote_function, 69, nil, :elixir_def, :store_definition, 5},
{:remote_function, 64, nil, :elixir_module, :read_cache, 2},
{:remote_function, 64, nil, :elixir_def, :store_definition, 5},
{:remote_function, 54, nil, :elixir_module, :read_cache, 2},
{:remote_function, 54, nil, :elixir_def, :store_definition, 5},
{:remote_function, 45, nil, :elixir_module, :read_cache, 2},
{:remote_function, 45, nil, :elixir_def, :store_definition, 5},
{:remote_function, 12, nil, :elixir_module, :read_cache, 2},
Expand Down Expand Up @@ -784,10 +789,21 @@ defmodule ExFactor.Support.Trace do
{:remote_function, 2, nil, Module, :__put_attribute__, 4}
],
{"test/support/example_five.ex", ExFactor.Support.ExampleFive} => [
{:remote_function, 20, 11, IO, :puts, 1},
{:remote_function, 21, 11, IO, :inspect, 1},
{:remote_function, 22, 11, IO, :puts, 1},
{:remote_function, 15, 8, IO, :puts, 1},
{:remote_function, 12, 36, ExFactor.Parser, :public_functions, 1},
{:remote_function, 11, 29, ExFactor.Parser, :all_functions, 1},
{:imported_function, 11, 29, ExFactor.Parser, :all_functions, 1},
{:remote_function, 10, 33, ExFactor.Callers, :callers, 1},
{:remote_function, 1, 1, :elixir_utils, :noop, 0},
{:remote_function, 18, nil, :elixir_module, :read_cache, 2},
{:remote_function, 18, nil, :elixir_def, :store_definition, 5},
{:remote_function, 14, nil, :elixir_module, :read_cache, 2},
{:remote_function, 14, nil, :elixir_def, :store_definition, 5},
{:remote_function, 12, nil, :elixir_module, :read_cache, 2},
{:remote_function, 12, nil, :elixir_def, :store_definition, 5},
{:remote_function, 11, nil, :elixir_module, :read_cache, 2},
{:remote_function, 11, nil, :elixir_def, :store_definition, 5},
{:remote_function, 10, nil, :elixir_module, :read_cache, 2},
Expand All @@ -808,6 +824,19 @@ defmodule ExFactor.Support.Trace do
{:alias, 7, 3, ExFactor.Parser, P, [as: P]},
{:remote_function, 2, nil, Module, :__put_attribute__, 4}
],
{"test/support/example_seven.ex", ExFactor.Support.ExampleSeven} => [
{:remote_function, 11, 29, ExFactor.Parser, :all_functions, 1},
{:imported_function, 11, 29, ExFactor.Parser, :all_functions, 1},
{:remote_function, 10, 33, ExFactor.Callers, :callers, 1},
{:remote_function, 1, 1, :elixir_utils, :noop, 0},
{:remote_function, 11, nil, :elixir_module, :read_cache, 2},
{:remote_function, 11, nil, :elixir_def, :store_definition, 5},
{:remote_function, 10, nil, :elixir_module, :read_cache, 2},
{:remote_function, 10, nil, :elixir_def, :store_definition, 5},
{:alias, 7, 3, ExFactor.Callers, Callers, []},
{:alias, 6, 3, ExFactor.Parser, Parser, []},
{:remote_function, 2, nil, Module, :__put_attribute__, 4}
],
{"test/support/example_three.ex", ExFactor.Support.ExampleFour} => [
{:remote_function, 15, 1, :elixir_utils, :noop, 0},
{:remote_function, 16, nil, Kernel.LexicalTracker, :read_cache, 2},
Expand Down

0 comments on commit 93fe933

Please sign in to comment.