nit.git
7 years agonitcc: to_minimal_dfa fix transition checks (and document it)
Jean Privat [Tue, 21 Jun 2016 17:04:45 +0000 (13:04 -0400)]
nitcc: to_minimal_dfa fix transition checks (and document it)

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitcc: to_minimal_dfa accepts non-tagged DFA
Jean Privat [Tue, 21 Jun 2016 17:03:54 +0000 (13:03 -0400)]
nitcc: to_minimal_dfa accepts non-tagged DFA

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoMerge: Opportunity: log errors to stderr and update message on failed event creation
Jean Privat [Mon, 20 Jun 2016 14:27:23 +0000 (10:27 -0400)]
Merge: Opportunity: log errors to stderr and update message on failed event creation

Log all errors to stderr and remove prints on normal behavior.

Also update the error message, as the "meetup already exists" is now impossible because we dropped the uniqueness of name/date/location a while back.

This is related to #2186, where the file descriptor leak lead to bloated log files, a disk full and failed event creation by lack of space.

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

7 years agoMerge: libevent: force closing connections on error to fix file descriptors leak
Jean Privat [Mon, 20 Jun 2016 14:27:21 +0000 (10:27 -0400)]
Merge: libevent: force closing connections on error to fix file descriptors leak

The libevent wrapper did not always free and close connections on errors. These are expected errors, like when a file download is cancelled half-way through or when a push connection expires. This recently caused xymus.net to crash due to the exhaustion of file descriptors available to the process.

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

7 years agoopportunity: print errors to stderr
Alexis Laferrière [Sat, 18 Jun 2016 13:45:24 +0000 (09:45 -0400)]
opportunity: print errors to stderr

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoopportunity: inline Meetup::to_s for prettier prints
Alexis Laferrière [Sat, 18 Jun 2016 13:45:08 +0000 (09:45 -0400)]
opportunity: inline Meetup::to_s for prettier prints

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoopportunity: remove prints in normal behavior
Alexis Laferrière [Sat, 18 Jun 2016 13:44:35 +0000 (09:44 -0400)]
opportunity: remove prints in normal behavior

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoopportunity: update error message on failure to create event
Alexis Laferrière [Fri, 17 Jun 2016 23:13:31 +0000 (19:13 -0400)]
opportunity: update error message on failure to create event

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agolibevent: force_close the connection on error (don't wait on buffers)
Alexis Laferrière [Fri, 17 Jun 2016 22:24:22 +0000 (18:24 -0400)]
libevent: force_close the connection on error (don't wait on buffers)

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agolibevent: move close logic from C to Nit, and intro force_close
Alexis Laferrière [Fri, 17 Jun 2016 22:23:41 +0000 (18:23 -0400)]
libevent: move close logic from C to Nit, and intro force_close

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoMerge: Highlight: client can provide an linking policy
Jean Privat [Wed, 15 Jun 2016 23:09:32 +0000 (19:09 -0400)]
Merge: Highlight: client can provide an linking policy

Links to entities can be defined by specializing `HighlightVisitor::hrefto`

Nitlight uses it to correctly provide better links (and avoid generating dead links)

Pull-Request: #2184
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agotests: update .res of nitlight and test_highlight
Jean Privat [Mon, 13 Jun 2016 20:48:30 +0000 (16:48 -0400)]
tests: update .res of nitlight and test_highlight

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agohighlight: remove default links. Clients have to provide them
Jean Privat [Mon, 13 Jun 2016 20:46:52 +0000 (16:46 -0400)]
highlight: remove default links. Clients have to provide them

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agotest_highlight: use only local links
Jean Privat [Mon, 13 Jun 2016 20:45:39 +0000 (16:45 -0400)]
test_highlight: use only local links

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitlight: use contextual links
Jean Privat [Mon, 13 Jun 2016 20:44:37 +0000 (16:44 -0400)]
nitlight: use contextual links

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agohighlight: add HighlightVisitor::hrefto to allow clients to tweak generated links
Jean Privat [Mon, 13 Jun 2016 20:40:01 +0000 (16:40 -0400)]
highlight: add HighlightVisitor::hrefto to allow clients to tweak generated links

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoMerge: nitunit: improve generated XML
Jean Privat [Mon, 13 Jun 2016 16:04:27 +0000 (12:04 -0400)]
Merge: nitunit: improve generated XML

The XML format used by Jenkins is under-specified. So after loosely googling and a lot of trials and errors here is some improvement of the XML that enhance the user experience on Jenkins.

To experiment, I used a false job to see the results of nitunit for the test cases in tests (where a lot are expected to fails)

* the (ANSI-colored) log: http://gresil.org/jenkins/job/ZZnothing/195/console
* the results: http://gresil.org/jenkins/job/ZZnothing/195/testReport/

The main improvements are:

* messages are open by default (when you click on the + of a failed tests)
* add a time (not impressive but might be useful on real tests)
* all test cases are counted
* more readable names. Compare with http://gresil.org/jenkins/job/ZZnothing/189/testReport/ for instance

Pull-Request: #2182
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: makefiles: simplify them and assume that Nit tools are in the PATH
Jean Privat [Mon, 13 Jun 2016 16:04:25 +0000 (12:04 -0400)]
Merge: makefiles: simplify them and assume that Nit tools are in the PATH

close #2105

Pull-Request: #2181
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoMerge: hightlight: improve infrastructure
Jean Privat [Mon, 13 Jun 2016 16:04:24 +0000 (12:04 -0400)]
Merge: hightlight: improve infrastructure

infoboxes that popup where broken some time ago. This PR fix them and add two toggle for clients.

* `show_messages` to underline tokens and show error messages (or not)
* `show_infobox` to attach (or not) popupable infoboxes (those that where broken).

demo is available http://info.uqam.ca/~privat/tmp/nitlight/

Note: the UI is still terrible, but I have no better idea than these ugly popups to present complex contextual information.

Pull-Request: #2180
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: hightlight as a service
Jean Privat [Mon, 13 Jun 2016 16:04:21 +0000 (12:04 -0400)]
Merge: hightlight as a service

Some small adaptation to make the various tools less command-line dependent.

As a proof a concept, there is a simple nitlight&nitpick online tools.
Maybe a future nit online validador (nitltn?)

http://pratchett.info.uqam.ca:8081/

It seems that the machine is no more accessible from outside :/

Pull-Request: #2179
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agotests: update nitunit results
Jean Privat [Sat, 11 Jun 2016 03:25:27 +0000 (23:25 -0400)]
tests: update nitunit results

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: add --no-time to avoid time and improve reproductible results
Jean Privat [Sat, 11 Jun 2016 20:04:01 +0000 (16:04 -0400)]
nitunit: add --no-time to avoid time and improve reproductible results

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: move compilation errors to `<testcase>` as they are ignored in `<testsuite>`
Jean Privat [Sat, 11 Jun 2016 03:23:46 +0000 (23:23 -0400)]
nitunit: move compilation errors to `<testcase>` as they are ignored in `<testsuite>`

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: use shorter names in the XML
Jean Privat [Sat, 11 Jun 2016 03:21:06 +0000 (23:21 -0400)]
nitunit: use shorter names in the XML

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: use `message` attribute in XML to store the error message.
Jean Privat [Sat, 11 Jun 2016 03:20:00 +0000 (23:20 -0400)]
nitunit: use `message` attribute in XML to store the error message.

Doing so make it visible by defaukt.
The content is displayed as `stack trace`

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: add time information
Jean Privat [Sat, 11 Jun 2016 01:45:27 +0000 (21:45 -0400)]
nitunit: add time information

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agomakefiles: simplify them and assume that Nit tools are in the PATH
Jean Privat [Sat, 11 Jun 2016 00:09:08 +0000 (20:09 -0400)]
makefiles: simplify them and assume that Nit tools are in the PATH

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agotests: update light .res
Jean Privat [Fri, 10 Jun 2016 18:17:09 +0000 (14:17 -0400)]
tests: update light .res

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agohighlight: highlight ids in a qualified id
Jean Privat [Fri, 10 Jun 2016 18:10:48 +0000 (14:10 -0400)]
highlight: highlight ids in a qualified id

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agohighlight: add two configuration, show_messages and show_infobox
Jean Privat [Fri, 10 Jun 2016 18:10:15 +0000 (14:10 -0400)]
highlight: add two configuration, show_messages and show_infobox

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agohighlight: always decorate children token
Jean Privat [Fri, 10 Jun 2016 18:08:45 +0000 (14:08 -0400)]
highlight: always decorate children token

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agopnacl: update because `compute_nit_dir` was renamed
Jean Privat [Fri, 10 Jun 2016 16:07:05 +0000 (12:07 -0400)]
pnacl: update because `compute_nit_dir` was renamed

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agosrc: add examples/nitlight_as_a_service.nit
Jean Privat [Fri, 10 Jun 2016 16:06:32 +0000 (12:06 -0400)]
src: add examples/nitlight_as_a_service.nit

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agotoolcontext: disable error messages if `opt_warn.value` is negative
Jean Privat [Fri, 10 Jun 2016 14:00:59 +0000 (10:00 -0400)]
toolcontext: disable error messages if `opt_warn.value` is negative

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agotoolcontext: make `nit_dir` more robust and client-definable
Jean Privat [Fri, 10 Jun 2016 14:00:15 +0000 (10:00 -0400)]
toolcontext: make `nit_dir` more robust and client-definable

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agohighlight: can hightlight a full source file (not a specific node)
Jean Privat [Fri, 10 Jun 2016 13:46:21 +0000 (09:46 -0400)]
highlight: can hightlight a full source file (not a specific node)

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoMerge: lib/core: Renamed `Text::bytelen` to `Text::byte_length`
Jean Privat [Fri, 10 Jun 2016 01:58:40 +0000 (21:58 -0400)]
Merge: lib/core: Renamed `Text::bytelen` to `Text::byte_length`

As one famous man once said: "Je vous ai compris!".

So, I understood that some of us (@xymus, @ppepos, @BlackMinou, etc.) did not like the `bytelen` name, since it was not that explicit.
Well, its days are numbered and it is replaced by the longer but more explicit `byte_length`.

Pull-Request: #2173
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoMerge: Added contributing guidelines and link from readme
Jean Privat [Fri, 10 Jun 2016 01:55:27 +0000 (21:55 -0400)]
Merge: Added contributing guidelines and link from readme

As discussed in #2133, contribution guidelines are hard to find.

This PR is an attempt to ease the process by giving newcomer friendly advices and some more insight on the contribution process for Nit.

@tonygaetani, do you think a document like this one would have been helpful for you ? Is there anything you would change to make it friendlier/clearer ?

Close #2133

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

7 years agoMerge: Base64: Revamped base64_decode and added a strict mode
Jean Privat [Fri, 10 Jun 2016 01:55:20 +0000 (21:55 -0400)]
Merge: Base64: Revamped base64_decode and added a strict mode

As talked with @ppepos, base64_decode now supports either `strict` or `non-strict`
modes when decoding a base64 string.

The `strict` mode is inspired from the `-i` option from the Unix `base64` command, which ignores non-compliant characters and non-padded `base64` strings.

This is more or less what we do now, `strict` being the default.

Since only one allocation and copy is done now, performance should be better.
There is however one pitfall of this implementation due to the `nullable Object` contract from `Collection[K]`, causing multiple boxings, some further optimization could be done on that front.

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

7 years agotests: Updated old tests sav
Lucas Bajolet [Wed, 8 Jun 2016 19:52:02 +0000 (15:52 -0400)]
tests: Updated old tests sav

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agotests: Improved base64 test for edge strict cases
Lucas Bajolet [Wed, 8 Jun 2016 15:07:43 +0000 (11:07 -0400)]
tests: Improved base64 test for edge strict cases

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agolib/base64: Revamped `decode_base64` for better performances and introduction of...
Lucas Bajolet [Mon, 16 May 2016 15:36:51 +0000 (11:36 -0400)]
lib/base64: Revamped `decode_base64` for better performances and introduction of a strict mode

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agolib/core: Renamed `Text::bytelen` to `Text::byte_length`
Lucas Bajolet [Wed, 8 Jun 2016 18:48:42 +0000 (14:48 -0400)]
lib/core: Renamed `Text::bytelen` to `Text::byte_length`

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agolib/core: Added `is_whitespace` method to `Byte`
Lucas Bajolet [Wed, 8 Jun 2016 15:06:40 +0000 (11:06 -0400)]
lib/core: Added `is_whitespace` method to `Byte`

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agonit: Added link to `CONTRIBUTING.md` from the README
Lucas Bajolet [Fri, 27 May 2016 18:06:33 +0000 (14:06 -0400)]
nit: Added link to `CONTRIBUTING.md` from the README

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agonit: Added `CONTRIBUTING.md` file to repository
Lucas Bajolet [Fri, 27 May 2016 18:05:58 +0000 (14:05 -0400)]
nit: Added `CONTRIBUTING.md` file to repository

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: nitweb: add misc features
Jean Privat [Wed, 8 Jun 2016 13:00:50 +0000 (09:00 -0400)]
Merge: nitweb: add misc features

A little of everything in this PR:

* show all properties of a class: http://nitweb.moz-code.org/class/core::Array (see all props tab)
* show code into linearization card: http://nitweb.moz-code.org/class/core::Array (see linearization tab)
* show class definitions for modules: http://nitweb.moz-code.org/module/core::array

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

7 years agonitweb/angular: show mclass all properties
Alexandre Terrasa [Wed, 1 Jun 2016 03:08:17 +0000 (23:08 -0400)]
nitweb/angular: show mclass all properties

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: show module definitions
Alexandre Terrasa [Tue, 7 Jun 2016 17:09:25 +0000 (13:09 -0400)]
nitweb/angular: show module definitions

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: load mentity definitions for classes and properties
Alexandre Terrasa [Tue, 7 Jun 2016 17:07:58 +0000 (13:07 -0400)]
nitweb/angular: load mentity definitions for classes and properties

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: add /api/defs/:entity to list definitions
Alexandre Terrasa [Tue, 7 Jun 2016 17:06:10 +0000 (13:06 -0400)]
nitweb: add /api/defs/:entity to list definitions

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: show code in definition cards
Alexandre Terrasa [Tue, 7 Jun 2016 17:54:53 +0000 (13:54 -0400)]
nitweb/angular: show code in definition cards

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: nitweb: add `code` tab for modules, classdefs and propdefs.
Jean Privat [Tue, 7 Jun 2016 19:11:11 +0000 (15:11 -0400)]
Merge: nitweb: add `code` tab for modules, classdefs and propdefs.

Interesting demos:
* http://nitweb.moz-code.org/module/array_debug::array_debug
* http://nitweb.moz-code.org/classdef/core$Array
* http://nitweb.moz-code.org/propdef/core::abstract_text$Object$to_s

Only the two last commits are relevant since the rest belongs to #2170

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

7 years agoMerge: nitweb: list linearized definitions
Jean Privat [Tue, 7 Jun 2016 19:11:09 +0000 (15:11 -0400)]
Merge: nitweb: list linearized definitions

Display linearization lists:

* Mclass linearize all the class definitions
   * linearization of `core::Array` mclassdefs: http://nitweb.moz-code.org/class/core::Array

* MProperty linearize all the prop definitions
    * linearization of `core::Object::hash`: http://nitweb.moz-code.org/property/core::Object::hash

* MClassDef linearize to intro
    * linearization of `core::flat$Array`: http://nitweb.moz-code.org/classdef/core::flat$Array

* MPropdef linearize to intro
    * linearization of `core$Array$Object::SELF`: http://nitweb.moz-code.org/propdef/core$Array$Object::SELF

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

7 years agoMerge: catalog: only render the asked packages (not the imported ones)
Jean Privat [Tue, 7 Jun 2016 19:10:59 +0000 (15:10 -0400)]
Merge: catalog: only render the asked packages (not the imported ones)

Imported packages where always shown. Not a good behavior on most command-line cases.

Pull-Request: #2168
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: nitunit: testsuites are explicit
Jean Privat [Tue, 7 Jun 2016 19:10:53 +0000 (15:10 -0400)]
Merge: nitunit: testsuites are explicit

nitunit do no more try to be clever and find test-suites.

Previously, `nitunit foo.nit` caused the execution of the test suite `test_foo.nit` if it exist.
This behavior had some drawbacks:

* the test suite must follow a strict naming convention `test_*`
* the test suite must be in the same directory
* there must a an associated module. no way to create a test-suite out of thin air
* nitunit do nothing if you give the test suite instead of the module
* `-t` used to precise the location of the test suite did not work with more than one module

The proposed solution is to remove all this test-suite association with a module and asks the used to use the test-suite instead.

    nitunit test_foo.nit

Because nitunit in intended to work with more than one module, there is basically no change for client that do

    nitunit .

Pull-Request: #2167
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: popcorn: use nitunit for blackbox testing
Jean Privat [Tue, 7 Jun 2016 19:10:44 +0000 (15:10 -0400)]
Merge: popcorn: use nitunit for blackbox testing

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

7 years agonitrpg: `test_helper` is not a test_suite. just an helper.
Jean Privat [Tue, 7 Jun 2016 16:05:52 +0000 (12:05 -0400)]
nitrpg: `test_helper` is not a test_suite. just an helper.

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoloader: make module name mismatch a false error so nitunit can test them
Jean Privat [Mon, 6 Jun 2016 18:22:35 +0000 (14:22 -0400)]
loader: make module name mismatch a false error so nitunit can test them

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agotests: update niunit .sav
Jean Privat [Mon, 6 Jun 2016 18:29:56 +0000 (14:29 -0400)]
tests: update niunit .sav

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: update man page about test-suite
Jean Privat [Mon, 6 Jun 2016 18:21:58 +0000 (14:21 -0400)]
nitunit: update man page about test-suite

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: drop -t option
Jean Privat [Mon, 6 Jun 2016 17:44:38 +0000 (13:44 -0400)]
nitunit: drop -t option

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: just process test_suite when given
Jean Privat [Mon, 6 Jun 2016 17:43:38 +0000 (13:43 -0400)]
nitunit: just process test_suite when given

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: compile with -q to silent warnings
Jean Privat [Mon, 6 Jun 2016 17:26:20 +0000 (13:26 -0400)]
nitunit: compile with -q to silent warnings

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitweb/angular: show code tab for modules, classdefs, propdefs
Alexandre Terrasa [Tue, 7 Jun 2016 16:45:20 +0000 (12:45 -0400)]
nitweb/angular: show code tab for modules, classdefs, propdefs

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: add code to model
Alexandre Terrasa [Tue, 7 Jun 2016 16:45:13 +0000 (12:45 -0400)]
nitweb/angular: add code to model

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: nitunit: Fix documentation to reflect actual test discovery algorithm
Jean Privat [Tue, 7 Jun 2016 16:07:41 +0000 (12:07 -0400)]
Merge: nitunit: Fix documentation to reflect actual test discovery algorithm

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2166
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: escape_to_c: Escape trigraphs
Jean Privat [Tue, 7 Jun 2016 16:07:37 +0000 (12:07 -0400)]
Merge: escape_to_c: Escape trigraphs

Produce more standard-compliant code instead of relying on the default behaviour of gcc (or on its `-Wno-trigraphs` flag).

See also: https://github.com/nitlang/nit/pull/1949/commits/000ac8de3c64790b0fbb0e868e406a6a280f3fa9

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2151
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoMerge: lib/nitcorn: fix last warnings
Jean Privat [Tue, 7 Jun 2016 16:07:22 +0000 (12:07 -0400)]
Merge: lib/nitcorn: fix last warnings

Pull-Request: #2147
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years ago.gitattributes: add *.res to ignore whitespaces
Alexandre Terrasa [Tue, 7 Jun 2016 16:00:46 +0000 (12:00 -0400)]
.gitattributes: add *.res to ignore whitespaces

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: fix some bootstrap components
Alexandre Terrasa [Tue, 7 Jun 2016 13:40:24 +0000 (09:40 -0400)]
nitweb/angular: fix some bootstrap components

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: show linearization for mclasses, mclassdefs, mproperties, mpropdefs
Alexandre Terrasa [Tue, 7 Jun 2016 13:40:07 +0000 (09:40 -0400)]
nitweb/angular: show linearization for mclasses, mclassdefs, mproperties, mpropdefs

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: add linearization directives
Alexandre Terrasa [Tue, 7 Jun 2016 13:39:10 +0000 (09:39 -0400)]
nitweb/angular: add linearization directives

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: add linearization to model
Alexandre Terrasa [Tue, 7 Jun 2016 13:38:38 +0000 (09:38 -0400)]
nitweb/angular: add linearization to model

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: add /api/linearization/:full_name service
Alexandre Terrasa [Tue, 7 Jun 2016 13:37:33 +0000 (09:37 -0400)]
nitweb: add /api/linearization/:full_name service

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agomodel_collect: introduce `collect_linearization` service
Alexandre Terrasa [Tue, 7 Jun 2016 15:56:14 +0000 (11:56 -0400)]
model_collect: introduce `collect_linearization` service

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agotext: Test all implementations of `escape_to_c`
Jean-Christophe Beaupré [Mon, 6 Jun 2016 16:09:17 +0000 (12:09 -0400)]
text: Test all implementations of `escape_to_c`

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agoescape_to_c: Escape trigraphs
Jean-Christophe Beaupré [Mon, 6 Jun 2016 16:04:00 +0000 (12:04 -0400)]
escape_to_c: Escape trigraphs

Produce more standard-compliant code instead of relying on the default
behaviour of gcc (or on its `-Wno-trigraphs` flag).

See also: https://github.com/nitlang/nit/pull/1949/commits/000ac8de3c64790b0fbb0e868e406a6a280f3fa9

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agopopcorn: remove useless tests/ dir
Alexandre Terrasa [Tue, 7 Jun 2016 12:29:24 +0000 (08:29 -0400)]
popcorn: remove useless tests/ dir

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agocatalog: only render the asked packages (not the imported ones)
Jean Privat [Mon, 6 Jun 2016 20:10:12 +0000 (16:10 -0400)]
catalog: only render the asked packages (not the imported ones)

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: Fix documentation to reflect actual test discovery algorithm
Jean-Christophe Beaupré [Mon, 6 Jun 2016 17:31:54 +0000 (13:31 -0400)]
nitunit: Fix documentation to reflect actual test discovery algorithm

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agoMerge: nitweb: use ConsoleLog middleware
Jean Privat [Mon, 6 Jun 2016 15:12:57 +0000 (11:12 -0400)]
Merge: nitweb: use ConsoleLog middleware

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

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

7 years agoMerge: nitweb: use catalog as homepage
Jean Privat [Mon, 6 Jun 2016 15:12:12 +0000 (11:12 -0400)]
Merge: nitweb: use catalog as homepage

Used the Catalog API with Nitweb to provide a homepage.

Demo: http://nitweb.moz-code.org/

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

7 years agonitweb: use ConsoleLog middleware
Alexandre Terrasa [Wed, 25 May 2016 03:58:18 +0000 (23:58 -0400)]
nitweb: use ConsoleLog middleware

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: display Catalog as homepage
Alexandre Terrasa [Mon, 6 Jun 2016 13:02:43 +0000 (09:02 -0400)]
nitweb/angular: display Catalog as homepage

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: introduce Catalog model
Alexandre Terrasa [Mon, 6 Jun 2016 13:01:34 +0000 (09:01 -0400)]
nitweb/angular: introduce Catalog model

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: introduce API catalog route
Alexandre Terrasa [Mon, 6 Jun 2016 13:00:49 +0000 (09:00 -0400)]
nitweb: introduce API catalog route

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: move APIRouter to nitweb.nit
Alexandre Terrasa [Mon, 6 Jun 2016 11:46:41 +0000 (07:46 -0400)]
nitweb: move APIRouter to nitweb.nit

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: move APIHandler to web_base
Alexandre Terrasa [Mon, 6 Jun 2016 11:46:04 +0000 (07:46 -0400)]
nitweb: move APIHandler to web_base

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: nitls: fix tree representation of nested groups
Jean Privat [Sun, 5 Jun 2016 16:12:49 +0000 (12:12 -0400)]
Merge: nitls: fix tree representation of nested groups

nitls wrongly detached some nested groups in tree-mode.

Before:

~~~
$ nitls -tp lib/nitcorn/examples/src/nitcorn_hello_world.nit lib/nitcorn/http_response.nit
lib/nitcorn/examples
`--lib/nitcorn/examples/src
   `--lib/nitcorn/examples/src/nitcorn_hello_world.nit
lib/nitcorn
`--lib/nitcorn/http_response.nit
~~~

After:

~~~
$ nitls -tp lib/nitcorn/examples/src/nitcorn_hello_world.nit lib/nitcorn/http_response.nit
lib/nitcorn
|--lib/nitcorn/examples
|  `--lib/nitcorn/examples/src
|     `--lib/nitcorn/examples/src/nitcorn_hello_world.nit
`--lib/nitcorn/http_response.nit
~~~

Pull-Request: #2161
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoMerge: Honor `source.exclude` in ini files
Jean Privat [Sun, 5 Jun 2016 16:10:23 +0000 (12:10 -0400)]
Merge: Honor `source.exclude` in ini files

`source.exclude` is used in very specific cases to prevent some .nit file of directory to belong to a package.

This means two things:
* when the loader is scanning/loading a full package or group, and finds an excluded group or module, then the excluded entity will be not included in the package (and not scanned/loaded)
* when the loader is explicitly requested to load an excluded entity, then it will be detached from the parent package. The excluded modules will be considered as standalone modules.

Pull-Request: #2160
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoMerge: nitunit with black boxes: alternative sav files and --autosav
Jean Privat [Sun, 5 Jun 2016 16:10:19 +0000 (12:10 -0400)]
Merge: nitunit with black boxes: alternative sav files and --autosav

Two new things:

* alternative .res location for better scalability
* option --autosav to create/update the .res files

For each TestCase `test_bar` of a TestSuite `test_mod.nit`, a corresponding file with the expected output is looked for:

* "test_mod.sav/test_bar.res". I.e. test-cases grouped by test-suites.
    This is the default and is useful if there is a lot of test-suites and test-cases in a directory
* "sav/test_bar.res". I.e. all test-cases grouped in a common sub-directory.
    Useful if there is a lot of test-suites OR test-cases in a directory.
* "test_bar.res" raw in the directory.
    Useful is there is a few test-suites and test-cases in a directory.

All 3 are exclusive. If more than one exists, the test-case is failed.
If a corresponding file then the output of the test-case is compared with the file.

To helps the management of the expected results, the option `--autosav` can be used to automatically create and update them.

With the option, if a black block test fails because a difference between the expected result and the current result then the expected result file is updated (and the test is passed).
If a test-case of a test-suite passes but that some output is generated, then an expected result file is created.

It is expected that the created/updated files are checked since the tests are considered passed.
A VCS like `git` is often a good tool to check the creation and modification of those files.

Pull-Request: #2158

7 years agocode: add some `source.exclude` to remove errors in the catalog
Jean Privat [Sat, 4 Jun 2016 16:42:41 +0000 (12:42 -0400)]
code: add some `source.exclude` to remove errors in the catalog

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agotests: add test for source.exclude ini entry
Jean Privat [Sat, 4 Jun 2016 15:06:07 +0000 (11:06 -0400)]
tests: add test for source.exclude ini entry

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agotests: update sav/test_basename_perf_args1.res that rely on project1
Jean Privat [Sat, 4 Jun 2016 17:38:20 +0000 (13:38 -0400)]
tests: update sav/test_basename_perf_args1.res that rely on project1

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agotests: improve nitls tests
Jean Privat [Sat, 4 Jun 2016 16:18:28 +0000 (12:18 -0400)]
tests: improve nitls tests

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitls: fix broken group tree when there is a chain of empty groups
Jean Privat [Sat, 4 Jun 2016 16:17:51 +0000 (12:17 -0400)]
nitls: fix broken group tree when there is a chain of empty groups

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoloader: honor `source.exclude` config in the package.ini
Jean Privat [Sat, 4 Jun 2016 14:56:29 +0000 (10:56 -0400)]
loader: honor `source.exclude` config in the package.ini

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agomodelbuilder: stop reporting hints again and again. It could be time consuming.
Jean Privat [Sat, 4 Jun 2016 14:54:21 +0000 (10:54 -0400)]
modelbuilder: stop reporting hints again and again. It could be time consuming.

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agonitunit: update manpage with multiple .res and --autosav
Jean Privat [Fri, 3 Jun 2016 00:34:02 +0000 (20:34 -0400)]
nitunit: update manpage with multiple .res and --autosav

Signed-off-by: Jean Privat <jean@pryen.org>