Comments (5)
The reason that this does not work is that tasty-th currently does the following:
- It uses TH to retrive the contents of the current source code file
- It then just uses some text processing to extract haskell function names from this file (see http://hackage.haskell.org/package/language-haskell-extract)
So perhaps, for your use case, I could add a function to generate a TestTree
given a file name from which to read the properties? Since you already detect all the files, you could then just use that and write your main similar to this:
main :: IO ()
main = defaultMain $ testGroup "yourTestName"
[ $(generateTestTree "FileFoo.hs")
, $(generateTestTree "FIleBar.hs")
, ...
]
Or even better, we could split the "detect the names of properties from a file" and "generate a test tree from property function names" into two separate functions, the first of which would take a file name.
from tasty-th.
Ah, right. I understand. It would be awesome if you could make that happen.
Also, generateTestTree
could grab of all the case_*
tests as well, I hope 👍
from tasty-th.
Ok, you should now be able to use "extractTestFunctions" + "defaultMainGeneratorFor" to achieve your goal: just use extractTestFunctions
in your plugin, and then generate a file which contains defaultMainGeneratorFor <name of the toplevel test group> <all found test functions>
. I'll make a hackage release soon, after travis tests finish.
from tasty-th.
Brilliant, thank you, I will let you know how it goes when I get a chance 🚀
from tasty-th.
You're welcome, hackage release is done.
from tasty-th.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tasty-th.