| || |
Persisting data in memory
Does SilkTest have anything like ‘static’ data in C? My problem is two-fold. I am trying to create an initialization function which generates a list of names and associated map coordinates (it reads from a database to get this info). This list should only be generated once and should be available to all test cases – preferably in memory. I am trying to declare a Boolean value that is initialized to False and will be set to True after the initialization routine is executed. This would allow me to run any set of test cases, and only the first test case would run the initialization routine.
All test cases would check the Boolean to see if the initialization routine has been run, and if it hasn’t they would run it. If it has already been executed, they can refer to the names and coordinates in the list.
I have a plan file, a test case .t file that has the test case code, a functions.inc file which contains my initialization function, and a header.inc file that contains the global Boolean and the list declaration.
Can anyone give me suggestions on how to have one test case ‘initialize’ my list and the global boolean, and keep that information in memory for subsequent test cases to use?
This all works fine if I run the test script file directly, but I want to drive my test cases from the plan file so I can pick and choose which tests get executed.