{- -----------------------------------------------------------------------------
Copyright 2021 Kevin P. Barry

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
----------------------------------------------------------------------------- -}

-- Author: Kevin P. Barry [ta0kira@gmail.com]

module Test.ParseConfig (tests) where

import Base.TrackedErrors
import Config.CompilerConfig
import Config.ParseConfig ()
import Test.Common


compilerConfig :: LocalConfig
compilerConfig :: LocalConfig
compilerConfig = LocalConfig {
    lcBackend :: Backend
lcBackend = UnixBackend {
      ucCxxBinary :: FilePath
ucCxxBinary = FilePath
"/usr/bin/clang++",
      ucCompileFlags :: [FilePath]
ucCompileFlags = [
        FilePath
"-O2",
        FilePath
"-std=c++11",
        FilePath
"-fPIC"
      ],
      ucLibraryFlags :: [FilePath]
ucLibraryFlags = [
        FilePath
"-shared",
        FilePath
"-fpic"
      ],
      ucBinaryFlags :: [FilePath]
ucBinaryFlags = [
        FilePath
"-02",
        FilePath
"-std=c++11"
      ],
      ucArBinary :: FilePath
ucArBinary = FilePath
"/usr/bin/ar"
    },
    lcResolver :: Resolver
lcResolver = SimpleResolver {
      srVisibleSystem :: [FilePath]
srVisibleSystem = [
        FilePath
"lib",
        FilePath
"testing"
      ],
      srExtraPaths :: [FilePath]
srExtraPaths = [
        FilePath
"extra1",
        FilePath
"extra2"
      ]
    }
  }

tests :: [IO (TrackedErrors ())]
tests :: [IO (TrackedErrors ())]
tests = [
    LocalConfig -> IO (TrackedErrors ())
forall a.
(Eq a, Show a, ConfigFormat a) =>
a -> IO (TrackedErrors ())
checkWriteThenRead LocalConfig
compilerConfig
  ]