I want to kick start the discussion for contributing support for the Google
Test framework support. I have identified 3 stories which should give
Gradle a functional support for Google Test.

Story: Specific class type for CUnit binary
This story makes sure that subsequent test framework are discriminated.
 - Add class
org.gradle.nativebinaries.test.cunit.CUnitTestSuiteExecutableBinary which
extends from TestSuiteExecutableBinary

User visible change
 - Backward compatibility is kept and the following configure all test
suite binary regardless of there framework.
   binaries.withType(TestSuiteExecutableBinary) {
     // Target all test binaries
   }
 - It will now be possible to configure the CUnit test suite binary
individually like this:
   binaries.withType(CUnitTestSuiteExecutableBinary) {
     // Target only CUnit binaries
   }

Test cases
apply 'cunit'
model { testSuites { mainTest { binaires.all { assert it instanceof
CUnitTestSuiteExecutableBinary } } } }


Story: RunTestExecutable can take arguments
This story make it possible to passed arguments to the test binary.
Espacially useful for more advance test framework like Google Test.

User visible change
 - tasks.withType(RunTestExecutable).all {
    testArgs '--args-to-pass', '-v'
   }

Open issues
 - Is testArgs a good name for the property on the RunTestExecutable task.


Story: Google Test support
This story adds support for the Google Test framework.

Note that the implementation is highly based on the current CUnit
implementation.
 - Add class org.gradle.nativebinaries.test.googletest.GoogleTestTestSuite
 - Add class
org.gradle.nativebinaires.test.googletest.GoogleTestTestSuiteExecutableBinary
 - Add class
org.gradle.nativebinaires.test.googletest.plugins.GoogleTestPlugin
 - Add class
org.gradle.nativebinaires.test.googletest.internal.DefaultGoogleTestTestSuite
 - Add class
org.gradle.nativebinaires.test.googletest.internal.ConfigureGoogleTestTestSources
 - Add class
org.gradle.nativebinaires.test.googletest.internal.CreateGoogleTestBinaries

Open issues
 - Should the package name be 'googletest' or 'gtest' ('gtest' is used for
there include namespace in c++)?
 - Should the C++ source set for Google Test named 'googletest' or 'gtest'?
 - How can we refactor CUnit code for reusability with Google Test? The
process is the same - configure test source, create binaries, etc. - but
yet different.

-- 
Daniel

Reply via email to