artemyarulin / clojure-clojurescript-buck

Set of macroses for Buck build system that allows building Clojure and ClojureScript
MIT License
23 stars 0 forks source link

Sort our targets #13

Closed artemyarulin closed 8 years ago

artemyarulin commented 8 years ago

Currently we have only one build target that builds tests as well.

If we build dependencies graph it would look like module depends on actual dependencies plus test dependencies, while test dependencies is needed only for testing.

So, the end result (including #6) should look like: Build targets:

If main specified additionally:

Test targets:

Two additional macros should be created clj_test and cljs_test. We should continue support tests/test_modules/test_dependencies in clj(s)_module as it's useful shortcut and covers the most often case. Although it should be possible to created additional test targets for the cases like integration test, performance, etc.

Example:

clj_module(name = 'integration',
           target = ':example.src',
           src = ['integration_test.clj'])

which additionally should produce build target :example.build_test_integration and test target :example.test_integration

Alternative way could be to support multiple test targets inside clj(s)_module, something like:

clj_module('example',
           test_modules = ['//test-helper/a','//test-helper/b'],
           test_deps = ['[some-test-dep "0.0.1"'],
           tests = {'unit':['unit_test.clj'],
                    'integration':['integration_test.clj']})