I need to install QCheck/SML unit test library for ML.
I could git clone the code, and create the .cm
file, but I'm not sure how to copy the generated file into where. The document simply says (http://contrapunctus.net/league/haques/qcheck/qcheck_2.html):
2.1 SML/NJ
For Standard ML of New Jersey, the CM library specification ‘qcheck.cm’ should be all you need. The default target of make -f Makefile.nj will ask CM to build and stabilize this library. This creates a file ‘.cm/x86-unix/qcheck.cm’ (alter the arch/os tag as needed) which may be copied into the standard CM library path and added to the ‘pathconfig’.
I used brew install smlnj
for the ML installation in Mac, so I have SMLNJ_HOME
at /usr/local/Cellar/smlnj/100.78/SMLNJ_HOME
.
What is the CM path library in this? In general, how to install a library into SML/NJ?
From Matt's answer, this is how I made it work.
/usr/local/Cellar/smlnj/110.78/SMLNJ_HOME/lib
.~/.smlnj-pathconfig
file.qcheck.cm /usr/local/Cellar/smlnj/110.78/SMLNJ_HOME/lib/qcheck
in the file. ~/.smlnj-pathconfig
can point to the directory. use "FILENAME";
is needed instead of CM.make
. The CM library path is located in SMLNJ_HOME/lib
. You can place the .cm
file here. The instructions say to modify the pathconfig
file, however, I would suggest creating a .smlnj-pathconfig
file in your home directory instead. You are going to want to then paste the following line into that file:
qcheck.cm <path to directory containing qcheck.cm file>
You can then reference this in one of your .cm files using the anchor name: $/qcheck.cm
. I've not used stabilized libraries before, and the generated .cm file is giving me a bunch of errors. If you instead use the qcheck.cm
file from the root directory of the qcheck repo, it seems to work for me. Perhaps someone else can comment on why I am getting these errors.