Skip to content

Commit 0ebfd84

Browse files
JongChernclaude
andcommitted
DEV-1134 The Rust core moves to its own repository
ShimmerProtocolCore/ is now ShimmerResearch/shimmer-protocol-core (private), with its history, the recordings and Java exports it is checked against, a C ABI, conformance traces and a Java binding. Its workflow goes with it. API_00031 keeps writing its Shimmer3 references to build/rust-reference, and checks them against that repository's tests/data where a checkout of it sits beside this one, as the team's layout puts it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a109401 commit 0ebfd84

25 files changed

Lines changed: 11 additions & 5150 deletions

‎.github/workflows/protocol-core.yml‎

Lines changed: 0 additions & 69 deletions
This file was deleted.

‎ShimmerDriverPC/src/test/java/com/shimmerresearch/protocol/API_00031_Shimmer3DecodeReferenceTest.java‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,30 @@
1212
import java.util.Comparator;
1313
import java.util.List;
1414

15-
import org.junit.Assume;
1615
import org.junit.Test;
1716

1817
import com.shimmerresearch.driver.FormatCluster;
1918
import com.shimmerresearch.driver.ObjectCluster;
2019

2120
/**
22-
* Keeps the Shimmer3 decode references of the Rust core ({@code ShimmerProtocolCore/tests/data/})
23-
* in step with the Java decoder (DEV-1134). The recorded Shimmer3 carries its own calibration and
21+
* Keeps the Shimmer3 decode references of the protocol core (the shimmer-protocol-core
22+
* repository's {@code tests/data/}) in step with the Java decoder (DEV-1134). The recorded Shimmer3 carries its own calibration and
2423
* the newer sensors, so its replay never exercises a Shimmer3's default calibrations, the older
2524
* sensors (KXRB5-2042, MPU9150, LSM303DLHC) or a calibration dump. Each case here takes the
2625
* recorded device's config bytes with InfoMem calibration blanked, gives it an expansion board
2726
* and a calibration dump, and decodes synthetic packets that also carry temperature and pressure,
2827
* whose sizes differ from a Shimmer3R's. Each file holds the inputs as hex and every channel of
2928
* every decoded packet.
3029
* <p>
31-
* Fails if a file is stale. The current output is always written to
32-
* {@code build/rust-reference/}; copy it over the stale one. Skipped once the Rust core has moved
33-
* out of this repository.
30+
* The current output is always written to {@code build/rust-reference/}. Where the team's layout
31+
* puts a checkout of shimmer-protocol-core beside this repository's ({@code C:\dev\} holding both
32+
* {@code java\Shimmer-Java-Android-API} and {@code shimmer-protocol-core}), this fails if the
33+
* files there are stale: copy the current output over them. Without that checkout, as in CI, only
34+
* the output is written.
3435
*/
3536
public class API_00031_Shimmer3DecodeReferenceTest {
3637

37-
private static final File DATA = new File("../ShimmerProtocolCore/tests/data");
38+
private static final File DATA = new File("../../../shimmer-protocol-core/tests/data");
3839
private static final File CURRENT = new File("build/rust-reference");
3940

4041
private static final int ANALOG_ACCEL = 2, MPU9X50_GYRO = 30, LSM303_MAG = 32;
@@ -70,7 +71,6 @@ public void newerSensorsWithACalibrationDump() throws Exception {
7071
}
7172

7273
private static void check(String name, byte[] expansionBoard, byte[] dump) throws Exception {
73-
Assume.assumeTrue("the Rust core is not in this repository", DATA.getParentFile().isDirectory());
7474
LogAndStreamProtocol recorded = new LogAndStreamProtocol();
7575
ProtocolReplay.run(recorded, RecordedSession.load(API_00027_LogAndStreamProtocolMatchesDriverTest.SHIMMER3_SESSION));
7676
byte[] config = recorded.getDeviceModel().getShimmerInfoMemBytesOriginal().clone();
@@ -137,6 +137,9 @@ private static void check(String name, byte[] expansionBoard, byte[] dump) throw
137137
current.getParentFile().mkdirs();
138138
Files.write(current.toPath(), text.getBytes(StandardCharsets.UTF_8));
139139

140+
if (!DATA.isDirectory()) {
141+
return; // no shimmer-protocol-core checkout beside this one
142+
}
140143
// git may have checked the file out with CRLF line endings.
141144
String committed = reference.isFile()
142145
? new String(Files.readAllBytes(reference.toPath()), StandardCharsets.UTF_8).replace("\r\n", "\n")

‎ShimmerProtocolCore/.gitignore‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)