Permalink
Browse files

Clean-up the functional tests

The files now use the new syntax, and Makefile call OPAM with the right options (til install so far).
  • Loading branch information...
1 parent 7eb79cf commit abc263060ce88ab4306fc63b01923c2eb08ba985 @samoht samoht committed May 9, 2012
Showing with 114 additions and 568 deletions.
  1. +50 −49 tests/Makefile
  2. +11 −0 tests/packages/P1-1.opam
  3. +1 −0 tests/packages/P1-1/README
  4. +6 −0 tests/packages/P1-2.opam
  5. +0 −6 tests/packages/P1-2.spec
  6. +1 −0 tests/packages/P1-2/README
  7. +0 −12 tests/packages/P1.spec
  8. +7 −0 tests/packages/P2.opam
  9. +0 −13 tests/packages/P2.spec
  10. 0 tests/packages/{P2-1 → P2}/P2.config
  11. 0 tests/packages/{P2-1 → P2}/P2.install
  12. +4 −0 tests/packages/P2/README
  13. 0 tests/packages/{P2-1 → P2}/build.sh
  14. 0 tests/packages/{P2-1 → P2}/p2.ml
  15. +7 −0 tests/packages/P3.opam
  16. +0 −7 tests/packages/P3.spec
  17. 0 tests/packages/{P3-1~weird.version → P3}/P3.config
  18. 0 tests/packages/{P3-1~weird.version → P3}/P3.install
  19. +1 −0 tests/packages/P3/README
  20. 0 tests/packages/{P3-1~weird.version → P3}/build.sh
  21. 0 tests/packages/{P3-1~weird.version → P3}/myocamlbuild.ml
  22. 0 tests/packages/{P3-1~weird.version → P3}/p3.ml
  23. 0 tests/packages/{P3-1~weird.version → P3}/p3_bar.ml
  24. +7 −0 tests/packages/P4-1.opam
  25. +11 −0 tests/packages/P4-2.opam
  26. +0 −12 tests/packages/P4-2.spec
  27. +7 −0 tests/packages/P4-3.opam
  28. +0 −11 tests/packages/P4-3.spec
  29. +0 −10 tests/packages/P4-3_build.sh
  30. +0 −7 tests/packages/P4.spec
  31. 0 tests/packages/{P4-1 → P4}/P4.install
  32. +1 −0 tests/packages/P4/README
  33. 0 tests/packages/{P4-1 → P4}/_tags
  34. 0 tests/packages/{P4-1 → P4}/build.sh
  35. 0 tests/packages/{P4-1 → P4}/p4.ml
  36. +0 −8 tests/packages/bootstrap/cudf.install
  37. +0 −25 tests/packages/bootstrap/cudf.ocp.boot
  38. +0 −13 tests/packages/bootstrap/cudf.spec
  39. +0 −25 tests/packages/bootstrap/dose.install
  40. +0 −58 tests/packages/bootstrap/dose.ocp.boot
  41. +0 −13 tests/packages/bootstrap/dose.spec
  42. +0 −8 tests/packages/bootstrap/extlib.install
  43. +0 −29 tests/packages/bootstrap/extlib.ocp.boot
  44. +0 −10 tests/packages/bootstrap/extlib.spec
  45. +0 −8 tests/packages/bootstrap/ocamlarg.install
  46. +0 −10 tests/packages/bootstrap/ocamlarg.ocp.boot
  47. +0 −10 tests/packages/bootstrap/ocamlarg.spec
  48. +0 −6 tests/packages/bootstrap/ocamlgraph.install
  49. +0 −45 tests/packages/bootstrap/ocamlgraph.ocp.boot
  50. +0 −10 tests/packages/bootstrap/ocamlgraph.spec
  51. +0 −8 tests/packages/bootstrap/ocamlre.install
  52. +0 −16 tests/packages/bootstrap/ocamlre.ocp.boot
  53. +0 −10 tests/packages/bootstrap/ocamlre.spec
  54. +0 −18 tests/packages/bootstrap/ocpget.install
  55. +0 −60 tests/packages/bootstrap/ocpget.ocp.boot
  56. +0 −14 tests/packages/bootstrap/ocpget.spec
  57. +0 −13 tests/packages/bootstrap/ocpgetboot.install
  58. +0 −10 tests/packages/bootstrap/ocpgetboot.ocp.boot
  59. +0 −14 tests/packages/bootstrap/ocpgetboot.spec
View
@@ -1,34 +1,32 @@
-# Make sure to have ocp-get-server running before launchin the tests
-LOCALHOST ?= 127.0.0.1
-
# never use /tmp
# should be absolute
TEST_DIR=/tmp
-OPAM_ROOT = $(TEST_DIR)/OPAM.CLIENT
-OPAM_SERVER_ROOT = $(TEST_DIR)/OPAM.SERVER
-BIN = $(TEST_DIR)/OPAM.BIN
+OPAM_ROOT = $(TEST_DIR)/OPAM.CLIENT
+OPAM_REPO = $(TEST_DIR)/OPAM.REPO
+BIN = $(TEST_DIR)/OPAM.BIN
+REPO = test
-# ocp-get in the path should not be a requirement
-ENV = OCAMLRUNPARAM=b OPAM_ROOT=$(OPAM_ROOT) PATH=$(BIN):$(PATH)
-OCPGET = $(ENV) ocp-get --debug --root $(OPAM_ROOT)
-OCPGET_SERVER = $(ENV) ocp-get-server --debug --root $(OPAM_SERVER_ROOT)
+BINARIES = opam opam-rsync-init opam-rsync-update opam-rsync-download opam-rsync-upload
+PACKAGES = P1-1 P1-2 P2 P3 P4
-PACKAGES = P1-1 P1-2 P2-1 P2-1 P3-1~weird.version P4-1
+# opam in the path should not be a requirement
+ENV = OCAMLRUNPARAM=b OPAMDEBUG=1 OPAM_ROOT=$(OPAM_ROOT) PATH=$(BIN):$(PATH)
+OPAM = $(ENV) opam --root $(OPAM_ROOT)
-ARCHIVES = $(PACKAGES:%=packages/%.tar.gz)
+BINARIES_ = $(BINARIES:%=$(BIN)/%)
+BUILDS = $(foreach bin, $(BINARIES), ../_obuild/$(bin)/$(bin).asm)
+ARCHIVES = $(PACKAGES:%=packages/%.tar.gz)
.PHONY: all upload
all: fresh init upload list install upload-new upgrade downgrade ocpbuild remove
@
-$(BIN)/ocp-get: ../ocp-get
- mkdir -p $(BIN)
- cp ../ocp-get $(BIN)/ocp-get
-
-$(BIN)/ocp-get-server: ../ocp-get-server
+$(BINARIES_): $(BUILDS)
mkdir -p $(BIN)
- cp ../ocp-get-server $(BIN)/ocp-get-server
+ for bin in $(BINARIES); do \
+ cp ../_obuild/$$bin/$$bin.asm $(BIN)/$$bin ; \
+ done
$(BIN)/ocp-build: ../_obuild/unixrun
mkdir -p $(BIN)
@@ -37,52 +35,55 @@ $(BIN)/ocp-build: ../_obuild/unixrun
echo 'exec $(BIN)/unixrun $(BIN)/ocp-build.boot "$$@"' > $(BIN)/ocp-build
chmod +x $(BIN)/ocp-build
-runserver: fresh $(BIN)/ocp-get-server
- $(OCPGET_SERVER)
-
-init: fresh $(BIN)/ocp-get
- $(OCPGET) init $(LOCALHOST)
+init: fresh $(BIN)/opam $(SCRIPTS:%=$(BIN)/%)
+ mkdir $(OPAM_REPO)
+ mkdir $(OPAM_REPO)/opam
+ mkdir $(OPAM_REPO)/descr
+ mkdir $(OPAM_REPO)/archive
+ $(OPAM) init $(REPO) $(OPAM_REPO)
ocpbuild: $(BIN)/ocp-build
upload: $(ARCHIVES) init
- cd packages && $(OCPGET) upload P1
- cd packages && $(OCPGET) upload P2
- cd packages && $(OCPGET) upload P3
- cd packages && $(OCPGET) upload P4
+ cd packages && \
+ $(OPAM) upload -opam P1-1.opam -descr P1-1/README -archive P1-1.tar.gz -repo $(REPO)
+ cd packages && \
+ $(OPAM) upload -opam P2.opam -descr P2/README -archive P2.tar.gz -repo $(REPO)
+ cd packages && \
+ $(OPAM) upload -opam P3.opam -descr P3/README -archive P3.tar.gz -repo $(REPO)
+ cd packages && \
+ $(OPAM) upload -opam P4-1.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
+ $(OPAM) update # update the list of available packages with the one being upadated
list: upload
- $(OCPGET) list
+ $(OPAM) list
remove: upload
- cd packages && $(OCPGET) install P1
- cd packages && $(OCPGET) remove P1
+ cd packages && $(OPAM) install P1
+ cd packages && $(OPAM) remove P1
install: remove upload
- $(OCPGET) install P1
- $(OCPGET) install P2
- $(OCPGET) install P3
- $(OCPGET) install P4
+ $(OPAM) install P1
+ $(OPAM) install P2
+ $(OPAM) install P3
+ $(OPAM) install P4
upload-new: install
- cd packages && $(OCPGET) upload P1-2.spec
- cd packages && $(OCPGET) upload P4-2.spec
- cd packages && $(OCPGET) upload P4-3.spec
+ cd packages && \
+ $(OPAM) upload -opam P1-2.opam -descr P1-2/README -archive P1-2.tar.gz -repo $(REPO)
+ cd packages && \
+ $(OPAM) upload -opam P4-2.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
+ cd packages && \
+ $(OPAM) upload -opam P4-3.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
upgrade: upload-new
- $(OCPGET) list
- $(OCPGET) upgrade
- $(OCPGET) list
+ $(OPAM) list
+ $(OPAM) upgrade
+ $(OPAM) list
downgrade: upgrade
- $(OCPGET) install P4-2
- $(OCPGET) list
-
-ocpget_upload: fresh init ocpbuild
- cd packages/bootstrap && for i in *spec ; do $(OCPGET) upload $$i ; done
-
-ocpget: ocpget_upload
- $(OCPGET) install ocpget
+ $(OPAM) install P4.2
+ $(OPAM) list
packages/%.tar.gz: packages/% packages/%/*
cd packages && tar cz $* > $*.tar.gz
@@ -91,4 +92,4 @@ clean:
rm -f $(ARCHIVES)
fresh:
- rm -rf $(OPAM_ROOT) $(OPAM_SERVER_ROOT) $(BIN)
+ rm -rf $(OPAM_ROOT) $(OPAM_REPO) $(BIN)
View
@@ -0,0 +1,11 @@
+(* API version *)
+opam-version: "1"
+
+package "P1" {
+
+ (* Version are arbitrary strings *)
+ version: "1"
+
+ maintainer: "contact@ocamlpro.com"
+
+}
@@ -0,0 +1 @@
+A very useful package
View
@@ -0,0 +1,6 @@
+opam-version: 1
+
+package "P1" {
+ version: "2"
+ maintainer: "contact@ocamlpro.com"
+}
View
@@ -1,6 +0,0 @@
-@1
-
-package "P1" {
- version = "2"
- description = "A very useful package"
-}
@@ -0,0 +1 @@
+A very useful package
View
@@ -1,12 +0,0 @@
-(* This is the way to express the API version *)
-@1
-
-(* This is the way to define a new package *)
-package "P1" {
-
- (* Version are arbitrary strings *)
- version = "1"
-
- description =
- "A very useful package"
-}
View
@@ -0,0 +1,7 @@
+opam-version: "1"
+
+package "P2" {
+ version: "1"
+ maintainer: "contact@ocamlpro.com"
+ depends: [ "P1" ]
+}
View
@@ -1,13 +0,0 @@
-@1
-
-package "P2" {
- version = "1"
- description =
- "An other very useful package.\
-
- The description can go on multiple lines but they\
- need to be escaped correclty (see the '\\' character\
- at the end of the lines."
-
- depends = [ [ ["P1"] ] ]
-}
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,4 @@
+An other very useful package
+
+The description can go on multiple lines. The first line is the package synopsis,
+and the rest is the package description.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,7 @@
+opam-version: "1"
+
+package "P3" {
+ version: "1~weird-version.test"
+ maintainer: "contact@ocamlpro.com"
+ depends: [ "P1" ]
+}
View
@@ -1,7 +0,0 @@
-@1
-
-package "P3" {
- version = "1~weird.version"
- description = "Testing version names"
- depends = [ [ ["P1"] ] ]
-}
View
@@ -0,0 +1 @@
+Testing version names
File renamed without changes.
View
@@ -0,0 +1,7 @@
+opam-version: "1"
+
+package "P4" {
+ version: "1"
+ maintainer: "contact@ocamlpro.com"
+ depends: [ "P2" "P3" ]
+}
View
@@ -0,0 +1,11 @@
+opam-version: "1"
+
+package "P4" {
+ version: "2"
+ maintainer: "contact@ocamlpro.com"
+ depends: [
+ "P1" { = "1" }
+ "P2"
+ "P3"
+ ]
+}
View
@@ -1,12 +0,0 @@
-@1
-
-package "P4" {
- version = "2"
- description = "Testing constraints"
- patches = [ "http://www.ocamlpro.com/pub/p4.tar.gz"
- ; [ "file://P4-3_build.sh" ; "./P4-2_build.sh" ] ]
- make = [ # Sys.command "./P4-2_build.sh" # ]
- depends = [ [ ["P1";"=";"1"] ]
- ; [ ["P2"] ]
- ; [ ["P3"] ] ]
-}
View
@@ -0,0 +1,7 @@
+opam-version: "1"
+
+package "P4" {
+ version: "3"
+ description: "Testing constraints"
+ depends: [ "P2" "P3" ]
+}
View
@@ -1,11 +0,0 @@
-@1
-
-package "P4" {
- version = "3"
- description = "Testing transitive closure"
- sources = [ "http://www.ocamlpro.com/pub/p4.tar.gz" ]
- patches = [ "http://www.ocamlpro.com/pub/p4.diff"
- ; "file://P4-3_build.sh" ]
- make = [ # Sys.command "./P4-3_build.sh" # ]
- depends = [ [ ["P2"] ] ; [ ["P3"] ] ]
-}
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-OCPGET="ocp-get --root ${OPAM_ROOT}"
-INCLUDES0="`${OCPGET} config -r -I P2 P3`"
-LINK0="`${OCPGET} config -r -asmlink P2 P3`"
-
-INCLUDES=${INCLUDES0// /,}
-LINK=${LINK0// /,}
-
-ocamlbuild -cflags ${INCLUDES} -lflags ${LINK} p4.native
View
@@ -1,7 +0,0 @@
-@1
-
-package "P4" {
- version = "1"
- description = "Testing transitive closure"
- depends = [ [ ["P2"] ] ; [ ["P3"] ] ]
-}
File renamed without changes.
View
@@ -0,0 +1 @@
+Testing transitive closure
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,8 +0,0 @@
-install "cudf" {
- lib = [
- "_obuild/cudf/*.cma";
- "_obuild/cudf/*.cmxa";
- "_obuild/cudf/*.a";
- "_obuild/cudf/*.cmi";
- ]
-}
@@ -1,25 +0,0 @@
-comp = [ "-g" ]
-link = [ "-g" ]
-
-begin library "cudf"
- sort = true
- files = [
- (*"main_cudf_parse_822.ml"
- "main_cudf_check.ml"*)
- "cudf_types_pp.ml"
- "cudf_types.ml"
- "cudf_type_parser.mly"
- "cudf_type_lexer.mll"
- "cudf_printer.ml"
- "cudf_parser.ml"
- "cudf_conf.ml"
- "cudf_checker.ml"
- "cudf_c.ml"
- "cudf_822_parser.mly"
- "cudf_822_lexer.mll"
- "cudf.ml"
- ]
- requires = [
- "extlib"
- ]
-end
@@ -1,13 +0,0 @@
-@1
-
-package "cudf" {
- version = "0.6.2"
- description = "http://www.mancoosi.org/reports/tr3.pdf"
- patches = [ "http://www.ocamlpro.com/pub/cudf.tar.bz2"
- ; "local://cudf.install"
- ; "local://cudf.ocp.boot" ]
- make = [ # Sys.command (Printf.sprintf "for i in extlib ; do echo 'begin library \"'$i'\" dirname = \"'$(ocp-get %s config -I $i | cut -d ' ' -f 2)'\" end' >> cudf.ocp ; done" (match try Some (Unix.getenv "OPAM_ROOT") with Not_found -> None with None -> "" | Some s -> "--root " ^ s)) #
- ; # Sys.command "cat cudf.ocp.boot >> cudf.ocp" #
- ; # let exec s a = Unix.execvp s (Array.append [|s|] a) in exec "ocp-build" [| "-init" ; "-scan" |] # ]
- depends = [ [ ["extlib"] ] ]
-}
@@ -1,25 +0,0 @@
-install "dose" {
- lib = [
- "_obuild/dose/*.cma";
- "_obuild/dose/*.cmxa";
- "_obuild/dose/*.a";
- "_obuild/dose/*.cmi";
-
-(* warning : at copy, we may conserve the structure *)
-
- "_obuild/dose/Algo/*.cma";
- "_obuild/dose/Algo/*.cmxa";
- "_obuild/dose/Algo/*.a";
- "_obuild/dose/Algo/*.cmi";
-
- "_obuild/dose/Common/*.cma";
- "_obuild/dose/Common/*.cmxa";
- "_obuild/dose/Common/*.a";
- "_obuild/dose/Common/*.cmi";
-
- "_obuild/dose/Debian/*.cma";
- "_obuild/dose/Debian/*.cmxa";
- "_obuild/dose/Debian/*.a";
- "_obuild/dose/Debian/*.cmi";
- ]
-}
Oops, something went wrong.

0 comments on commit abc2630

Please sign in to comment.