Debian Codegraph @

t/features/language_support.feature

raw
1 Feature: multi-language support
2 As a Researcher or Practioneer
3 I want to be able to analyze software in different languages
4 In order do compare them
5
6 Scenario: dependency between modules
7 Given I am in t/samples/hello_world/<language>
8 When I run "analizo graph --modules ."
9 Then analizo must report that "<main_module>" depends on "<hello_world_module>"
10 Examples:
11 | language | main_module | hello_world_module |
12 | c | main | hello_world |
13 | cpp | main | HelloWorld |
14 | java | Main | HelloWorld |
15 | csharp | main | HelloWorld |
16
17 Scenario: dependency between specific functions
18 Given I am in t/samples/hello_world/<language>
19 When I run "analizo graph ."
20 Then analizo must report that "<main_function>" depends on "<hello_say>"
21 And analizo must report that "<main_function>" depends on "<hello_destroy>"
22 Examples:
23 | language | main_function | hello_say | hello_destroy |
24 | c | main::main() | hello_world::hello_world_say(hello_world *) | hello_world::hello_world_destroy(hello_world *) |
25 | cpp | main::main() | HelloWorld::say() | HelloWorld::destroy() |
26 | java | Main::main(String[]) | HelloWorld::say() | HelloWorld::destroy() |
27 | csharp | main::Main() | HelloWorld::say() | HelloWorld::destroy() |
28
29 Scenario: intra-module dependencies
30 Given I am in t/samples/hello_world/<language>
31 When I run "analizo graph ."
32 Then analizo must report that "<hello_say>" depends on "<hello_id>"
33 And analizo must report that "<hello_destroy>" depends on "<hello_id>"
34 Examples:
35 | language | hello_say | hello_destroy | hello_id |
36 | c | hello_world::hello_world_say(hello_world *) | hello_world::hello_world_destroy(hello_world *) | hello_world::_hello_world::id |
37 | cpp | HelloWorld::say() | HelloWorld::destroy() | HelloWorld::_id |
38 | java | HelloWorld::say() | HelloWorld::destroy() | HelloWorld::_id |
39 | csharp | HelloWorld::say() | HelloWorld::destroy() | HelloWorld::_id |
40
41 Scenario: some metrics
42 Given I am in t/samples/hello_world/<language>
43 When I run "analizo metrics ."
44 Then analizo must report that the project has total_modules = 2
45 And analizo must report that module <main_module> has nom = 1
46 And analizo must report that module <hello_world_module> has npm = 3
47 And analizo must report that module <hello_world_module> has nom = <total_methods>
48 And analizo must report that module <hello_world_module> has npa = <public_attributes>
49 Examples:
50 | language | main_module | hello_world_module | total_methods | public_attributes |
51 | c | main | hello_world | 3 | 2 |
52 | cpp | main | HelloWorld | 4 | 1 |
53 | java | Main | HelloWorld | 4 | 1 |
54 | csharp | main | HelloWorld | 4 | 1 |
55
56 Scenario: inheritance data
57 Given I am in t/samples/animals/<language>
58 When I run "analizo graph --modules ."
59 Then analizo must report that "Cat" depends on "Mammal"
60 And analizo must report that "Dog" depends on "Mammal"
61 And analizo must report that "Mammal" depends on "Animal"
62 When I run "analizo metrics ."
63 Then analizo must report that module Cat has dit = 2
64 And analizo must report that module Dog has dit = 2
65 And analizo must report that module Mammal has dit = 1
66 And analizo must report that module Animal has dit = 0
67 Examples:
68 | language |
69 | cpp |
70 | java |
71
72 # not sure what to expect in this case
73 Scenario: mixed Java and C
74 Given I am in t/samples/mixed
75 When I run "analizo metrics ."
76 Then the output must match "_module: native_backend"
77 And the output must match "_module: UI"
78 And the output must match "_module: Backend"
79