To make this work I had to move the 'main-is' outside of the if-else:

 executable tests
     main-is: Test.hs
     hs-source-dirs: test-src src
     if flag(BuildTests)
         build-depends: test-framework, test-framework-hunit, HUnit,
test-framework-quickcheck2, QuickCheck >= 2.1.0.0
     else
         buildable: False

I found this surprising, so I'm tempted to call it a bug.  A quick
search didn't tell me whether this is well-known already, hence the
email.  Would you consider it a bug?  Has it been raised already?

I do something similar with EMGM, but I never tried to put the main-is inside the if. I just did this for the test executable.
  if flag(test)
build-depends: QuickCheck >= 2.1 && < 2.2,
HUnit >= 1.2 && < 1.3
else
buildable: False
 
Sean