This is unofficial repository for SMLUnit.
If you get official information, see http://www.pllab.riec.tohoku.ac.jp/smlsharp/?SMLUnit .
- This is not official repository.
- There is no relationship with SML# deveploment team or Tohoku University.
- A general unit testing frame work for SML system(# is not required)
- This is imported from SML#v3.6.0 unofficial repository (https://github.com/smlsharp/smlsharp/tree/v3.6.0)
- This framework support SML#, SML/NJ, MLton and Poly/ML explicitly
Build object files with Make
:
$ make
Makefile:56: Assert.d: No such file or directory
Makefile:56: SMLUnit.d: No such file or directory
Makefile:56: Test.d: No such file or directory
Makefile:56: TextUITestRunner.d: No such file or directory
GEN [TextUITestRunner.d]
GEN [Test.d]
GEN [SMLUnit.d]
GEN [Assert.d]
SML# [Assert.o]
SML# [SMLUnit.o]
SML# [Test.o]
SML# [TextUITestRunner.o]
then, you can use smlunit-lib
from any other projects.
For using from other project, refer to smlunit-lib.smi
:
(* test_foo.smi *)
..
(* refer to this library *)
_require "smlunit-lib.smi"
..
Build the project with -I
and -L
flags.
$ smlsharp -I/path/to/smlunit -L/path/to/smlunit -o test_foo test_foo.smi
To install SMLUnit for SML/NJ, run make install
with Makefile.smlnj
:
$ make -f Makefile.smlnj install
Above command install SMLUnit to /usr/local/sml
.
This install location can be set with PREFIX
variable like:
$ make -f Makefile.smlnj install PREFIX=~/.sml/smlnj/110.99
The install
target uses SMLDoc to generate the documentations for SMLUnit.
If you do not need to generate documentation, run the install-nodoc
target.
$ make -f Makefile.smlnj install-nodoc
After running the install
or install-nodoc
target, add an entry for smlunit-lib.cm
to the pathconfig file to complete the installation.
$ echo 'smlunit-lib.cm /usr/local/smlnj/lib/smlunit-lib.cm' >> ~/.smlnj-pathconfig
or
$ echo 'smlunit-lib.cm PREFIX/lib/smlunit-lib.cm' >> ~/.smlnj-pathconfig
To run unit tests, run the test
target:
$ make -f Makefile.smlnj test
Depending on the test case, it will fails.
To run the example program, run the example
target:
$ make -f Makefile.smlnj example
To install SMLUnit for MLton, run make install
with Makefile.mlton
:
$ make -f Makefile.mlton install
Above command install SMLUnit to /usr/local/mlton
.
This install location can be set with PREFIX
variable like:
$ make -f Makefile.mlton PREFIX=~/.sml/mlton install
The install
target uses SMLDoc to generate the documentations for SMLUnit.
If you do not need to generate documentation, run the install-nodoc
target.
$ make -f Makefile.mlton install-nodoc
After running the install
target, add an entry for SMLUNIT_LIB
to your mlb path mapping file to complete the installation.
$ echo 'SMLUNIT_LIB /path/to/$PREFIX' >> /path/to/mlb-path-map
For using SMLUnit, refer to $(SMLUNIT_LIB)/smlunit-lib.mlb
from your MLB file.
$(SML_LIB)/basis/basis.mlb
$(SMLUNIT_LIB)/smlunit-lib.mlb
.
.
To run unit tests, run the test
target:
$ make -f Makefile.mlton test
Depending on the test case, it will fails.
To run the example program, run the example
target:
$ make -f Makefile.smlnj example
To install SMLUnit for Poly/ML, run make install
with Makefile.polyml
.
$ make -f Makefile.polyml install
Above command install SMLUnit to /usr/local/polyml
.
This install location can be set with PREFIX
variable like:
$ make -f Makefile.polyml PREFIX=~/.sml/polyml/5.8.1 install
The install
target uses SMLDoc to generate the documentations for SMLUnit.
If you do not need to generate documentation, run the install-nodoc
target.
$ make -f Makefile.polyml install-nodoc
Then you will get smlunit-lib.poly
in PREFIX/lib/smlunit-lib
which is the collection of SMLUnit entities.
It is possible to load directly into the REPL:
$ poly
> PolyML.loadModule "/path/to/smlunit-lib.poly";
signature ASSERT =
sig
..
signature TESTRUNNER =
sig type parameter val runTest: parameter -> Test.test -> unit end
val it = (): unit
To run unit tests, run the test
target:
$ make -f Makefile.polyml test
Depending on the test case, it will fails.
To run the example program, run the example
target:
$ make -f Makefile.polyml example