Skip to content

Commit

Permalink
make test adl files into top level dir, and make names consistent wit…
Browse files Browse the repository at this point in the history
…h module names
  • Loading branch information
timbod7 committed Mar 15, 2023
1 parent 2d3f3aa commit 4e4ea7c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 11 additions & 8 deletions haskell/compiler/tests/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ runRsBackend ipaths mpaths epath rsModule = do
stdsrc :: FilePath
stdsrc = "../../../haskell/compiler/lib/adl"

testsrc :: FilePath
testsrc = "../../../adl/tests"

stdfiles, stdHsCustomTypes, stdCppCustomTypes :: [FilePath]
stdfiles = map (combine stdsrc) ["sys/types.adl", "sys/adlast.adl", "sys/dynamic.adl"]
stdHsCustomTypes = ["../../compiler/lib/adl/sys/types/hs-custom-types.json"]
Expand Down Expand Up @@ -227,10 +230,10 @@ runTests = do

describe "adlc haskell backend" $ do
it "generates expected code for an empty module" $ do
collectResults (runHaskellBackend1 "test1/input/test.adl")
collectResults (runHaskellBackend [stdsrc] [testsrc </> "test1/test1.adl"] "test1/hs-output")
`shouldReturn` MatchOutput
it "generates expected code for various structures" $ do
collectResults (runHaskellBackend1 "test2/input/test.adl")
collectResults (runHaskellBackend [stdsrc] [testsrc </> "test2/test2.adl"] "test2/hs-output")
`shouldReturn` MatchOutput
it "generates expected code for structures with default overrides" $ do
collectResults (runHaskellBackend1 "test3/input/test.adl")
Expand Down Expand Up @@ -274,10 +277,10 @@ runTests = do

describe "adlc cpp backend" $ do
it "generates expected code for an empty module" $ do
collectResults (runCppBackend1 "test1/input/test.adl")
collectResults (runCppBackend [stdsrc] [testsrc </> "test1/test1.adl"] "test1/cpp-output" "")
`shouldReturn` MatchOutput
it "generates expected code for various structures" $ do
collectResults (runCppBackend1 "test2/input/test.adl")
collectResults (runCppBackend [stdsrc] [testsrc </> "test2/test2.adl"] "test2/cpp-output" "")
`shouldReturn` MatchOutput
it "generates expected code for structures with default overrides" $ do
collectResults (runCppBackend1 "test3/input/test.adl")
Expand Down Expand Up @@ -321,7 +324,7 @@ runTests = do

describe "adlc java backend" $ do
it "generates expected code for various structures" $ do
collectResults (runJavaBackend1 "test2/input/test.adl")
collectResults (runJavaBackend [stdsrc] [testsrc </> "test2/test2.adl"] "test2/java-output" id)
`shouldReturn` MatchOutput
it "generates expected code for structures with default overrides" $ do
collectResults (runJavaBackend1 "test3/input/test.adl")
Expand Down Expand Up @@ -392,7 +395,7 @@ runTests = do

describe "adlc typescript backend" $ do
it "generates expected output for various structures" $
collectResults (runTsBackend id [stdsrc] ["test2/input/test.adl"] "test2/ts-output")
collectResults (runTsBackend id [stdsrc] [testsrc </> "test2/test2.adl"] "test2/ts-output")
`shouldReturn` MatchOutput
it "generates expected code for structures with default overrides" $ do
collectResults (runTsBackend id [stdsrc] ["test3/input/test.adl"] "test3/ts-output")
Expand Down Expand Up @@ -422,10 +425,10 @@ runTests = do

describe "adlc rust backend" $ do
it "generates expected code for an empty module" $ do
collectResults (runRsBackend [stdsrc] ["test1/input/test.adl"] "test1/rs-output" "test1::adl")
collectResults (runRsBackend [stdsrc] [testsrc </> "test1/test1.adl"] "test1/rs-output" "test1::adl")
`shouldReturn` MatchOutput
it "generates expected output for various structures" $
collectResults (runRsBackend [stdsrc] ["test2/input/test.adl"] "test2/rs-output" "test2::adl")
collectResults (runRsBackend [stdsrc] [testsrc </> "test2/test2.adl"] "test2/rs-output" "test2::adl")
`shouldReturn` MatchOutput
it "generates expected code for structures with default overrides" $ do
collectResults (runRsBackend [stdsrc] ["test3/input/test.adl"] "test3/rs-output" "test3::adl")
Expand Down

0 comments on commit 4e4ea7c

Please sign in to comment.