Merge: Introduce `test_frontend`
authorJean Privat <jean@pryen.org>
Mon, 15 Jul 2019 15:08:09 +0000 (11:08 -0400)
committerJean Privat <jean@pryen.org>
Mon, 15 Jul 2019 15:08:09 +0000 (11:08 -0400)
Sometimes we need to test things related to a model and it's not easy to do this with NitUnit since creating
a model by hand is tedious.

With the `TestModel` abstract suite it's easier:

```nit
module my_test is test

import test_frontend

class MyTest
   super TestModel
   test

   redef var test_src = "path/to/files"

   fun my_test is test do
       assert test_model.mmodules.length == 1
   end
end
```

Pull-Request: #2769
Reviewed-by: Jean Privat <jean@pryen.org>

1  2 
src/doc/templates/tests/test_json_model.sav/test_modules_to_full_json.res

@@@ -36,7 -36,7 +36,7 @@@
        "class_name": "MModule",
        "full_name": "test_prog::game",
        "visibility": "public",
 -      "html_synopsis": "<span class=\"synopsys nitdoc\">A game abstraction for RPG.</span>",
 +      "html_synopsis": "<span class=\"synopsis nitdoc\">A game abstraction for RPG.</span>",
        "modifiers": ["module"]
  }
  {
@@@ -52,7 -52,7 +52,7 @@@
        "class_name": "MModule",
        "full_name": "test_prog::platform",
        "visibility": "public",
 -      "html_synopsis": "<span class=\"synopsys nitdoc\">Declares base types allowed on the platform.</span>",
 +      "html_synopsis": "<span class=\"synopsis nitdoc\">Declares base types allowed on the platform.</span>",
        "modifiers": ["module"]
  }
  {
@@@ -68,7 -68,7 +68,7 @@@
        "class_name": "MModule",
        "full_name": "test_prog::careers",
        "visibility": "public",
 -      "html_synopsis": "<span class=\"synopsys nitdoc\">Careers of the game.</span>",
 +      "html_synopsis": "<span class=\"synopsis nitdoc\">Careers of the game.</span>",
        "modifiers": ["module"]
  }
  {
@@@ -84,7 -84,7 +84,7 @@@
        "class_name": "MModule",
        "full_name": "test_prog::character",
        "visibility": "public",
 -      "html_synopsis": "<span class=\"synopsys nitdoc\">Characters are playable entity in the world.</span>",
 +      "html_synopsis": "<span class=\"synopsis nitdoc\">Characters are playable entity in the world.</span>",
        "modifiers": ["module"]
  }
  {
        "class_name": "MModule",
        "full_name": "test_prog::combat",
        "visibility": "public",
 -      "html_synopsis": "<span class=\"synopsys nitdoc\">COmbat interactions between characters.</span>",
 +      "html_synopsis": "<span class=\"synopsis nitdoc\">COmbat interactions between characters.</span>",
        "modifiers": ["module"]
  }
  {
        "class_name": "MModule",
        "full_name": "test_prog::races",
        "visibility": "public",
 -      "html_synopsis": "<span class=\"synopsys nitdoc\">Races of the game.</span>",
 +      "html_synopsis": "<span class=\"synopsis nitdoc\">Races of the game.</span>",
        "modifiers": ["module"]
  }
  {
        "class_name": "MModule",
        "full_name": "test_prog::rpg",
        "visibility": "public",
 -      "html_synopsis": "<span class=\"synopsys nitdoc\">A worlg RPG abstraction.</span>",
 +      "html_synopsis": "<span class=\"synopsis nitdoc\">A worlg RPG abstraction.</span>",
        "modifiers": ["module"]
  }
  {
        "class_name": "MModule",
        "full_name": "test_prog::test_prog",
        "visibility": "public",
 -      "html_synopsis": "<span class=\"synopsys nitdoc\">A test program with a fake model to check model tools.</span>",
 +      "html_synopsis": "<span class=\"synopsis nitdoc\">A test program with a fake model to check model tools.</span>",
        "modifiers": ["module"]
  }
  {
        "visibility": "public",
        "modifiers": ["module"]
  }
+ {
+       "name": "test_prog-m",
+       "namespace": [{
+               "name": "test_prog-m"
+       }],
+       "class_name": "MModule",
+       "full_name": "test_prog-m",
+       "visibility": "public",
+       "modifiers": ["module"]
+ }