Skip to content

Commit 0942319

Browse files
committed
Restructure prototypes to fit the status quo for directory structuring
This means renaming the `prototypes` directory to `src-prototypes`, and putting tests into a new `test-prototypes` directory.
1 parent d9d93c5 commit 0942319

File tree

7 files changed

+44
-36
lines changed

7 files changed

+44
-36
lines changed

lsm-tree.cabal

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -863,41 +863,43 @@ test-suite map-range-test
863863

864864
library prototypes
865865
import: language, warnings, wno-x-partial
866-
hs-source-dirs: prototypes
866+
hs-source-dirs: src-prototypes
867867
exposed-modules:
868868
FormatPage
869869
ScheduledMerges
870-
ScheduledMergesTest
871-
ScheduledMergesTestQLS
872870

873871
build-depends:
874-
, base <5
872+
, base <5
875873
, binary
876874
, bytestring
877-
, constraints
878875
, containers
879876
, contra-tracer
880877
, QuickCheck
881-
, quickcheck-dynamic
882-
, quickcheck-lockstep
883878
, tasty
884-
, tasty-hunit
885879
, tasty-quickcheck
886880
, transformers
887881

888-
ghc-options:
889-
-Wno-incomplete-uni-patterns -Wno-partial-fields
890-
-Wno-missing-export-lists
891-
892-
test-suite lsm-prototypes-tests
882+
test-suite prototypes-test
893883
import: language, warnings, wno-x-partial
894884
type: exitcode-stdio-1.0
895-
hs-source-dirs: test
896-
main-is: lsm-prototypes-tests.hs
885+
hs-source-dirs: test-prototypes
886+
main-is: Main.hs
887+
other-modules:
888+
Test.ScheduledMerges
889+
Test.ScheduledMergesQLS
890+
897891
build-depends:
898892
, base
893+
, constraints
894+
, containers
895+
, contra-tracer
899896
, lsm-tree:prototypes
897+
, QuickCheck
898+
, quickcheck-dynamic
899+
, quickcheck-lockstep
900900
, tasty
901+
, tasty-hunit
902+
, tasty-quickcheck
901903

902904
library control
903905
import: language, warnings

prototypes/FormatPage.hs renamed to src-prototypes/FormatPage.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{-# LANGUAGE ParallelListComp #-}
2+
3+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
4+
25
-- | This accompanies the format-page.md documentation as a sanity check
36
-- and a precise reference. It is intended to demonstrate that the page
47
-- format works. It is also used as a reference implementation for tests of

prototypes/ScheduledMerges.hs renamed to src-prototypes/ScheduledMerges.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{-# LANGUAGE PatternSynonyms #-}
22

3+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
4+
{-# OPTIONS_GHC -Wno-partial-fields #-}
5+
36
-- | A prototype of an LSM with explicitly scheduled incremental merges.
47
--
58
-- The scheduled incremental merges is about ensuring that the merging

test-prototypes/Main.hs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module Main (main) where
2+
3+
import Test.Tasty
4+
5+
import qualified FormatPage
6+
import qualified Test.ScheduledMerges
7+
import qualified Test.ScheduledMergesQLS
8+
9+
main :: IO ()
10+
main = defaultMain $ testGroup "prototypes" [
11+
FormatPage.tests
12+
, Test.ScheduledMerges.tests
13+
, Test.ScheduledMergesQLS.tests
14+
]

prototypes/ScheduledMergesTest.hs renamed to test-prototypes/Test/ScheduledMerges.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module ScheduledMergesTest (tests) where
1+
module Test.ScheduledMerges (tests) where
22

33
import Control.Exception
44
import Control.Monad (replicateM_, when)
@@ -21,7 +21,7 @@ import Test.Tasty.QuickCheck (QuickCheckMaxSize (..),
2121
QuickCheckTests (..), testProperty, (=/=), (===))
2222

2323
tests :: TestTree
24-
tests = testGroup "Unit and property tests"
24+
tests = testGroup "Test.ScheduledMerges"
2525
[ testCase "test_regression_empty_run" test_regression_empty_run
2626
, testCase "test_merge_again_with_incoming" test_merge_again_with_incoming
2727
, testProperty "prop_union" prop_union

prototypes/ScheduledMergesTestQLS.hs renamed to test-prototypes/Test/ScheduledMergesQLS.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{-# LANGUAGE TypeFamilies #-}
22

33
{-# OPTIONS_GHC -Wno-orphans #-}
4+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
45

5-
module ScheduledMergesTestQLS (tests) where
6+
module Test.ScheduledMergesQLS (tests) where
67

78
import Control.Monad.ST
89
import Control.Tracer (Tracer, nullTracer)
@@ -25,8 +26,9 @@ import Test.Tasty
2526
import Test.Tasty.QuickCheck (testProperty)
2627

2728
tests :: TestTree
28-
tests =
29-
testProperty "ScheduledMerges vs model" $ mapSize (*10) prop_LSM -- still <10s
29+
tests = testGroup "Test.ScheduledMergesQLS" [
30+
testProperty "ScheduledMerges vs model" $ mapSize (*10) prop_LSM -- still <10s
31+
]
3032

3133
-- TODO: add tagging, e.g. how often ASupplyUnion makes progress or completes a
3234
-- union merge.

test/lsm-prototypes-tests.hs

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)