atp 0.8.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/commands.rb +5 -7
- data/config/version.rb +2 -2
- data/lib/atp.rb +45 -14
- data/lib/atp/ast/node.rb +18 -9
- data/lib/atp/flow.rb +558 -151
- data/lib/atp/flow_api.rb +26 -0
- data/lib/atp/formatters/basic.rb +3 -1
- data/lib/atp/processor.rb +0 -16
- data/lib/atp/processors/add_ids.rb +1 -0
- data/lib/atp/processors/adjacent_if_combiner.rb +97 -0
- data/lib/atp/processors/append_to.rb +27 -0
- data/lib/atp/processors/apply_post_group_actions.rb +50 -0
- data/lib/atp/processors/condition.rb +38 -37
- data/lib/atp/processors/continue_implementer.rb +35 -0
- data/lib/atp/processors/else_remover.rb +31 -0
- data/lib/atp/processors/empty_branch_remover.rb +17 -0
- data/lib/atp/processors/extract_set_flags.rb +18 -0
- data/lib/atp/processors/flag_optimizer.rb +214 -0
- data/lib/atp/processors/flattener.rb +58 -0
- data/lib/atp/processors/flow_id.rb +10 -4
- data/lib/atp/processors/on_pass_fail_remover.rb +39 -0
- data/lib/atp/processors/one_flag_per_test.rb +79 -0
- data/lib/atp/processors/pre_cleaner.rb +13 -8
- data/lib/atp/processors/redundant_condition_remover.rb +28 -0
- data/lib/atp/processors/relationship.rb +91 -53
- data/lib/atp/runner.rb +41 -31
- data/lib/atp/validator.rb +19 -0
- data/lib/atp/validators/duplicate_ids.rb +2 -2
- data/lib/atp/validators/jobs.rb +12 -10
- data/lib/atp/validators/missing_ids.rb +14 -8
- metadata +15 -5
- data/lib/atp/ast/builder.rb +0 -397
- data/lib/atp/ast/factories.rb +0 -17
- data/lib/atp/processors/post_cleaner.rb +0 -43
data/lib/atp/ast/factories.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module ATP
|
2
|
-
module AST
|
3
|
-
module Factories
|
4
|
-
def n(type, *children)
|
5
|
-
options = children.last.is_a?(Hash) ? children.pop : {}
|
6
|
-
options[:file] ||= options.delete(:source_file) || try(:source_file)
|
7
|
-
options[:line_number] ||= options.delete(:source_line_number) || try(:source_line_number)
|
8
|
-
options[:description] ||= options.delete(:description) || try(:description)
|
9
|
-
ATP::AST::Node.new(type, children, options)
|
10
|
-
end
|
11
|
-
|
12
|
-
def n0(type, options = {})
|
13
|
-
n(type, options)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module ATP
|
2
|
-
module Processors
|
3
|
-
# Runs at the very end of a processor run, to do some final cleanup,
|
4
|
-
# e.g. to assign generated IDs to tests that don't have one
|
5
|
-
class PostCleaner < Processor
|
6
|
-
# Returns a hash containing the IDs of all tests that have
|
7
|
-
# been used
|
8
|
-
attr_reader :ids
|
9
|
-
|
10
|
-
# Extracts all ID values of tests within the given AST
|
11
|
-
class ExtractTestIDs < Processor
|
12
|
-
attr_reader :results
|
13
|
-
|
14
|
-
def on_test(node)
|
15
|
-
id = node.children.find { |n| n.type == :id }
|
16
|
-
if id
|
17
|
-
@results ||= {}
|
18
|
-
@results[id] = true
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def process(node)
|
24
|
-
# On first call extract the test_result nodes from the given AST,
|
25
|
-
# then process as normal thereafter
|
26
|
-
if @first_call_done
|
27
|
-
result = super
|
28
|
-
else
|
29
|
-
@first_call_done = true
|
30
|
-
t = ExtractTestIDs.new
|
31
|
-
t.process(node)
|
32
|
-
@ids = t.results || {}
|
33
|
-
result = super
|
34
|
-
@first_call_done = false
|
35
|
-
end
|
36
|
-
result
|
37
|
-
end
|
38
|
-
|
39
|
-
def on_test(node)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|