NorfairKing / sydtest

A modern testing framework for Haskell with good defaults and advanced testing features.
115 stars 25 forks source link

Add a mechanism to have `sydtest-discover` ignore a module #40

Closed blamario closed 1 year ago

blamario commented 2 years ago

We have a hack around this problem in Plutarch, but it's not complete.

The trouble is that some test modules are supposed to be run only in certain environments. Cabal has conditional sections for this purpose, but sydtest-discover doesn't use Cabal API to discover the modules. Changing that would be one way to fix the issue. Another would be to mark ignorable test modules with {-# SydTest ignore #-} or something.

NorfairKing commented 2 years ago

We could make sydtest-discover smart enough to ignore a file if its first line is such an ignore pragma! PR welcome.

srid commented 2 years ago

Another would be to mark ignorable test modules with {-# SydTest ignore #-} or something.

This wouldn't work for our situation, because we want to conditionally ignore a module based on whether it is GHC 8.10 or 9.2.

Cabal-aware discovery is ideal, but I don't know what that will take (if it is possible at all) for a GHC plugin.

NorfairKing commented 2 years ago

It sounds like maybe not using sydtest-discover is the best option for you. I'd prefer to keep sydtest-discover very stupid.

NorfairKing commented 1 year ago

You can have sydtest-discover ignore files by not naming them with a Spec suffix.