mirror of
https://github.com/correl/riichi.git
synced 2024-11-23 19:19:55 +00:00
Add make target for eunit tests
This commit is contained in:
parent
cdb4334f6e
commit
38f87e3566
4 changed files with 28 additions and 4 deletions
11
Makefile
11
Makefile
|
@ -1,6 +1,15 @@
|
||||||
PROJECT = riichi
|
PROJECT = riichi
|
||||||
|
|
||||||
DEPS = reloader
|
DEPS = reloader eunit_formatters
|
||||||
dep_reloader = git https://github.com/oinksoft/reloader.git master
|
dep_reloader = git https://github.com/oinksoft/reloader.git master
|
||||||
|
dep_eunit_formatters = git https://github.com/seancribbs/eunit_formatters.git master
|
||||||
|
|
||||||
include erlang.mk
|
include erlang.mk
|
||||||
|
|
||||||
|
ifneq ($(wildcard test/),)
|
||||||
|
ebin/$(PROJECT).app:: $(shell find test -type f -name \*_tests.erl)
|
||||||
|
$(if $(strip $?),$(call compile_erl,$?))
|
||||||
|
endif
|
||||||
|
|
||||||
|
eunit: clean deps app
|
||||||
|
$(gen_verbose) erl -noshell -pa ebin -eval 'eunit:test({application, $(PROJECT)}, [no_tty, {report, {eunit_progress, [colored, profile]}}])' -s init stop
|
||||||
|
|
17
test/eunit_SUITE.erl
Normal file
17
test/eunit_SUITE.erl
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
-module(eunit_SUITE).
|
||||||
|
|
||||||
|
-include_lib("common_test/include/ct.hrl").
|
||||||
|
|
||||||
|
%% ct.
|
||||||
|
-export([all/0]).
|
||||||
|
|
||||||
|
%% Tests.
|
||||||
|
-export([eunit/1]).
|
||||||
|
|
||||||
|
%% ct.
|
||||||
|
|
||||||
|
all() ->
|
||||||
|
[eunit].
|
||||||
|
|
||||||
|
eunit(_) ->
|
||||||
|
ok = eunit:test({application, riichi}).
|
|
@ -1,6 +1,6 @@
|
||||||
-module(riichi_tests).
|
-module(riichi_tests).
|
||||||
|
|
||||||
-include("riichi.hrl").
|
-include("../include/riichi.hrl").
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
|
||||||
valid_tile_dragon_test_() ->
|
valid_tile_dragon_test_() ->
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
-module(riichi_yaku_tests).
|
-module(riichi_yaku_tests).
|
||||||
|
|
||||||
-compile(export_all).
|
|
||||||
|
|
||||||
-include("../include/riichi.hrl").
|
-include("../include/riichi.hrl").
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue