Merge: docker: add image for continuous integration (without nit)
authorJean Privat <jean@pryen.org>
Mon, 18 Feb 2019 16:26:44 +0000 (11:26 -0500)
committerJean Privat <jean@pryen.org>
Mon, 18 Feb 2019 16:26:44 +0000 (11:26 -0500)
This prepares a new image that we will use for continuous integration.

Basically, it is a lot of stuff required by tests, libs and contribs of nit, but without nit

Pull-Request: #2732

.gitlab-ci.yml [new file with mode: 0644]
Makefile
c_src/Makefile
lib/core/text/abstract_text.nit
lib/core/text/fixed_ints_text.nit
src/compiler/abstract_compiler.nit

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644 (file)
index 0000000..1a70ece
--- /dev/null
@@ -0,0 +1,333 @@
+image: nitlang/nit-ci
+
+cache:
+  paths:
+    - .ccache
+  key: "$CI_JOB_NAME"
+
+stages:
+  - build
+  - test
+  - more_test
+  - deploy
+
+before_script:
+  - date
+  - export CCACHE_DIR=$PWD/.ccache
+  - export PATH=$PWD/bin:$PATH
+  - pwd
+  - ccache -s
+  - ccache -M 500M
+  - type -a nitc nitdoc || true # is there some nit tools?
+  - "> status.txt"
+
+after_script:
+  - export CCACHE_DIR=$PWD/.ccache
+  - ccache -s
+  - git status --ignored
+  - date
+  - tail status.txt
+
+# BASIC JOBS ########################################################
+
+sanity_checks:
+  stage: build
+  script:
+    - misc/jenkins/checkwhitespaces.sh | tee -a status.txt
+    - misc/jenkins/checksignedoffby.sh | tee -a status.txt
+    - misc/jenkins/checklicense.sh | tee -a status.txt
+
+build_tools:
+  stage: build
+  script:
+    - make 2>> status.txt
+    - nitc --version
+    - misc/jenkins/check_manpages.sh
+    - "{ cd tests && ./tests.sh base_sim*.nit ../src/nitlight.nit; }"
+    - nitunit -v lib/core
+  artifacts:
+    paths:
+      - bin/*
+      - c_src/nitc
+      - src/version.nit
+      - src/nitc_0
+      - nitunit.xml*
+      - tests/*.xml*
+    when: always
+    reports:
+      junit:
+        - tests/*.xml
+        - nitunit.xml
+
+test_some:
+  stage: test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./search_tests_git.sh origin/master HEAD > list
+    - ./testall.sh `cat list` | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml
+    when: always
+    reports:
+      junit: tests/*.xml
+
+nitunit_some:
+  stage: test
+  dependencies:
+    - build_tools
+  script:
+    - git diff --name-only origin/master..HEAD -- "*.nit" "*.res" "README.*" | grep -v "^tests/" > list0.txt
+    - xargs nitls -pP < list0.txt > list.txt
+    - xargs nitunit < list.txt
+  artifacts:
+    paths:
+      - nitunit.xml*
+    when: always
+    reports:
+      junit:
+        - nitunit.xml
+
+nitpick_full:
+  stage: test
+  dependencies:
+    - build_tools
+  script:
+    - nitls lib src examples contrib
+    - nitls -Pp lib src examples | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
+    - xargs nitpick < list.txt
+
+# TEST FULL #########################################################
+
+test_full_nitcs:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./testfull.sh | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml*
+      - tests/out/*.res
+      - tests/out/*.log
+    when: always
+    reports:
+      junit: tests/*.xml
+
+test_full_niti:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./testfull.sh --engine niti | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml*
+      - tests/out/*.res
+      - tests/out/*.log
+    when: always
+    reports:
+      junit: tests/*.xml
+
+test_full_nitcg:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./testfull.sh --engine nitcg | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml*
+      - tests/out/*.res
+      - tests/out/*.log
+    when: always
+    reports:
+      junit: tests/*.xml
+
+test_full_nitce:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./testfull.sh --engine nitce | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml*
+      - tests/out/*.res
+      - tests/out/*.log
+    when: always
+    reports:
+      junit: tests/*.xml
+
+test_full_nitcsg:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./testfull.sh --engine nitcsg | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml*
+      - tests/out/*.res
+      - tests/out/*.log
+    when: always
+    reports:
+      junit: tests/*.xml
+
+# LIB, CONTRIB AND OOT ##############################################
+
+nitunit_lib:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - nitls -Pp lib | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
+    - xargs nitunit -v < list.txt| tee log.txt
+    - grep -e KO log.txt > status.txt || true
+    - tail -3 log.txt >> status.txt
+  artifacts:
+    paths:
+      - nitunit.xml*
+    when: always
+    reports:
+      junit:
+        - nitunit.xml
+
+nitunit_src:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - nitls -Pp src examples | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
+    - xargs nitunit -v < list.txt| tee log.txt
+    - grep -e KO log.txt > status.txt || true
+    - tail -3 log.txt >> status.txt
+  artifacts:
+    paths:
+      - nitunit.xml*
+    when: always
+    reports:
+      junit:
+        - nitunit.xml
+
+test_contribs:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - misc/jenkins/check_contrib.sh all check
+    - grep 'error message' *.xml > status.txt || true
+    - test ! -s status.txt # no lines, no errors
+  allow_failure: true
+
+build_oot:
+  stage: more_test
+  dependencies:
+    - build_more_tools
+  script:
+    - cd contrib
+    - ./oot.sh all
+    - grep 'error message' *.xml > ../status.txt || true
+    - test ! -s ../status.txt # no lines, no errors
+  allow_failure: true
+
+# MISC ##############################################################
+
+bootstrap_full:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd src
+    - ./full_bootstrap
+    - ./ncall.sh
+
+bench_fast:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd benchmarks
+    - ./bench_engines.sh --fast --fast --html options
+    - grep -B1 'error message' *.xml | grep testcase > ../status.txt || true
+  artifacts:
+    paths:
+      - benchmarks/*.html
+      - benchmarks/*.png
+      - benchmarks/*.dat
+      - benchmarks/*.gnu
+    when: always
+  allow_failure: true
+
+
+# MORE TOOLS ########################################################
+
+build_more_tools:
+  stage: test
+  dependencies:
+    - build_tools
+  script:
+    - make more
+    - make -C "contrib/nitcc"
+  artifacts:
+    paths:
+      - bin/*
+      - c_src/nitc
+      - src/version.nit
+      - src/nitc_0
+
+build_doc:
+  stage: more_test
+  dependencies:
+    - build_more_tools
+  script:
+    - nitls -r -t .
+    - nitdoc -d nitdoc.out --keep-going lib src
+  artifacts:
+    paths:
+      - nitdoc.out
+
+build_catalog:
+  stage: more_test
+  dependencies:
+    - build_more_tools
+  script:
+    - misc/jenkins/check_contrib.sh pre-build
+    - cd contrib
+    - ./oot.sh update
+    - ./oot.sh pre-build
+    - cd ..
+    - nitcatalog -d catalog.out lib/ examples/ contrib/ contrib/oot/
+  dependencies:
+    - build_more_tools
+  artifacts:
+    paths:
+      - catalog.out
+
+.test_macos:
+  script:
+    - uname
+    - pwd
+    - ls /
+  stage: build
+  tags:
+    - macos
index 3557372..4f4f71b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -83,6 +83,8 @@ clean:
        cd src; make clean
        cd tests; make clean
        cd share/man; make clean
-       for directory in $(extras); do \
-               (cd "$$directory" && $(MAKE) clean); \
+       -for directory in $(extras); do \
+               (echo "CLEANING $$directory" && cd "$$directory" && $(MAKE) clean); \
        done
+       @echo ""
+       @echo "Nit was succesfully cleaned."
\ No newline at end of file
index abffff8..87d394d 100644 (file)
@@ -576,4 +576,4 @@ nitc: nitc__nith.classes.1.o nitc__nith.classes.2.o nitc__nith.classes.3.o nitc_
        $(CC) $(LDFLAGS) -o 'nitc' nitc__nith.classes.1.o nitc__nith.classes.2.o nitc__nith.classes.3.o nitc__nith.classes.4.o nitc__nith.classes.5.o nitc__nith.classes.6.o nitc__nith.main.1.o nitc__nith.sep.1.o nitc__modelize_property.sep.1.o nitc__modelize_property.sep.2.o nitc__modelize_property.sep.3.o nitc__modelize_class.sep.1.o nitc__modelbuilder.sep.1.o nitc__loader.sep.1.o nitc__loader.sep.2.o nitc__modelbuilder_base.sep.1.o nitc__model.sep.1.o nitc__model.sep.2.o nitc__model.sep.3.o nitc__mmodule.sep.1.o nitc__mpackage.sep.1.o nitc__model_base.sep.1.o nitc__location.sep.1.o core__ropes.sep.1.o core__flat.sep.1.o core__flat.sep.2.o core__abstract_text.sep.1.o core__native.sep.1.o core__kernel.sep.1.o core__math.sep.1.o core__abstract_collection.sep.1.o core__list.sep.1.o core__array.sep.1.o core__circular_array.sep.1.o core__sorter.sep.1.o core__hash_collection.sep.1.o core__fixed_ints.sep.1.o core__string_search.sep.1.o core__fixed_ints_text.sep.1.o core__environ.sep.1.o core__file.sep.1.o core__stream.sep.1.o core__error.sep.1.o core__bytes.sep.1.o core__utf8.sep.1.o core__time.sep.1.o core__exec.sep.1.o more_collections.sep.1.o poset.sep.1.o nitc__mdoc.sep.1.o ordered_tree.sep.1.o nitc__toolcontext.sep.1.o opts.sep.1.o nitc__version.sep.1.o template.sep.1.o nitc__parser.sep.1.o nitc__parser.sep.2.o nitc__parser.sep.3.o nitc__parser.sep.4.o nitc__parser.sep.5.o nitc__parser.sep.6.o nitc__parser.sep.7.o nitc__parser_prod.sep.1.o nitc__parser_prod.sep.2.o nitc__parser_prod.sep.3.o nitc__parser_prod.sep.4.o nitc__parser_prod.sep.5.o nitc__parser_prod.sep.6.o nitc__lexer.sep.1.o nitc__parser_nodes.sep.1.o nitc__lexer_work.sep.1.o nitc__tables.sep.1.o nitc__parser_work.sep.1.o ini.sep.1.o nitc__phase.sep.1.o nitc__annotation.sep.1.o nitc__literal.sep.1.o nitc__transform.sep.1.o nitc__astbuilder.sep.1.o nitc__typing.sep.1.o nitc__typing.sep.2.o nitc__typing.sep.3.o nitc__local_var_init.sep.1.o nitc__flow.sep.1.o nitc__scope.sep.1.o nitc__astvalidation.sep.1.o nitc__auto_super_init.sep.1.o nitc__rapid_type_analysis.sep.1.o csv.sep.1.o nitc__separate_erasure_compiler.sep.1.o nitc__separate_erasure_compiler.sep.2.o nitc__separate_compiler.sep.1.o nitc__separate_compiler.sep.2.o nitc__separate_compiler.sep.3.o nitc__separate_compiler.sep.4.o nitc__separate_compiler.sep.5.o nitc__separate_compiler.sep.6.o nitc__abstract_compiler.sep.1.o nitc__abstract_compiler.sep.2.o nitc__abstract_compiler.sep.3.o nitc__abstract_compiler.sep.4.o nitc__abstract_compiler.sep.5.o nitc__abstract_compiler.sep.6.o nitc__abstract_compiler.sep.7.o nitc__platform.sep.1.o nitc__c_tools.sep.1.o nitc__mixin.sep.1.o counter.sep.1.o nitc__coloring.sep.1.o nitc__light_only.sep.1.o nitc__light.sep.1.o nitc__light_ffi.sep.1.o nitc__nitni_utilities.sep.1.o nitc__nitni_base.sep.1.o nitc__light_ffi_base.sep.1.o nitc__extern_classes.sep.1.o nitc__light_c.sep.1.o nitc__nith.types.1.o nitc__nith.types.2.o nitc__nith.types.3.o nitc__nith.types.4.o nitc__nith.types.5.o nitc__nith.types.6.o nitc__nith.types.7.o nitc__nith.types.8.o nitc__nith.types.9.o nitc__nith.types.10.o nitc__nith.types.11.o nitc__nith.types.12.o nitc__nith.types.13.o nitc__nith.types.14.o nitc__nith.types.15.o nitc__nith.types.16.o nitc__nith.types.17.o nitc__nith.types.18.o nitc__nith.types.19.o nitc__nith.types.20.o nitc__nith.types.21.o nitc__nith.types.22.o nitc__nith.types.23.o nitc__nith.types.24.o nitc__nith.types.25.o nitc__nith.types.26.o nitc__nith.types.27.o nitc__nith.types.28.o nitc__nith.types.29.o nitc__nith.types.30.o nitc__nith.types.31.o nitc__nith.types.32.o nitc__nith.types.33.o tables_nit.extern.o c_functions_hash.extern.o gc_chooser.extern.o core__abstract_text._ffi.extern.o core__abstract_text._nitni.extern.o core__native._ffi.extern.o core__native._nitni.extern.o core__kernel._ffi.extern.o core__kernel._nitni.extern.o core__math._ffi.extern.o core__math._nitni.extern.o core__fixed_ints_text._ffi.extern.o core__fixed_ints_text._nitni.extern.o core__environ._ffi.extern.o core__environ._nitni.extern.o core__file._ffi.extern.o core__file._nitni.extern.o core__time._ffi.extern.o core__time._nitni.extern.o core__exec._ffi.extern.o core__exec._nitni.extern.o $(LDLIBS) `pkg-config --libs bdw-gc`
 
 clean:
-       rm nitc__nith.classes.1.o nitc__nith.classes.2.o nitc__nith.classes.3.o nitc__nith.classes.4.o nitc__nith.classes.5.o nitc__nith.classes.6.o nitc__nith.main.1.o nitc__nith.sep.1.o nitc__modelize_property.sep.1.o nitc__modelize_property.sep.2.o nitc__modelize_property.sep.3.o nitc__modelize_class.sep.1.o nitc__modelbuilder.sep.1.o nitc__loader.sep.1.o nitc__loader.sep.2.o nitc__modelbuilder_base.sep.1.o nitc__model.sep.1.o nitc__model.sep.2.o nitc__model.sep.3.o nitc__mmodule.sep.1.o nitc__mpackage.sep.1.o nitc__model_base.sep.1.o nitc__location.sep.1.o core__ropes.sep.1.o core__flat.sep.1.o core__flat.sep.2.o core__abstract_text.sep.1.o core__native.sep.1.o core__kernel.sep.1.o core__math.sep.1.o core__abstract_collection.sep.1.o core__list.sep.1.o core__array.sep.1.o core__circular_array.sep.1.o core__sorter.sep.1.o core__hash_collection.sep.1.o core__fixed_ints.sep.1.o core__string_search.sep.1.o core__fixed_ints_text.sep.1.o core__environ.sep.1.o core__file.sep.1.o core__stream.sep.1.o core__error.sep.1.o core__bytes.sep.1.o core__utf8.sep.1.o core__time.sep.1.o core__exec.sep.1.o more_collections.sep.1.o poset.sep.1.o nitc__mdoc.sep.1.o ordered_tree.sep.1.o nitc__toolcontext.sep.1.o opts.sep.1.o nitc__version.sep.1.o template.sep.1.o nitc__parser.sep.1.o nitc__parser.sep.2.o nitc__parser.sep.3.o nitc__parser.sep.4.o nitc__parser.sep.5.o nitc__parser.sep.6.o nitc__parser.sep.7.o nitc__parser_prod.sep.1.o nitc__parser_prod.sep.2.o nitc__parser_prod.sep.3.o nitc__parser_prod.sep.4.o nitc__parser_prod.sep.5.o nitc__parser_prod.sep.6.o nitc__lexer.sep.1.o nitc__parser_nodes.sep.1.o nitc__lexer_work.sep.1.o nitc__tables.sep.1.o nitc__parser_work.sep.1.o ini.sep.1.o nitc__phase.sep.1.o nitc__annotation.sep.1.o nitc__literal.sep.1.o nitc__transform.sep.1.o nitc__astbuilder.sep.1.o nitc__typing.sep.1.o nitc__typing.sep.2.o nitc__typing.sep.3.o nitc__local_var_init.sep.1.o nitc__flow.sep.1.o nitc__scope.sep.1.o nitc__astvalidation.sep.1.o nitc__auto_super_init.sep.1.o nitc__rapid_type_analysis.sep.1.o csv.sep.1.o nitc__separate_erasure_compiler.sep.1.o nitc__separate_erasure_compiler.sep.2.o nitc__separate_compiler.sep.1.o nitc__separate_compiler.sep.2.o nitc__separate_compiler.sep.3.o nitc__separate_compiler.sep.4.o nitc__separate_compiler.sep.5.o nitc__separate_compiler.sep.6.o nitc__abstract_compiler.sep.1.o nitc__abstract_compiler.sep.2.o nitc__abstract_compiler.sep.3.o nitc__abstract_compiler.sep.4.o nitc__abstract_compiler.sep.5.o nitc__abstract_compiler.sep.6.o nitc__abstract_compiler.sep.7.o nitc__platform.sep.1.o nitc__c_tools.sep.1.o nitc__mixin.sep.1.o counter.sep.1.o nitc__coloring.sep.1.o nitc__light_only.sep.1.o nitc__light.sep.1.o nitc__light_ffi.sep.1.o nitc__nitni_utilities.sep.1.o nitc__nitni_base.sep.1.o nitc__light_ffi_base.sep.1.o nitc__extern_classes.sep.1.o nitc__light_c.sep.1.o nitc__nith.types.1.o nitc__nith.types.2.o nitc__nith.types.3.o nitc__nith.types.4.o nitc__nith.types.5.o nitc__nith.types.6.o nitc__nith.types.7.o nitc__nith.types.8.o nitc__nith.types.9.o nitc__nith.types.10.o nitc__nith.types.11.o nitc__nith.types.12.o nitc__nith.types.13.o nitc__nith.types.14.o nitc__nith.types.15.o nitc__nith.types.16.o nitc__nith.types.17.o nitc__nith.types.18.o nitc__nith.types.19.o nitc__nith.types.20.o nitc__nith.types.21.o nitc__nith.types.22.o nitc__nith.types.23.o nitc__nith.types.24.o nitc__nith.types.25.o nitc__nith.types.26.o nitc__nith.types.27.o nitc__nith.types.28.o nitc__nith.types.29.o nitc__nith.types.30.o nitc__nith.types.31.o nitc__nith.types.32.o nitc__nith.types.33.o tables_nit.extern.o c_functions_hash.extern.o gc_chooser.extern.o core__abstract_text._ffi.extern.o core__abstract_text._nitni.extern.o core__native._ffi.extern.o core__native._nitni.extern.o core__kernel._ffi.extern.o core__kernel._nitni.extern.o core__math._ffi.extern.o core__math._nitni.extern.o core__fixed_ints_text._ffi.extern.o core__fixed_ints_text._nitni.extern.o core__environ._ffi.extern.o core__environ._nitni.extern.o core__file._ffi.extern.o core__file._nitni.extern.o core__time._ffi.extern.o core__time._nitni.extern.o core__exec._ffi.extern.o core__exec._nitni.extern.o 2>/dev/null
+       rm -f nitc__nith.classes.1.o nitc__nith.classes.2.o nitc__nith.classes.3.o nitc__nith.classes.4.o nitc__nith.classes.5.o nitc__nith.classes.6.o nitc__nith.main.1.o nitc__nith.sep.1.o nitc__modelize_property.sep.1.o nitc__modelize_property.sep.2.o nitc__modelize_property.sep.3.o nitc__modelize_class.sep.1.o nitc__modelbuilder.sep.1.o nitc__loader.sep.1.o nitc__loader.sep.2.o nitc__modelbuilder_base.sep.1.o nitc__model.sep.1.o nitc__model.sep.2.o nitc__model.sep.3.o nitc__mmodule.sep.1.o nitc__mpackage.sep.1.o nitc__model_base.sep.1.o nitc__location.sep.1.o core__ropes.sep.1.o core__flat.sep.1.o core__flat.sep.2.o core__abstract_text.sep.1.o core__native.sep.1.o core__kernel.sep.1.o core__math.sep.1.o core__abstract_collection.sep.1.o core__list.sep.1.o core__array.sep.1.o core__circular_array.sep.1.o core__sorter.sep.1.o core__hash_collection.sep.1.o core__fixed_ints.sep.1.o core__string_search.sep.1.o core__fixed_ints_text.sep.1.o core__environ.sep.1.o core__file.sep.1.o core__stream.sep.1.o core__error.sep.1.o core__bytes.sep.1.o core__utf8.sep.1.o core__time.sep.1.o core__exec.sep.1.o more_collections.sep.1.o poset.sep.1.o nitc__mdoc.sep.1.o ordered_tree.sep.1.o nitc__toolcontext.sep.1.o opts.sep.1.o nitc__version.sep.1.o template.sep.1.o nitc__parser.sep.1.o nitc__parser.sep.2.o nitc__parser.sep.3.o nitc__parser.sep.4.o nitc__parser.sep.5.o nitc__parser.sep.6.o nitc__parser.sep.7.o nitc__parser_prod.sep.1.o nitc__parser_prod.sep.2.o nitc__parser_prod.sep.3.o nitc__parser_prod.sep.4.o nitc__parser_prod.sep.5.o nitc__parser_prod.sep.6.o nitc__lexer.sep.1.o nitc__parser_nodes.sep.1.o nitc__lexer_work.sep.1.o nitc__tables.sep.1.o nitc__parser_work.sep.1.o ini.sep.1.o nitc__phase.sep.1.o nitc__annotation.sep.1.o nitc__literal.sep.1.o nitc__transform.sep.1.o nitc__astbuilder.sep.1.o nitc__typing.sep.1.o nitc__typing.sep.2.o nitc__typing.sep.3.o nitc__local_var_init.sep.1.o nitc__flow.sep.1.o nitc__scope.sep.1.o nitc__astvalidation.sep.1.o nitc__auto_super_init.sep.1.o nitc__rapid_type_analysis.sep.1.o csv.sep.1.o nitc__separate_erasure_compiler.sep.1.o nitc__separate_erasure_compiler.sep.2.o nitc__separate_compiler.sep.1.o nitc__separate_compiler.sep.2.o nitc__separate_compiler.sep.3.o nitc__separate_compiler.sep.4.o nitc__separate_compiler.sep.5.o nitc__separate_compiler.sep.6.o nitc__abstract_compiler.sep.1.o nitc__abstract_compiler.sep.2.o nitc__abstract_compiler.sep.3.o nitc__abstract_compiler.sep.4.o nitc__abstract_compiler.sep.5.o nitc__abstract_compiler.sep.6.o nitc__abstract_compiler.sep.7.o nitc__platform.sep.1.o nitc__c_tools.sep.1.o nitc__mixin.sep.1.o counter.sep.1.o nitc__coloring.sep.1.o nitc__light_only.sep.1.o nitc__light.sep.1.o nitc__light_ffi.sep.1.o nitc__nitni_utilities.sep.1.o nitc__nitni_base.sep.1.o nitc__light_ffi_base.sep.1.o nitc__extern_classes.sep.1.o nitc__light_c.sep.1.o nitc__nith.types.1.o nitc__nith.types.2.o nitc__nith.types.3.o nitc__nith.types.4.o nitc__nith.types.5.o nitc__nith.types.6.o nitc__nith.types.7.o nitc__nith.types.8.o nitc__nith.types.9.o nitc__nith.types.10.o nitc__nith.types.11.o nitc__nith.types.12.o nitc__nith.types.13.o nitc__nith.types.14.o nitc__nith.types.15.o nitc__nith.types.16.o nitc__nith.types.17.o nitc__nith.types.18.o nitc__nith.types.19.o nitc__nith.types.20.o nitc__nith.types.21.o nitc__nith.types.22.o nitc__nith.types.23.o nitc__nith.types.24.o nitc__nith.types.25.o nitc__nith.types.26.o nitc__nith.types.27.o nitc__nith.types.28.o nitc__nith.types.29.o nitc__nith.types.30.o nitc__nith.types.31.o nitc__nith.types.32.o nitc__nith.types.33.o tables_nit.extern.o c_functions_hash.extern.o gc_chooser.extern.o core__abstract_text._ffi.extern.o core__abstract_text._nitni.extern.o core__native._ffi.extern.o core__native._nitni.extern.o core__kernel._ffi.extern.o core__kernel._nitni.extern.o core__math._ffi.extern.o core__math._nitni.extern.o core__fixed_ints_text._ffi.extern.o core__fixed_ints_text._nitni.extern.o core__environ._ffi.extern.o core__environ._nitni.extern.o core__file._ffi.extern.o core__file._nitni.extern.o core__time._ffi.extern.o core__time._nitni.extern.o core__exec._ffi.extern.o core__exec._nitni.extern.o 2>/dev/null
index fbe045f..06989ef 100644 (file)
@@ -253,6 +253,7 @@ abstract class Text
        # assert "0x64".to_i       == 100
        # assert "0b1100_0011".to_i== 195
        # assert "--12".to_i       == 12
+       # assert "+45".to_i        == 45
        # ~~~
        #
        # REQUIRE: `self`.`is_int`
index c738f91..89f6553 100644 (file)
@@ -208,6 +208,8 @@ redef class Text
        #
        #     assert "123".is_int
        #     assert "0b1011".is_int
+       #     assert "-34".is_int
+       #     assert "+45".is_int
        #     assert not "0x_".is_int
        #     assert not "0xGE".is_int
        #     assert not "".is_int
@@ -218,7 +220,7 @@ redef class Text
                var s = remove_all('_')
                var pos = 0
                var len = s.length
-               while pos < len and s[pos] == '-' do
+               while pos < len and (s[pos] == '-' or s[pos] == '+') do
                        pos += 1
                end
                s = s.substring_from(pos)
@@ -238,9 +240,15 @@ redef class Text
                var val = 0
                var neg = false
                var pos = 0
-               while s[pos] == '-' do
-                       neg = not neg
-                       pos += 1
+               loop
+                       if s[pos] == '-' then
+                               neg = not neg
+                               pos += 1
+                       else if s[pos] == '+' then
+                               pos += 1
+                       else
+                               break
+                       end
                end
                s = s.substring_from(pos)
                if s.length >= 2 then
index 75e9cc5..32dd807 100644 (file)
@@ -556,9 +556,9 @@ endif
                end
                makefile.write("{outpath}: {dep_rules.join(" ")}\n\t$(CC) $(LDFLAGS) -o {outpath.escape_to_sh} {ofiles.join(" ")} $(LDLIBS) {pkg}\n\n")
                # Clean
-               makefile.write("clean:\n\trm {ofiles.join(" ")} 2>/dev/null\n")
+               makefile.write("clean:\n\trm -f {ofiles.join(" ")} 2>/dev/null\n")
                if outpath != real_outpath then
-                       makefile.write("\trm -- {outpath.escape_to_sh} 2>/dev/null\n")
+                       makefile.write("\trm -f -- {outpath.escape_to_sh} 2>/dev/null\n")
                end
                makefile.close
                self.toolcontext.info("Generated makefile: {makepath}", 2)