Development
Code style: 4-space indent. See the existing code. All exported predicates must start with the bc_
prefix and must be documented
using the pldoc syntax.
Running tests
Load with tests:
swipl -s tests/tests.pl
To run tests:
?- run_tests.
If you have failing tests, you are likely to get
... lots of log text
. done
% 1 assertion failed
% 1 test failed
% 82 tests passed
false.
Because of the log output you cannot see which test failed. To work around the issue you need to disable debug topics:
?- nodebug(_).
Then re-running tests reveals:
?- run_tests.
% PL-Unit: api_config ....... done
% PL-Unit: api_user ....
....
ERROR: /home/raivo/blog-core/tests/api_user.pl:46:
test New user, invalid type: assertion failed
Assertion: plunit_api_user:is_invalid_data(_G987{message:"The user role is not valid.",status:"error"})
A....................... done
% PL-Unit: api_entry ...................... done
% PL-Unit: api_comment ................ done
% PL-Unit: files .. done
% PL-Unit: view .... done
% 1 assertion failed
% 1 test failed
% 82 tests passed
false.
To enable reporting of server errors, use:
?- debug(http(request)).
Building admin UI
Build tools are installed through NPM:
cd admin
npm install
Then the admin bundle can be built using:
make