   return true;
 }
 `
-module.exports.TestRedis = (test) ->
-
-    back = new MemoryBackend() #RedisBackend()
+
+gentests = (name, fnc) ->
+    for backend in TEST_BACKENDS
+        wrapper = (test) ->
+            fnc(test, backend)
+        dname = name + backend.name
+        wrapper.name = dname
+        module.exports[dname] = wrapper
+
+
+
+gentests "TestConsistancy", (test, backend) ->
+
+    console.log("test backend", backend.name)
+
+    back = new backend() #RedisBackend()
     fc = new Flexcache back, ttl:400000, debug:2
 
     todo = 0 # calculated 

        


module.exports.StressRedis = (test) ->

    RUNS = 10000

    run = () ->
    back = new RedisBackend()
    options =
        ttl:100 * 1000 # 100 secs should be enough
        key: () ->

{ Flexcache } = require("../flexcache")
{ RedisBackend } = require("../backend/redis")
{ MemoryBackend } = require("../backend/memory")


TEST_BACKENDS = [RedisBackend, MemoryBackend]
STRESS_RUNS = 10000


async = require 'async'
garbage = require 'garbage'
