Navigation Menu

Skip to content

Commit

Permalink
Fix core-tests (#2162)
Browse files Browse the repository at this point in the history
* Fix core-tests

* test psc-docs
  • Loading branch information
paf31 committed May 25, 2016
1 parent f148735 commit 83be9a5
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 80 deletions.
1 change: 1 addition & 0 deletions core-tests/.gitignore
@@ -1,2 +1,3 @@
core-docs.md
bower_components/
output/
60 changes: 60 additions & 0 deletions core-tests/bower.json
@@ -0,0 +1,60 @@
{
"name": "core-tests",
"homepage": "https://github.com/purescript/purescript",
"authors": [
"Phil Freeman <paf31@cantab.net>"
],
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"purescript-arrays": "#8c9ada5762",
"purescript-bifunctors": "#9e3b2864ce",
"purescript-console": "#db29da9aca",
"purescript-const": "#cf538a65d8",
"purescript-contravariant": "#9ae6d7c99c",
"purescript-control": "#97096c7e26",
"purescript-distributive": "#ba81c64ffd",
"purescript-eff": "#dbd6c4a415",
"purescript-either": "#54f4efd423",
"purescript-enums": "#9332412e52",
"purescript-exceptions": "#522a0cea50",
"purescript-exists": "#e828c8341e",
"purescript-foldable-traversable": "#df37787855",
"purescript-foreign": "#64890cbbdb",
"purescript-free": "#f8ab7c5f05",
"purescript-functions": "#e417541936",
"purescript-functor-coproducts": "#7654d9dea4",
"purescript-generics": "#d09cb16ca3",
"purescript-globals": "#113ee398be",
"purescript-graphs": "#0b7089afa2",
"purescript-identity": "#204ac5f46a",
"purescript-inject": "#3ae4880bad",
"purescript-integers": "#58d7605dd5",
"purescript-lazy": "#bf4b34d673",
"purescript-maps": "#d9e4c6599a",
"purescript-math": "#99797b6494",
"purescript-maybe": "#1b60a07038",
"purescript-monoid": "#a8c8bb9d73",
"purescript-parallel": "#c7296ab008",
"purescript-prelude": "#318ee857bd",
"purescript-profunctor": "#a649126cea",
"purescript-proxy": "#c494b11bd7",
"purescript-quickcheck": "#4a15c93f12",
"purescript-random": "#68314c21e2",
"purescript-refs": "#f47e1059a3",
"purescript-semirings": "#c40efda15f",
"purescript-sets": "#1eaabf177f",
"purescript-st": "#077d9a2d7e",
"purescript-strings": "#87dd5f1694",
"purescript-tailrec": "#3c11db00ba",
"purescript-transformers": "#2d0a471ce4",
"purescript-tuples": "#4fe689ef93",
"purescript-unfoldable": "#e2382f30d8",
"purescript-validation": "#f43ff0fbdd"
}
}
60 changes: 7 additions & 53 deletions core-tests/test-everything.sh
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand All @@ -18,62 +18,16 @@ if [ "$force_reinstall" = "true" ] && [ -d "bower_components" ]; then
rm -r bower_components
fi

bower i \
purescript-prelude \
purescript-eff \
purescript-st \
purescript-integers \
purescript-functions \
purescript-console \
purescript-profunctor \
purescript-contravariant \
purescript-parallel \
purescript-control \
purescript-tailrec \
purescript-maps \
purescript-free \
purescript-transformers \
purescript-exists \
purescript-monoid \
purescript-either \
purescript-maybe \
purescript-inject \
purescript-graphs \
purescript-enums \
purescript-unfoldable \
purescript-coproducts \
purescript-lazy \
purescript-distributive \
purescript-identity \
purescript-bifunctors \
purescript-const \
purescript-sets \
purescript-quickcheck \
purescript-foreign \
purescript-foldable-traversable \
purescript-tuples \
purescript-strings \
purescript-arrays \
purescript-random \
purescript-refs \
purescript-globals \
purescript-exceptions \
purescript-validation \
purescript-parallel \
purescript-proxy \
purescript-semirings \
purescript-math \
purescript-generics
# todo : fix this once core libraries reach 1.0
yes 1 | bower i

if [ "$force_recompile" = "true" ] && [ -d "output" ]; then
echo "Recompiling..."
rm -r output
fi

../dist/build/psc/psc tests/*/*.purs \
'bower_components/purescript-*/src/**/*.purs' \
--ffi 'bower_components/purescript-*/src/**/*.js'
stack exec psc 'tests/**/*.purs' 'bower_components/purescript-*/src/**/*.purs'

../dist/build/psc-docs/psc-docs tests/*/*.purs \
'bower_components/purescript-*/src/**/*.purs' \
> full-core-docs.md
stack exec psc-docs 'bower_components/purescript-*/src/**/*.purs' > core-docs.md

NODE_PATH=output node -e "require('Test.Main').main()"
30 changes: 30 additions & 0 deletions core-tests/tests/GenericDeriving.purs
@@ -0,0 +1,30 @@
module Test.GenericDeriving where

import Prelude

import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log, logShow)
import Data.Generic (class Generic, gShow, gEq)
import Partial.Unsafe (unsafePartial)

data Empty

derive instance genericEmpty :: Partial => Generic Empty

data A a
= A Number String
| B Int
| C (Array (A a))
| D { "asgård" :: a }
| E Empty

derive instance genericA :: (Partial, Generic b) => Generic (A b)

newtype X b = X b

derive instance genericX :: Generic (X String)

main :: forall eff. Eff (console :: CONSOLE | eff) Unit
main = unsafePartial do
log $ gShow (D { "asgård": C [ A 1.0 "test", B 42, D { "asgård": true } ] })
logShow $ gEq (C [B 0]) (C [B 0] :: A Empty)
9 changes: 9 additions & 0 deletions core-tests/tests/Main.purs
@@ -0,0 +1,9 @@
module Test.Main where

import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE)
import Test.GenericDeriving as GenericDeriving

main :: forall eff. Eff (console :: CONSOLE | eff) Unit
main = GenericDeriving.main
27 changes: 0 additions & 27 deletions core-tests/tests/generic-deriving/Main.purs

This file was deleted.

0 comments on commit 83be9a5

Please sign in to comment.