Re: [PATCH v3 6/6] git-std-lib: add test file to call git-std-lib.a functions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 9, 2023, 05:26 UTC
- Message-ID
- <xmqqy1hfrk6p.fsf@gitster.g>
- In-Reply-To
- <20230908174443.1027716-6-calvinwan@google.com>
Calvin Wan <calvinwan@google.com> 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.
Show 13 quoted lines
> + ./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