@@ -20,22 +20,25 @@ Installation instructions are [here][BINDGEN_INSTALL].
20
20
21
21
### 2. Build!
22
22
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:
24
27
25
28
``` shell
26
- $ cargo build --features=enterprise
29
+ $ cargo build --features=community
27
30
```
28
31
29
32
``` shell
30
- $ cargo build --features=community
33
+ $ cargo build --features=enterprise
31
34
```
32
35
33
36
## Maintaining
34
37
35
38
### Couchbase Lite For C
36
39
37
40
The 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 ` .
39
42
40
43
### Upgrade Couchbase Lite C
41
44
@@ -54,24 +57,39 @@ $ brew install wget
54
57
$ brew install bash
55
58
```
56
59
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
58
67
59
68
New C features should also be added to the Rust API at some point.
60
69
61
70
### Test
62
71
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
66
84
67
85
``` shell
68
- $ LEAK_CHECK=y cargo test -- --test-threads 1
86
+ $ LEAK_CHECK=y cargo test --features=enterprise -- --test-threads 1
69
87
```
70
88
71
- ### Sanitizer
89
+ ### Run with address sanitizer
72
90
73
91
``` 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
75
93
```
76
94
77
95
## Learning
@@ -96,6 +114,8 @@ $ LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nigh
96
114
97
115
[ CBL_API_REFERENCE ] : https://docs.couchbase.com/mobile/3.2.1/couchbase-lite-c/C/html/modules.html
98
116
117
+ [ CBL_EDITIONS_DIFF ] : https://www.couchbase.com/products/editions/
118
+
99
119
[ FLEECE ] : https://github.com/couchbaselabs/fleece/wiki/Using-Fleece
100
120
101
121
[ BINDGEN ] : https://rust-lang.github.io/rust-bindgen/
0 commit comments