Makefile 937 B

123456789101112131415161718192021222324252627282930313233
  1. REBAR = rebar
  2. LASTVERSION = $(shell git rev-parse HEAD )
  3. all: compile
  4. compile:
  5. @$(REBAR) compile
  6. clean:
  7. @$(REBAR) clean
  8. # The INSERT is used to make sure the schema_version matches the tests
  9. # being run.
  10. create_testdbs:
  11. # Uses the test environment set up with setup_test_db.sh
  12. echo "CREATE DATABASE ${USER};" | psql -h 127.0.0.1 -p 10432 template1
  13. psql -h 127.0.0.1 -p 10432 template1 < ./test_data/test_schema.sql
  14. psql -h 127.0.0.1 -p 10432 epgsql_test_db1 -c "INSERT INTO schema_version (version) VALUES ('${LASTVERSION}');"
  15. test: compile
  16. @$(REBAR) eunit
  17. performance_test: compile
  18. erlc ./test/epgsql_perf_tests.erl
  19. erl -noshell -pa ./ebin -eval "eunit:test(epgsql_perf_tests, [verbose])" -run init stop
  20. dialyzer: build.plt compile
  21. dialyzer --plt $< ebin
  22. build.plt:
  23. dialyzer -q --build_plt --apps erts kernel stdlib ssl --output_plt $@
  24. .PHONY: all compile release clean create_testdbs performance_test test dialyzer