The BaseTen Subversion repository includes a unit test suite that can also double as example code.

If you're interested in seeing how we're testing BaseTen, head over to the trunk/UnitTests folder in the repository.

If you want to run the tests, here's how:

  1. Create a file called BaseTenModifications.sql using m4 in BaseTen root directory:
     m4 BaseTenModifications.sql.m4 > BaseTenModifications.sql
    
  2. Change to UnitTests directory
     cd UnitTests
    
  3. Create the test database. A command like this should work:
     psql -f BaseTenTest.sql
    
  4. Build the tests and use otest to run them.
     Developer-tools-directory/Tools/otest -SenTest BXTestLoader Your-build-directory/UnitTests.octest