Skip to content

Commit 0ecdcea

Browse files
committed
Tests for internal libraries (#269) and separate cabal_macros.h (#1893)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
1 parent e71332e commit 0ecdcea

File tree

22 files changed

+235
-26
lines changed

22 files changed

+235
-26
lines changed

Cabal/Cabal.cabal

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,17 @@ extra-source-files:
9595
tests/PackageTests/HaddockNewline/A.hs
9696
tests/PackageTests/HaddockNewline/HaddockNewline.cabal
9797
tests/PackageTests/HaddockNewline/Setup.hs
98-
tests/PackageTests/MultipleLibraries/p.cabal
99-
tests/PackageTests/MultipleLibraries/p/P.hs
100-
tests/PackageTests/MultipleLibraries/p/Foo.hs
101-
tests/PackageTests/MultipleLibraries/p/p.cabal
102-
tests/PackageTests/MultipleLibraries/p/p/P.hs
103-
tests/PackageTests/MultipleLibraries/p/q/Q.hs
104-
tests/PackageTests/MultipleLibraries/q/Q.hs
105-
tests/PackageTests/MultipleLibraries/q/q.cabal
98+
tests/PackageTests/InternalLibraries/Executable/dist-test.Dynamic/test.sh
99+
tests/PackageTests/InternalLibraries/Executable/dist-test.Static/test.sh
100+
tests/PackageTests/InternalLibraries/Executable/exe/Main.hs
101+
tests/PackageTests/InternalLibraries/Executable/foo.cabal
102+
tests/PackageTests/InternalLibraries/Executable/src/Foo.hs
103+
tests/PackageTests/InternalLibraries/p/Foo.hs
104+
tests/PackageTests/InternalLibraries/p/p.cabal
105+
tests/PackageTests/InternalLibraries/p/p/P.hs
106+
tests/PackageTests/InternalLibraries/p/q/Q.hs
107+
tests/PackageTests/InternalLibraries/q/Q.hs
108+
tests/PackageTests/InternalLibraries/q/q.cabal
106109
tests/PackageTests/OrderFlags/Foo.hs
107110
tests/PackageTests/OrderFlags/my.cabal
108111
tests/PackageTests/PathsModule/Executable/Main.hs
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Foo
2+
main = print (foo 23)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: foo
2+
version: 0.1.0.0
3+
license: BSD3
4+
author: Edward Z. Yang
5+
maintainer: ezyang@cs.stanford.edu
6+
build-type: Simple
7+
cabal-version: >=1.23
8+
9+
library foo-internal
10+
exposed-modules: Foo
11+
build-depends: base
12+
hs-source-dirs: src
13+
default-language: Haskell2010
14+
15+
executable foo
16+
main-is: Main.hs
17+
build-depends: base, foo-internal
18+
hs-source-dirs: exe
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Foo where
2+
{-# NOINLINE foo #-}
3+
foo :: Int -> Int
4+
foo x = x + 23
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Main where
2+
3+
import Foo
4+
5+
main :: IO ()
6+
main = print foo
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: fooexe
2+
version: 0.1.0.0
3+
license: BSD3
4+
author: Edward Z. Yang
5+
maintainer: ezyang@cs.stanford.edu
6+
build-type: Simple
7+
cabal-version: >=1.10
8+
9+
executable fooexe
10+
main-is: Main.hs
11+
build-depends: base, foolib
12+
default-language: Haskell2010
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Foo where
2+
import Internal
3+
foo = internal + 2
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: foolib
2+
version: 0.1.0.0
3+
license: BSD3
4+
author: Edward Z. Yang
5+
maintainer: ezyang@cs.stanford.edu
6+
build-type: Simple
7+
cabal-version: >=1.23
8+
9+
library foolib-internal
10+
exposed-modules: Internal
11+
hs-source-dirs: private
12+
build-depends: base
13+
14+
library
15+
exposed-modules: Foo
16+
build-depends: base, foolib-internal
17+
default-language: Haskell2010
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Internal where
2+
{-# NOINLINE internal #-}
3+
internal :: Int
4+
internal = 23

0 commit comments

Comments
 (0)