Skip to content

Commit

Permalink
Merge pull request #74 from halfzebra/0.19-tests
Browse files Browse the repository at this point in the history
0.19 tests
  • Loading branch information
Richard Feldman authored Aug 27, 2018
2 parents 06632eb + aa58cbe commit 298a744
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 28 deletions.
19 changes: 1 addition & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,24 @@
sudo: false

cache:
directories:
- test/elm-stuff/build-artifacts
- sysconfcpus

os:
- linux
- osx

env:
matrix:
- ELM_VERSION=0.18.0 TARGET_NODE_VERSION=node
- ELM_VERSION=0.19.0 TARGET_NODE_VERSION=node

before_install:
- if [ ${TRAVIS_OS_NAME} == "osx" ];
then brew update; brew install nvm; mkdir ~/.nvm; export NVM_DIR=~/.nvm; source $(brew --prefix nvm)/nvm.sh;
fi
- | # epic build time improvement - see https://github.com/elm-lang/elm-compiler/issues/1473#issuecomment-245704142
if [ ! -d sysconfcpus/bin ];
then
git clone https://github.com/obmarg/libsysconfcpus.git;
cd libsysconfcpus;
./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus;
make && make install;
cd ..;
fi

install:
- nvm install $TARGET_NODE_VERSION
- nvm use $TARGET_NODE_VERSION
- node --version
- npm --version
- npm install -g elm@$ELM_VERSION
- mv $(npm config get prefix)/bin/elm-make $(npm config get prefix)/bin/elm-make-old
- printf "#\041/bin/bash\n\necho \"Running elm-make with sysconfcpus -n 2\"\n\n$TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 elm-make-old \"\$@\"" > $(npm config get prefix)/bin/elm-make
- chmod +x $(npm config get prefix)/bin/elm-make
- npm install

script:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
environment:
ELM_VERSION: "0.18.0"
ELM_VERSION: "0.19.0"
matrix:
- nodejs_version: "5.0"
- nodejs_version: "4.0"
Expand Down
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var spawn = require("cross-spawn");
var _ = require("lodash");
var elmBinaryName = "elm";
var fs = require("fs");
var path = require("path");
var temp = require("temp").track();
var findAllDependencies = require("find-elm-dependencies").findAllDependencies;

Expand Down Expand Up @@ -180,9 +179,9 @@ function compilerArgsFromOptions(options) {
case "output": return ["--output", value];
case "report": return ["--report", value];
case "debug": return ["--debug"];
case "docs": return ["--docs", value]
case "docs": return ["--docs", value];
case "optimize": return ["--optimize"];
case "runtimeOptions": return ["+RTS", value, "-RTS"]
case "runtimeOptions": return ["+RTS", value, "-RTS"];
default:
if (supportedOptions.indexOf(opt) === -1) {
if (opt === "yes") {
Expand Down
18 changes: 15 additions & 3 deletions test/fixtures/elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,22 @@
],
"elm-version": "0.19.0",
"dependencies": {
"elm-lang/core": "6.0.0",
"elm-lang/html": "3.0.0"
"direct": {
"elm/browser": "1.0.0",
"elm/core": "1.0.0",
"elm/html": "1.0.0"
},
"indirect": {
"elm/json": "1.0.0",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.0"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
},
"test-dependencies": {},
"do-not-edit-this-by-hand": {
"transitive-dependencies": {
"elm-lang/json": "1.0.0",
Expand Down
5 changes: 2 additions & 3 deletions worker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var fs = require("fs");
var temp = require("temp").track();
var path = require("path");
var jsEmitterFilename = "emitter.js";
Expand Down Expand Up @@ -53,7 +52,7 @@ module.exports = function(compile) {
throw Error(err);
});
};
}
};

function createTmpDir() {
return new Promise(function (resolve, reject) {
Expand Down Expand Up @@ -105,7 +104,7 @@ function runWorker(jsFilename, moduleName, workerArgs) {
return reject(missingEntryModuleMessage(moduleName, Elm));
}

var worker = Elm[moduleName].worker(workerArgs);
var worker = Elm[moduleName].init(workerArgs);

if (Object.keys(worker.ports).length === 0){
return reject(noPortsMessage(moduleName, portName));
Expand Down

0 comments on commit 298a744

Please sign in to comment.