I managed to install CLIPS 6.30 on my Linux system, but I want to utilise CLIPS's existing test function to testing whether it's running correctly. Does it have an existing test function? How to use it? By 'make test'?
The test suite is in the svn repository here: http://clipsrules.svn.sourceforge.net/viewvc/clipsrules/test_suite/
To run the tests, launch CLIPS in the same directory and execute a (batch "testall.tst") command. When execution completes you can look at the *.rsl files for the results. If difference occurs you can use a diff program to compare the associate output file (.out) with the expected output file (.exp).
Thank you for your timely reply. Actually, I have tried the test suite you mentioned before I posted my question on the forum - I copied the entire folder 'test_suite' to my compiled CLIPS project directory, and then ran ./testall.tst in the command line. But an error message says:
./testall.tst: line 1: set-dynamic-constraint-checking: command not found
./testall.tst: line 2: set-sequence-operator-recognition: command not found
./testall.tst: line 3: set-static-constraint-checking: command not found
./testall.tst: line 4: set-reset-globals: command not found
./testall.tst: line 5: set-auto-float-dividend: command not found
./testall.tst: line 6: set-fact-duplication: command not found
./testall.tst: line 7: set-incremental-reset: command not found
./testall.tst: line 8: set-salience-evaluation: command not found
./testall.tst: line 9: set-strategy: command not found
The files /Users/***/SVNCheckout/try/test_suite/Results/testall.rsl, /Users/***/SVNCheckout/try/test_suite/testall, and /Users/***/SVNCheckout/try/test_suite/w do not exist.
./testall.tst: line 11: printout: command not found
./testall.tst: line 13: release-mem: command not found
./testall.tst: line 14: syntax error near unexpected token `('
./testall.tst: line 14: `(printout testall "Memory use: " (mem-used) crlf)'
To run the tests, launch CLIPS in the same directory and execute a (batch "testall.tst") command.
CLIPS (Quicksilver Beta 5/31/08)
CLIPS> (batch testall.tst)
I get a little confusion here. The autotools provides us a 'make check' function to test our buildups of projects. And it runs usually after installation and before launch the executable. However, CLIPS's self test suite operates on CLIPS> command line. It seems the self test suite works separately from 'make check' by using own test packages.
Is that right?
Or can I integrate the CLIPS existing test suite into 'make check' target?
I'm not familiar with autotools or "make check". The test cases are designed to work in non-unix environments, so I haven't done any work to integrate them with the makefile.
Thanks for your reply Gary.
I tried to embed the test instances into CLIPS, but as the Advanced Programming Guide (APG) mentions, I have to recompile all source codes with the new function, and relink all object codes to build a new executable.
But is there a way that we can fire this rule / run this command "(batch testall.tst)" in the test suite, but without launching the CLIPS executable? i.e. I don't want to run ./clips first and then type this command, I want to write it to makefile as well.
Probably that could be writing a C file which can pass this command to CLIPS?
Thank you for help.
clips -f testall.tst
This functionality is described in section 2.1.2 of the Basic Programming Guide, Automated Command Entry and Loading
2.1.2 Automated Command Entry and Loading