Skip to content

Commit

Permalink
Remove namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aw committed Apr 18, 2019
1 parent 169cf8f commit fe1689b
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Alexander Williams, Unscramble <[email protected]>
Copyright (c) 2019 Alexander Williams, Unscramble <[email protected]>

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
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# picolisp-unit Makefile

.PHONY: all

all: check

check:
@for i in plain default; do TEST_REPORTER="$$i" ./test.l; done
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions module.l
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>") ]
("copyright" "(c) 2019 Alexander Williams, Unscramble <[email protected]>") ]
4 changes: 0 additions & 4 deletions reporters/default.l
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# Copyright (c) 2017 Alexander Williams, Unscramble <[email protected]>

(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)
Expand Down
2 changes: 0 additions & 2 deletions reporters/plain.l
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#
# Copyright (c) 2017 Alexander Williams, Unscramble <[email protected]>

(unless (= "false" (sys "PIL_NAMESPACES")) (local print-report))

[de print-report ()
(mapcar println *Results)

Expand Down
3 changes: 0 additions & 3 deletions test.l
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env pil

(unless (= "false" (sys "PIL_NAMESPACES"))
(when symbols (symbols 'unit 'pico)) )

(load "unit.l")

(chdir "test/"
Expand Down
8 changes: 1 addition & 7 deletions unit.l
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Alexander Williams, Unscramble <[email protected]>

(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 <[email protected]>

(load (pack (car (file)) "module.l"))
(load (pack (car (file)) "reporters/" (if (sys "TEST_REPORTER") @ "default") ".l"))
Expand Down

0 comments on commit fe1689b

Please sign in to comment.