From fe1689b8afb69eaf3131fa5d7f29269d9f266f7c Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Thu, 18 Apr 2019 12:41:40 +0000 Subject: [PATCH] Remove namespaces --- .travis.yml | 2 +- CHANGELOG.md | 6 ++++++ LICENSE | 2 +- Makefile | 8 ++++++++ README.md | 17 ++++++++++------- module.l | 4 ++-- reporters/default.l | 4 ---- reporters/plain.l | 2 -- test.l | 3 --- unit.l | 8 +------- 10 files changed, 29 insertions(+), 27 deletions(-) create mode 100644 Makefile diff --git a/.travis.yml b/.travis.yml index b24e81e..8e78d02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,4 @@ before_script: - make clean; make script: - - cd ${TRAVIS_BUILD_DIR} && (for i in plain default; do PIL_NAMESPACES=false TEST_REPORTER="$i" /tmp/picoLisp/pil test.l; done) + - cd ${TRAVIS_BUILD_DIR} && (for i in plain default; do TEST_REPORTER="$i" /tmp/picoLisp/pil test.l; done) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0cdd19..79fee64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 3.0.0 TBD + + * Add Makefile for testing the library + * Update supported PicoLisp version to 18.12 + * **Breaking change:** remove all support for PicoLisp namespaces + ## 2.1.0 (2017-03-23) * Restore PicoLisp namespaces for backwards compatibility. Disable with PIL_NAMESPACES=false diff --git a/LICENSE b/LICENSE index fd5eff7..9d55bbb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 Alexander Williams, Unscramble +Copyright (c) 2019 Alexander Williams, Unscramble Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..694a43f --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +# picolisp-unit Makefile + +.PHONY: all + +all: check + +check: + @for i in plain default; do TEST_REPORTER="$$i" ./test.l; done diff --git a/README.md b/README.md index d9a1735..d171066 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ Please read [EXPLAIN.md](EXPLAIN.md) to learn more about PicoLisp and this Unit 6. [Reporters](#reporters) 7. [Alternatives](#alternatives) 8. [Contributing](#contributing) - 9. [License](#license) + 9. [Changelog](#changelog) + 10. [License](#license) # Requirements @@ -39,12 +40,6 @@ Here are some guidelines on how to use `unit.l`, but you're free to poke around There exists a few public functions: `(execute)`, `(report)`, and a bunch of `(assert-X)` where X is a type of assertion. -> **Note:** Namespaces can be disabled by setting the environment variable `PIL_NAMESPACES=false` - -> **Note for 64-bit PicoLisp:** you can use `(symbols 'unit)` (or the prefix: `unit~`). Ignored if `PIL_NAMESPACES=false` - -> **Note for 32-bit PicoLisp:** you don't have access to `(symbols)`, so these functions might clash with existing ones. - * **(execute arg1 ..)** Executes arg1 to argN tests - `arg1` _Quoted List_: a list of assertions, example `'(assert-nil NIL "I AM NIL")` * **(report)** Prints a report of failed tests, and exits with 1 if there is a failure @@ -195,6 +190,10 @@ This testing library has its own set of tests (hehe). You can use those as examp ./test.l +or + + make check + # Reporters If you don't call `(report)`, the test results will not be printed to the screen. @@ -244,6 +243,10 @@ If you want to improve this library, please make a pull-request. * @cryptorick [Rick Hanson](https://github.com/cryptorick) +# Changelog + +* [Changelog](CHANGELOG.md) + # License [MIT License](LICENSE) diff --git a/module.l b/module.l index 61d0681..e6d9d2f 100644 --- a/module.l +++ b/module.l @@ -1,8 +1,8 @@ [de MODULE_INFO ("name" "unit") - ("version" "2.1.0") + ("version" "3.0.0") ("summary" "Unit Testing framework for PicoLisp") ("source" "https://github.com/aw/picolisp-unit.git") ("author" "Alexander Williams") ("license" "MIT") - ("copyright" "(c) 2017 Alexander Williams, Unscramble ") ] + ("copyright" "(c) 2019 Alexander Williams, Unscramble ") ] diff --git a/reporters/default.l b/reporters/default.l index 9ec9d6b..39e9ee8 100644 --- a/reporters/default.l +++ b/reporters/default.l @@ -4,10 +4,6 @@ # # Copyright (c) 2017 Alexander Williams, Unscramble -(unless (= "false" (sys "PIL_NAMESPACES")) - (local *Colours print-report print-passed print-failed report-failed print-error) - (local print-expected print-got exit-gracefully) ) - (de *Colours ("red" . 1) ("green" . 2) ("yellow" . 3) diff --git a/reporters/plain.l b/reporters/plain.l index 3169969..5dc38bc 100644 --- a/reporters/plain.l +++ b/reporters/plain.l @@ -4,8 +4,6 @@ # # Copyright (c) 2017 Alexander Williams, Unscramble -(unless (= "false" (sys "PIL_NAMESPACES")) (local print-report)) - [de print-report () (mapcar println *Results) diff --git a/test.l b/test.l index c3a06db..011d605 100755 --- a/test.l +++ b/test.l @@ -1,8 +1,5 @@ #!/usr/bin/env pil -(unless (= "false" (sys "PIL_NAMESPACES")) - (when symbols (symbols 'unit 'pico)) ) - (load "unit.l") (chdir "test/" diff --git a/unit.l b/unit.l index ae36c03..a60b009 100644 --- a/unit.l +++ b/unit.l @@ -2,13 +2,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2017 Alexander Williams, Unscramble - -(unless (= "false" (sys "PIL_NAMESPACES")) - (when symbols (symbols 'unit 'pico)) - - (local MODULE_INFO *My_tests_are_order_dependent *Results) - (local randomize passed failed queue-results colour plural? get-results) ) +# Copyright (c) 2019 Alexander Williams, Unscramble (load (pack (car (file)) "module.l")) (load (pack (car (file)) "reporters/" (if (sys "TEST_REPORTER") @ "default") ".l"))