Debian Codegraph @

t/features/metrics-batch.feature

raw
1 Feature: metrics batch
2 As a software engineering researcher
3 I want to analyze several different projects
4 So I can compare their metrics
5
6 Scenario: "hello, world"
7 Given I am in t/samples/hello_world/
8 When I run "analizo metrics-batch"
9 Then the output must match "I: Processed c."
10 And the output must match "I: Processed cpp."
11 And the output must match "I: Processed java."
12
13 Scenario: summarizing
14 Given I am in t/samples/hello_world/
15 When I run "analizo metrics-batch --quiet -o data.csv && cat data.csv && rm -f *.csv"
16 Then the output must match "^id,"
17 And the output must not match ",---,"
18 And the output must match "c,"
19 And the output must match "cpp,"
20 And the output must match "java,"
21 And the output must not match "I: Processed"
22
23 Scenario: support for parallel processing
24 Given I copy t/samples/hello_world/* into a temporary directory
25 When I run "analizo metrics-batch -q -o sequential.csv"
26 And I run "analizo metrics-batch -q -o parallel.csv -p 2"
27 And I run "sort sequential.csv > sequential-sorted.csv"
28 And I run "sort parallel.csv > parallel-sorted.csv"
29 And I run "diff -u sequential-sorted.csv parallel-sorted.csv"
30 Then the output must not match "---"
31 Then the exit status must be 0
32
33 Scenario: passing two input directories as argument
34 Given I copy t/samples/hello_world/* into a temporary directory
35 When I run "analizo metrics-batch --quiet -o data.csv cpp java"
36 Then the exit status must be 0
37 And the file "c-details.csv" should not exist
38 And the file "cpp-details.csv" should exist
39 And the file "java-details.csv" should exist
40
41 Scenario: passing one input directory as argument
42 Given I copy t/samples/hello_world/* into a temporary directory
43 When I run "analizo metrics-batch --quiet -o data.csv cpp"
44 Then the exit status must be 0
45 And the file "c-details.csv" should not exist
46 And the file "cpp-details.csv" should exist
47 And the file "java-details.csv" should not exist