Skip to content

Commit

Permalink
check more enums
Browse files Browse the repository at this point in the history
  • Loading branch information
ygrek committed Nov 13, 2019
1 parent 2273ac4 commit 0f9d2e0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -24,7 +24,7 @@ examples/test_cb_exn
examples/test_lwt
examples/test_lwt_unit
examples/test_memory_leaks
examples/test_unit
examples/test_enum
/doc
/print_ext
/autom4te.cache
9 changes: 6 additions & 3 deletions Makefile.in
Expand Up @@ -2,7 +2,7 @@
### @configure_input@
###

.PHONY: all targets examples install clean distclean depend release doc build test reinstall
.PHONY: all targets examples install clean distclean depend release doc build test reinstall gen

.SUFFIXES: .ml .mli .cmx .cmi .cmo .cmxs .cmxa .cma .c @EXT_OBJ@

Expand Down Expand Up @@ -75,7 +75,10 @@ ifneq (@OCAML_PKG_lwt_unix@,no)
examples/test_lwt_unit.opt
endif
endif
examples/test_unit

gen: all
(cd examples; $(MAKE) test_enum)
examples/test_enum

doc:
mkdir -p doc
Expand All @@ -85,7 +88,7 @@ else
ocamldoc -html -d doc curl.mli
endif

examples:
examples: all
(cd examples; $(MAKE))

curl.cma: $(CURLBCOBJS) dllcurl-helper$(EXT_DLL)
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -38,6 +38,7 @@ Compile examples with `make -f Makefile.msvc examples`.
Making release
==============

* Check `make gen` with latest libcurl
* Update CHANGES.txt
* Update version in configure.ac
* autoreconf
Expand Down
6 changes: 6 additions & 0 deletions curl-helper.c
Expand Up @@ -4506,6 +4506,12 @@ struct used_enum check_enums[] = {
#if HAVE_DECL_CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE
CURL_ENUM(HTTP_VERSION, 2_PRIOR_KNOWLEDGE),
#endif
#if HAVE_DECL_CURLINFO_CERTINFO
{ CURLINFO_CERTINFO & CURLINFO_MASK, CURLINFO_LASTONE, "CURLINFO" },
#endif
#if HAVE_DECL_CURLE_AGAIN
{ CURLE_AGAIN, CURL_LAST, "CURLcode" }
#endif
};

value caml_curl_check_enums(value v_unit)
Expand Down
4 changes: 2 additions & 2 deletions examples/Makefile.in
Expand Up @@ -19,7 +19,7 @@ OCURLOPTLIB = curl.cmxa unix.cmxa threads.cmxa
LWT_UNIX=@OCAML_PKG_lwt_unix@
LWT_PPX=@OCAML_PKG_lwt_ppx@

TARGETS = ocurl ominimal ossl ocurl_test_threads opar test_cb_exn test_memory_leaks test_unit
TARGETS = ocurl ominimal ossl ocurl_test_threads opar test_cb_exn test_memory_leaks test_enum
ifneq (@OCAML_PKG_bytes@,no)
TARGETS += oput
endif
Expand All @@ -31,7 +31,7 @@ endif
endif

ifeq (@OCAMLBEST@,opt)
TARGETS += ocurl.opt ominimal.opt ossl.opt ocurl_test_threads.opt opar.opt test_cb_exn.opt test_memory_leaks.opt test_unit.opt
TARGETS += ocurl.opt ominimal.opt ossl.opt ocurl_test_threads.opt opar.opt test_cb_exn.opt test_memory_leaks.opt test_enum.opt
ifneq (@OCAML_PKG_bytes@,no)
TARGETS += oput.opt
endif
Expand Down
4 changes: 3 additions & 1 deletion examples/test_unit.ml → examples/test_enum.ml
Expand Up @@ -10,7 +10,9 @@ let () =
if last_used + 1 <> last then
begin
ok := false;
printfn "Need update for %s" name
printfn "%s : need update : used %d, last %d" name last_used last
end
else
printfn "%s : ok" name
end (check_enums ());
exit (if !ok then 0 else 1)

0 comments on commit 0f9d2e0

Please sign in to comment.