@@ -20,22 +20,25 @@ Installation instructions are [here][BINDGEN_INSTALL].
2020
2121### 2. Build!
2222
23- You can use Couchbase Lite C community or entreprise editions:
23+ There two different editions of Couchbase Lite C: community & enterprise.
24+ You can find the differences [ here] [ CBL_EDITIONS_DIFF ] .
25+
26+ When building or declaring this repository as a dependency, you need to specify the edition through a cargo feature:
2427
2528``` shell
26- $ cargo build --features=enterprise
29+ $ cargo build --features=community
2730```
2831
2932``` shell
30- $ cargo build --features=community
33+ $ cargo build --features=enterprise
3134```
3235
3336## Maintaining
3437
3538### Couchbase Lite For C
3639
3740The Couchbase Lite For C shared library and headers ([ Git repo] [ CBL_C ] ) are already embedded in this repo.
38- They are present in the directory ` libcblite ` .
41+ They are present in two directories, one for each edition: ` libcblite_community ` & ` libcblite_enterprise ` .
3942
4043### Upgrade Couchbase Lite C
4144
@@ -54,24 +57,39 @@ $ brew install wget
5457$ brew install bash
5558```
5659
57- After that, fix the compilation & tests and you can create a pull request.
60+ If the script was successful:
61+ - Change the link ` CBL_API_REFERENCE ` in this README
62+ - Change the version in the test ` couchbase_lite_c_version_test `
63+ - Update the version in ` Cargo.toml `
64+ - Fix the compilation in both editions
65+ - Fix the tests in both editions
66+ - Create pull request
5867
5968New C features should also be added to the Rust API at some point.
6069
6170### Test
6271
63- ** The unit tests must be run single-threaded.** This is because each test case checks for leaks by
64- counting the number of extant Couchbase Lite objects before and after it runs, and failing if the
65- number increases. That works only if a single test runs at a time.
72+ Tests can be found in the ` tests ` subdirectory.
73+ Test are run in the GitHub wrokflow ` Test ` . You can find the commands used there.
74+
75+ There are three variations:
76+
77+ ### Nominal run
78+
79+ ``` shell
80+ $ cargo test --features=enterprise
81+ ```
82+
83+ ### Run with Couchbase Lite C leak check
6684
6785``` shell
68- $ LEAK_CHECK=y cargo test -- --test-threads 1
86+ $ LEAK_CHECK=y cargo test --features=enterprise -- --test-threads 1
6987```
7088
71- ### Sanitizer
89+ ### Run with address sanitizer
7290
7391``` shell
74- $ LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS=" -Zsanitizer=address" cargo +nightly test
92+ $ LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS=" -Zsanitizer=address" cargo +nightly test --features=enterprise
7593```
7694
7795## Learning
@@ -96,6 +114,8 @@ $ LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nigh
96114
97115[ CBL_API_REFERENCE ] : https://docs.couchbase.com/mobile/3.2.1/couchbase-lite-c/C/html/modules.html
98116
117+ [ CBL_EDITIONS_DIFF ] : https://www.couchbase.com/products/editions/
118+
99119[ FLEECE ] : https://github.com/couchbaselabs/fleece/wiki/Using-Fleece
100120
101121[ BINDGEN ] : https://rust-lang.github.io/rust-bindgen/
0 commit comments