Skip to content
Permalink
Browse files

Set up tests project using Rely (#50)

Summary:
Pull Request resolved: #50

Trying to set up reason native to use Rely. This works, but will need to confirm external setup.

Reviewed By: bandersongit

Differential Revision: D13475678

fbshipit-source-id: 6357dc969000e80b124a4f602724ce9257be5b70
  • Loading branch information...
kyldvs authored and facebook-github-bot committed Dec 17, 2018
1 parent 2c06f60 commit a12ab484fb60438c2a46aa91bb8d8402533147bb
3 dune
@@ -1 +1,2 @@
(ignored_subdirs (node_modules _esy _release))
(dirs :standard \ node_modules _esy _release)
(data_only_dirs node_modules _esy _release)
@@ -1 +1 @@
(lang dune 1.2)
(lang dune 1.6)
@@ -15,7 +15,7 @@
"overrides": [],
"dependencies": [
"ocaml@4.6.9", "@opam/re@opam:1.7.3@6a32f7dc",
"@opam/dune@opam:1.5.1@e03be456", "@esy-ocaml/reason@3.3.3"
"@opam/dune@opam:1.6.2@1683022f", "@esy-ocaml/reason@3.3.3"
],
"devDependencies": []
},
@@ -29,7 +29,7 @@
"refmterr@3.1.10", "ocaml@4.6.9", "@opam/yojson@opam:1.4.1@008b9b27",
"@opam/re@opam:1.7.3@6a32f7dc",
"@opam/ppx_deriving_yojson@opam:3.1@beac8c86",
"@opam/dune@opam:1.5.1@e03be456", "@esy-ocaml/reason@3.3.3"
"@opam/dune@opam:1.6.2@1683022f", "@esy-ocaml/reason@3.3.3"
],
"devDependencies": [ "@opam/merlin@opam:3.2.2@10612b59" ]
},
@@ -246,7 +246,7 @@
"path:esy.lock/opam-override/ocamlfind.1.8.0/package.json"
],
"dependencies": [
"ocaml@4.6.9", "@opam/conf-m4@opam:1@d4932910",
"ocaml@4.6.9", "@opam/conf-m4@opam:1@b1a6a3a8",
"@esy-ocaml/substs@0.0.1"
],
"devDependencies": []
@@ -292,7 +292,7 @@
"overrides": [],
"dependencies": [
"ocaml@4.6.9", "@opam/result@opam:1.3@7af06772",
"@opam/dune@opam:1.5.1@e03be456", "@esy-ocaml/substs@0.0.1"
"@opam/dune@opam:1.6.2@1683022f", "@esy-ocaml/substs@0.0.1"
],
"devDependencies": []
},
@@ -341,7 +341,7 @@
"dependencies": [
"ocaml@4.6.9", "@opam/yojson@opam:1.4.1@008b9b27",
"@opam/ocamlfind@opam:1.8.0@6fa9aaf5",
"@opam/dune@opam:1.5.1@e03be456", "@esy-ocaml/substs@0.0.1"
"@opam/dune@opam:1.6.2@1683022f", "@esy-ocaml/substs@0.0.1"
],
"devDependencies": []
},
@@ -385,7 +385,7 @@
},
"overrides": [],
"dependencies": [
"ocaml@4.6.9", "@opam/dune@opam:1.5.1@e03be456",
"ocaml@4.6.9", "@opam/dune@opam:1.6.2@1683022f",
"@esy-ocaml/substs@0.0.1"
],
"devDependencies": []
@@ -413,24 +413,27 @@
],
"devDependencies": []
},
"@opam/dune@opam:1.5.1@e03be456": {
"id": "@opam/dune@opam:1.5.1@e03be456",
"@opam/dune@opam:1.6.2@1683022f": {
"id": "@opam/dune@opam:1.6.2@1683022f",
"name": "@opam/dune",
"version": "opam:1.5.1",
"version": "opam:1.6.2",
"source": {
"type": "install",
"source": [
"archive:https://opam.ocaml.org/cache/md5/07/071ff387b85e08bdfd49dee728dc8358#md5:071ff387b85e08bdfd49dee728dc8358",
"archive:https://github.com/ocaml/dune/releases/download/1.5.1/dune-1.5.1.tbz#md5:071ff387b85e08bdfd49dee728dc8358"
"archive:https://opam.ocaml.org/cache/md5/e6/e628e3903d2418d410e058ca49938a5d#md5:e628e3903d2418d410e058ca49938a5d",
"archive:https://github.com/ocaml/dune/releases/download/1.6.2/dune-1.6.2.tbz#md5:e628e3903d2418d410e058ca49938a5d"
],
"opam": {
"name": "dune",
"version": "1.5.1",
"path": "esy.lock/opam/dune.1.5.1"
"version": "1.6.2",
"path": "esy.lock/opam/dune.1.6.2"
}
},
"overrides": [ "path:esy.lock/opam-override/dune.1.5.1/package.json" ],
"dependencies": [ "ocaml@4.6.9", "@esy-ocaml/substs@0.0.1" ],
"overrides": [ "path:esy.lock/opam-override/dune.1.6.2/package.json" ],
"dependencies": [
"ocaml@4.6.9", "@opam/base-unix@opam:base@5229aaf3",
"@opam/base-threads@opam:base@37e6a5c8", "@esy-ocaml/substs@0.0.1"
],
"devDependencies": []
},
"@opam/cppo_ocamlbuild@opam:1.6.0@abd2de98": {
@@ -481,8 +484,8 @@
],
"devDependencies": []
},
"@opam/conf-which@opam:1@2dd0e651": {
"id": "@opam/conf-which@opam:1@2dd0e651",
"@opam/conf-which@opam:1@d5e0c6d7": {
"id": "@opam/conf-which@opam:1@d5e0c6d7",
"name": "@opam/conf-which",
"version": "opam:1",
"source": {
@@ -498,8 +501,8 @@
"dependencies": [ "@esy-ocaml/substs@0.0.1" ],
"devDependencies": []
},
"@opam/conf-m4@opam:1@d4932910": {
"id": "@opam/conf-m4@opam:1@d4932910",
"@opam/conf-m4@opam:1@b1a6a3a8": {
"id": "@opam/conf-m4@opam:1@b1a6a3a8",
"name": "@opam/conf-m4",
"version": "opam:1",
"source": {
@@ -535,7 +538,7 @@
"dependencies": [
"ocaml@4.6.9", "@opam/jbuilder@opam:transition@8c8ec590",
"@opam/easy-format@opam:1.3.1@85a6474a",
"@opam/conf-which@opam:1@2dd0e651", "@esy-ocaml/substs@0.0.1"
"@opam/conf-which@opam:1@d5e0c6d7", "@esy-ocaml/substs@0.0.1"
],
"devDependencies": []
},
@@ -556,6 +559,23 @@
"dependencies": [ "@esy-ocaml/substs@0.0.1" ],
"devDependencies": []
},
"@opam/base-threads@opam:base@37e6a5c8": {
"id": "@opam/base-threads@opam:base@37e6a5c8",
"name": "@opam/base-threads",
"version": "opam:base",
"source": {
"type": "install",
"source": [ "no-source:" ],
"opam": {
"name": "base-threads",
"version": "base",
"path": "esy.lock/opam/base-threads.base"
}
},
"overrides": [],
"dependencies": [ "@esy-ocaml/substs@0.0.1" ],
"devDependencies": []
},
"@esy-ocaml/substs@0.0.1": {
"id": "@esy-ocaml/substs@0.0.1",
"name": "@esy-ocaml/substs",
@@ -0,0 +1,6 @@
opam-version: "2.0"
maintainer: "https://github.com/ocaml/opam-repository/issues"
description: """
Threads library distributed with the OCaml compiler
"""

@@ -13,7 +13,7 @@ depexts: [
["m4"] {os-distribution = "centos"}
["m4"] {os-distribution = "alpine"}
["m4"] {os-distribution = "nixos"}
["m4"] {os-distribution = "opensuse"}
["m4"] {os-family = "suse"}
["m4"] {os-distribution = "oraclelinux"}
["m4"] {os-distribution = "archlinux"}
]
@@ -8,7 +8,7 @@ build: [["which" "which"]]
depexts: [
["which"] {os-distribution = "centos"}
["which"] {os-distribution = "fedora"}
["which"] {os-distribution = "opensuse"}
["which"] {os-family = "suse"}
["debianutils"] {os-distribution = "debian"}
["debianutils"] {os-distribution = "ubuntu"}
["which"] {os-distribution = "nixos"}
@@ -7,6 +7,8 @@ dev-repo: "git+https://github.com/ocaml/dune.git"
license: "MIT"
depends: [
"ocaml" {>= "4.02"}
"base-unix"
"base-threads"
]
build: [
# opam 2 sets OPAM_SWITCH_PREFIX, so we don't need a hardcoded path
@@ -17,6 +19,7 @@ build: [
]
conflicts: [
"jbuilder" {!= "transition"}
"odoc" {< "1.3.0"}
]

synopsis: "Fast, portable and opinionated build system"
@@ -39,6 +42,6 @@ packages across several versions of OCaml and gives cross-compilation
for free.
"""
url {
src: "https://github.com/ocaml/dune/releases/download/1.5.1/dune-1.5.1.tbz"
checksum: "md5=071ff387b85e08bdfd49dee728dc8358"
src: "https://github.com/ocaml/dune/releases/download/1.6.2/dune-1.6.2.tbz"
checksum: "md5=e628e3903d2418d410e058ca49938a5d"
}
@@ -0,0 +1,8 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/;

Tests.TestFramework.cli();
@@ -0,0 +1,9 @@
(executable
(package tests)
(name ReasonNativeTests)
(public_name ReasonNativeTests.exe)
(ocamlopt_flags -g)
(libraries
Tests
)
)
No changes.
@@ -0,0 +1,31 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/;

let dir = Sys.getenv_opt("REASON_NATIVE_ROOT");

let dir =
switch (dir) {
| Some(dir) => dir
| None =>
failwith(
"Expected `REASON_NATIVE_ROOT` environment variable to be set "
++ "before running tests.",
)
};

include Rely.Make({
let config =
Rely.TestFrameworkConfig.initialize({
snapshotDir:
Filename.(
dir
|> (dir => Filename.concat(dir, "tests"))
|> (dir => Filename.concat(dir, "__snapshots__"))
),
projectDir: dir,
});
});

0 comments on commit a12ab48

Please sign in to comment.
You can’t perform that action at this time.