Silence redundant logging to stdout/stderr

Instead print log filename to stdout during startup.

CouchDB already logs everything to /var/log/couchdb/couch.log.
The stdout/stderr redundantly floods /var/log/messages.
This temporary hack was suggested by rnewson in #couchdb.
https://issues.apache.org/jira/browse/COUCHDB-2264
Related issue
Expand .d directories in erlang
Add systemd notification support

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>

Load module first

Function erlang:function_exported/3 looks only for modules already
loaded. So we have to load module first. We can do it either implicitly
by calling any function from the module (and catch for possible
exceptions if no such module available) or explicitly.

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Add run script to execute eunit tests

Usage is the same as for test/etap/run:

    ./test/couchdb/run -v ${PATH}

-v runs in verbose mode, as etap does. Also, you can use make for that:

    make check-eunit

which will run tests everywhere in project where Makefile contains
check-eunit subcommand definition.

The ${PATH} thing could be single file or directory. The latter should
contains *_tests.erl files which would be compiled and executed by
eunit.

The *_tests.erl

The reason of compiling on run instead of using autoconf for that is
to simplify tests developing and avoid situations, when you'd fixed
the test or add new one, but forgot to remove/compile beam file.

All test_*.beam files are been stored in test/couchdb/ebin directory,
the temporary test files will be places to test/couchdb/temp one.
Both directories will be removed by make clean/distclean command.

Add common header for eunit test files

Port 001-load.t etap test suite to eunit

Port 002-icu-driver.t etap test suite to eunit

See setup/0 comment for specific info about loading
couch_icu_driver with eunit.

Port 010-file-basics.t and 011-file-headers.t etap test suites to eunit

Both merged into single suite since they tests single target and shares
common bits.

Port 020-btree-basics.t and 021-btree-reductions.t etap suites to eunit

Both merged into single suite since they tests single target and shares
common bits.

Port 030-doc-from-json.t and 031-doc-to-json.t etap suites to eunit

Both merged into single suite since they tests single target and shares
common bits.

Port 040-util.t etap test suite to eunit

Port 041-uuid.t etap test suite to eunit

Config files are removed in favor of using couch_config API instead.

Port 042-work-queue.t etap test suite to eunit

Etap tests were made in flow style, testing the same things multiple
times without real need. For eunit they are split into small test cases
to focus on testing goals.

Timeout on receive is decreased from 3000 to 100.

Port 043-find-in-binary.t etap test suite to eunit

It been merged into couch_util_tests suite.

Port 050-stream.t etap test suite to eunit

Port 06[0-5]-kt-*.t etap test suites to eunit

All merged into single suite since they're test the same module.

Port 070-couch-db.t etap test suite to eunit

Fix ERL_LIB environment variable setting. Add ?tempdb macros for
unique temporary database name generation.

Port 072-cleanup.t etap test suite to eunit

requests functions from test_util were moved to test_request module
with nicer and simpler API.

Port 073-changes.t etap test suite to eunit

For heartbeats test they don't being counted anymore since their
amount is heavy depends from the overall system performance and some
assertions may fail or not because of that. Instead of this, we just
ensure that their amount is going to increase over the time.

Port 074-doc-update-conflicts.t etap test suite to eunit

Timeout decreased, added 10K clients case

Port 075-auth-cache.t etap test suite to eunit

Timeouts are removed.

Port 076-file-compression.t etap test suite to eunit

The original test suite was decoupled into compaction and comparison
cases.

Port 077-couch-db-fast-db-delete-create.t etap test suite to eunit

Merged into couch_db_tests suite.

Port 080-config-get-set.t etap test suite to eunit

Port 081-config-override.t etap test suite to eunit

Merged into couch_config_tests suite.
Setup fixtures.

Port 082-config-register.t etap test suite to eunit

Merged into couch_config_tests suite.

Port 083-config-no-files.t etap test suite to eunit

Merged into couch_config_tests suite.

Port 090-task-status.t etap test suite to eunit

Split huge test case into multiple ones. Fix issue with get_task_prop
when Acc may be reset if searched task isn't last in the list.

Port 100-ref-counter.t etap test suite to eunit

Port 120-stats-collect.t etap test suite to eunit

Port 121-stats-aggregates.t etap test suite to eunit

Merged into couch_stats_tests suite.

Port 130-attachments-md5.t etap test suite to eunit

Add random document id generator macros.
Have to use handmade http client instead of ibrowse since it makes too
complicated sending chunked requests.

Port 140-attachments-comp.t etap test suite to eunit

- Merge into couchdb_attachments_tests suite;
- Add PUT requests to test_request util;
- Remove dependency from files outside fixtures directory;
- Group test cases to reduce amount of duplicate code;
- Fix hidden issue with gzip encoding: for encoding_length stub info
  check using zlib:gzip on 2KiB+ files leads to mismatch by 2-4 bytes
  and this difference grows with file size. Using gzip fun code from
  couch_stream solves the issue.

Port 150-invalid-view-seq.t etap test suite to eunit

Merged into couchdb_views_tests suite.

Port 160-vhosts.t etap test suite to eunit

Split Rewrite and OAuth tests.

Port 170-os-daemons.t etap test suite to eunit

Port 171-os-daemons-config.t etap test suite to eunit

Merged into couchdb_os_daemons_tests suite.

Port 172-os-daemons-errors.t etap test suite to eunit

Merged into couchdb_os_daemons_tests suite.
Removed errors redirection to /dev/null to explicitly signal that
permissions are set correctly.

Port 173-os-daemons-cfg-register.t etap test suite to eunit

Merged into couchdb_os_daemons_tests suite.

Port 180-http-proxy.t etap test suite to eunit

Port 190-json-stream-parse.t etap test suite to eunit

Port 200-view-group-no-db-leaks.t etap test suite to eunit

Merged into couchdb_views_tests suite. Apply minor refactor changes.

Port 201-view-group-shutdown.t etap test suite to eunit

Merged into couchdb_views_tests suite. Database population reduced
to speedup test and removed second view index call which leaded to
race condition when compaction becomes completed in time of view index
update call and before assertion check for {error, all_dbs_active}.

Port 210-os-proc-pool.t etap test suite to eunit

Port 220-compaction-daemon.t etap test suite to eunit

Port 230-pbkfd2.t etap test suite to eunit

Port 231-cors.t etap test suite to eunit

Extend vhost and subresource testing for more generic code.

Port 232-csp.t etap test suite to eunit

Port 250-upgrade-legacy-view-files.t etap test suite to eunit

Run couchdb tests with eunit

Port couch_mrview/01-load.t etap test suite to eunit

Port couch_mrview/02-map-views.t etap test suite to eunit

Port couch_mrview/03-red-views.t etap test suite to eunit

Port couch_mrview/04-index-info.t etap test suite to eunit

Port couch_mrview/05-collation.t etap test suite to eunit

Port couch_mrview/06-all-docs.t etap test suite to eunit

Port couch_mrview/07-compact-swap.t etap test suite to eunit

Run couch_mrview tests with eunit

Port couch_replicator/01-load.t etap test suite to eunit

Port couch_replicator/02-httpc-pool.t etap test suite to eunit

Test test_worker_dead_pool_full removed as it's redundant.

Port couch_replicator/03-replication-compact.t etap test suite to eunit

Split big test fun into smaller steps, optimize timeouts.

Port couch_replicator/04-replication-large_atts.t etap test to eunit

Port couch_replicator/05-replication-many-leaves.t etap test to eunit

Port couch_replicator/06-doc-missing-stubs.t etap test suite to eunit

Port couch_replicator/07-use-checkpoints.t etap test to eunit

Run couch_replicator tests with eunit

Goodbye etap!

Add uuid for test server

Prevents it generation during tests running and failure for
make distcheck when config file is read only.

Fix tests temp directory path

Fix relative include path for couch_eunit.hrl

Move couch_eunit.hrl.in to include directory

Because include path "." has higher priority than any other custom
paths, generated during `configure` phase couch_eunit.hrl contains
build and source paths which aren't used for `make distcheck` causing
various failures.

Ensures that .test_design directory becomes created

Handle test_cfg_register daemon path in special way

During make distcheck test_cfg_register binary become separated from
others fixtures and becomes available by ?BUILDDIR path, not ?SOURCEDIR
as others are.

Simplify os_daemon_configer.escript

There is no need to start couch_config, init code paths and include
anything, just need to make ejson beams available.

More etap cleanup

Fix Makefile rules for `make distcheck`

Conflicts:
	configure.ac
	src/Makefile.am
	test/etap/Makefile.am
	test/etap/test_util.erl.in