Thread (1 message) 1 message, 1 author, 2023-09-09

Re: [PATCH v3 6/6] git-std-lib: add test file to call git-std-lib.a functions

From: Junio C Hamano <hidden>
Date: 2023-09-09 05:26:45

Calvin Wan [off-list ref] writes:
+
+test-git-std-lib:
+	cc -It -o stdlib-test stdlib-test.c -L. -l:../git-std-lib.a
Yuck, no.  Try to share as much with the main Makefile one level up.
quoted hunk
+	./stdlib-test
diff --git a/t/stdlib-test.c b/t/stdlib-test.c
new file mode 100644
index 0000000000..76fed9ecbf
--- /dev/null
+++ b/t/stdlib-test.c
@@ -0,0 +1,231 @@
+#include "../git-compat-util.h"
+#include "../abspath.h"
+#include "../hex-ll.h"
+#include "../parse.h"
+#include "../strbuf.h"
+#include "../string-list.h"
Use -I.. or something, to match what the main Makefile does, so that
you do not have to have these "../".  With -I.., you could even say

    #include <hex-ll.h>
    #include <parse.h>

etc.

+	// skip_to_optional_arg_default(const char *str, const char *prefix,
+	// 			 const char **arg, const char *def)
No // comments in this codebase, please.
+	strbuf_addchars(sb, 1, 1);
+	strbuf_addf(sb, "%s", "foo");
https://github.com/git/git/actions/runs/6126669144/job/16631124765#step:4:657
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help