-
Notifications
You must be signed in to change notification settings - Fork 37
Tests for the build system? #146
Comments
Most of the internal functions are pretty simple - a few explicit test cases is probably plenty and keeps the dependencies down (currently quickcheck won't compile with GHC head so you don't want to depend on that). For the build system, use lint and that's about it. They are very difficult to test. |
@ndmitchell What got me thinking was |
Quickcheck plus a few examples at extreme values and typical values is the default answer. Since quickcheck causes dependency headaches here, if just for skip the quickcheck part. |
@angerman Tests are welcome, of course! @ndmitchell Could you clarify the QuickCheck issue? We do depend on it already, transitively, via Shake. I think we can rely on the bootstrapping compiler here (not GHC head), can't we? |
Shake only requires QuickCheck for the test suite, so a default install won't require it. I imagine building the build system with stage3 will be desirable at some point? Or maybe it doesn't matter. |
Building the build system with stage3 sounds cool, but I guess this step can just be skipped in case QuickCheck is broken on GHC head (which I presume is just a temporary issue). I don't think we should avoid QuickCheck just for this reason. Let's use it, writing all test cases by hand feels outdated :-) |
Yep, temporary. |
Okay, I don't get the stage3 idea. Just my recap:
Does quick check have to run with the actual stage1 or stage2 compiler every time? Wouldn't quick check just be a testing dependency? And wouldn't we run the quick check tests with the Stage 0 compiler (usually a stable release for which quick check, would normally work)? If I'm not mistaken, we are building The issue could with the current head only arrise if one built a regular stage2 compiler and used that as a stage0 compiler for another round? (Is this considered to be the stage3 compiler)? |
As I understand stage3 compiler is sometimes built just as a self test. One could also try to build the build system with it, also as a self test. Maybe @ndmitchell had anything else in mind, beyond self testing?
Correct. |
Shouldn't we then also run the test suite with he compiler that we use to actually compile the code? Otherwise we might run the test suite against with a compiler that might not exhibit a subtle bug, that the compiler with which we actually compile and run the code might exhibit. |
I would suggest that we only run the tests with the stage0 compiler, and even then only on the buildbot. Most likely there would be a |
Hard to argue against QuickCheck tests after screwing up precisely in a way that would have been caught by them but not by manual tests... |
Thanks to #151 we now have the infrastructure for testing. Shall we close this now? Let's all keep adding new tests gradually, as we do with haddock comments. |
That was what I was expecting - test things as they get added or changed, or cause regressions, or if something looks dodgy. |
Agreed. |
jacereda/fsatrace#9 gives me the idea that it would be cool to ensure that all opened files are in fact declared dependencies (or, because of temp files and other edge cases, ensure at least that files that aren't declared dependencies aren't built by any rule). Another route to test roughly the same thing would be to use some sort of layered filesystem or version control to snapshot and rollback the build artifacts of non-depended-on jobs. Both these I suppose could be features of Shake to test any build-system made with it. |
@Ericson2314 in Shake HEAD there is full integration with fsatrace if you just pass |
Alright, this is pretty broad. And I have no idea how to approach this. These days many use tests (quickcheck, hspec, ... )
Base
? What do you think @snowleopard, would that make sense? If so, I could try to cut my teeth on getting this in.The text was updated successfully, but these errors were encountered: