Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

test: preserve LF in Windows build config output

astandrik3ab2994f3026
diff --git a/tests/test_main.c b/tests/test_main.c
index 720dd41fe..4aec2c266 100644
--- a/tests/test_main.c
+++ b/tests/test_main.c
@@ -921,17 +921,6 @@ extern void suite_dump_verify_io(void);
extern void cbm_kind_in_set_free_cache(void);
int main(int argc, char **argv) {
- /* Skip the multi-hundred-MB executable-image hash that computes the exact
- * build fingerprint: it is tens of seconds per spawned worker/daemon under
- * ASan on constrained CI runners and the sole cause of the daemon-family
- * readiness-timeout flakes. Set once here; every forked child and re-exec'd
- * worker inherits it, so exact-build match/mismatch still works (a
- * mismatch test still passes a DIFFERENT fingerprint via argv). Honoured
- * only under CBM_CLI_ENABLE_TEST_API — never in a production binary. */
- if (!getenv("CBM_TEST_BUILD_FINGERPRINT")) {
- (void)cbm_setenv("CBM_TEST_BUILD_FINGERPRINT",
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", 1);
- }
int memory_limit_probe_rc = tf_maybe_run_windows_memory_limit_probe(argc, argv);
if (memory_limit_probe_rc >= 0) {
return memory_limit_probe_rc;
@@ -947,6 +936,12 @@ int main(int argc, char **argv) {
return 0;
}
if (argc == 2 && strcmp(argv[1], "--build-config") == 0) {
+#ifdef _WIN32
+ if (_setmode(cbm_fileno(stdout), _O_BINARY) == -1) {
+ fprintf(stderr, "failed to set build-config stdout to binary mode\n");
+ return 2;
+ }
+#endif
#if defined(CBM_ENABLE_TEST_SEAMS) && CBM_ENABLE_TEST_SEAMS
const int test_seams = 1;
#else
@@ -955,6 +950,17 @@ int main(int argc, char **argv) {
(void)printf("sanitized=%d test_seams=%d\n", CBM_SANITIZED, test_seams);
return 0;
}
+ /* Skip the multi-hundred-MB executable-image hash that computes the exact
+ * build fingerprint: it is tens of seconds per spawned worker/daemon under
+ * ASan on constrained CI runners and the sole cause of the daemon-family
+ * readiness-timeout flakes. Set once here; every forked child and re-exec'd
+ * worker inherits it, so exact-build match/mismatch still works (a
+ * mismatch test still passes a DIFFERENT fingerprint via argv). Honoured
+ * only under CBM_CLI_ENABLE_TEST_API — never in a production binary. */
+ if (!getenv("CBM_TEST_BUILD_FINGERPRINT")) {
+ (void)cbm_setenv("CBM_TEST_BUILD_FINGERPRINT",
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", 1);
+ }
/* #1830 userns smoke probe -- see the test that spawns it.
*
* The ancestor overflow uid is derived ONCE per process (pthread_once in