README 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. RUN
  2. ===
  3. Do this Once before running tests
  4. ---------------------------------
  5. * edit the connection string (app setting entry "ConnString")
  6. - if you want to run odbc test cases, edit odbc.config
  7. and edit the entry with "ConnString" with appropriate
  8. DSN, User Id and Password.
  9. * run the sql schema and test pool data under directory sql to
  10. the respective databases, using a appropriate client.
  11. eg.
  12. tsql -S server -U user -P pwd < sql/sqlserver.sql
  13. mysql -u user -p < sql/mysql.sql
  14. To run the tests
  15. ----------------
  16. * make clean
  17. * make run-test DATABASE=<ur-database>
  18. valid database strings are :
  19. sqlserver, odbc
  20. GUIDELINES for test-case developers
  21. ----------------------------------
  22. general
  23. =======
  24. * Provider specific test case to go into their specific
  25. subfolders named after their namespaces. All odbc specific
  26. test-cases to go into System.Data.Odbc, etc.
  27. * all tables to have a unique id column
  28. * if you modify any data from a test case make sure, you
  29. revert it at the end of test case, either through
  30. try..finally block or using transactions
  31. * if you intend to insert from code, insert value above 6000
  32. (randomly chosen)
  33. * if you create a stored procedure from code, create with a
  34. prefix 'tmp_'.
  35. * if you create a table from code, create with a prefix
  36. 'tmp_'.
  37. sqlserver
  38. =========
  39. * for temporary per-test-case tables/stored-procedures, prefix
  40. the name with "#" so that mssql removes the object
  41. automatically.
  42. Extending to a new database
  43. ---------------------------
  44. * All new databases can run the tests provided in
  45. ProviderIndependant tests. Include your category in each of
  46. the test cases. Say, if you want to extend these test cases
  47. to a database provider 'xyz', include a line [Category
  48. ("xyz")] with each of the test cases.
  49. * add a sql script file for you database to generate the test
  50. data with same name you have given to the category with an
  51. extension ".sql". For example, write a script file "xyz.sql"
  52. under the sub-directory "sql".
  53. The test pool data can be obtained from either of the
  54. existing sql script files say "mysql.sql".
  55. If your database does not support a datatype that are
  56. used in other database script files, do *not* remove the
  57. datatype instead, add a datatype nearly matching your local
  58. type. For example, if your database does not support bigint,
  59. add a column named type_bigint, but with type as "numeric
  60. (19,0)".
  61. * Add a subdirectory with the name of the your provider's
  62. namespace. If your provider is, say, XYZ, with namespace
  63. System.Data.XYZ, Add a sub-directory System.Data.XYZ. Add
  64. your provider specific tests to this directory with each
  65. test case assigned to your category.
  66. * Add an application config file named after your database
  67. name, same as the category name. Add an application key
  68. called ConnString with the correct Connection String to your
  69. database. This entry will be changed by the user when he
  70. wants to run test on a different physical database.
  71. IMPORTANT:
  72. * Do *not* move any of the test cases to generic until you are
  73. sure that they will run in all databases that are categorized.