tasn pushed a commit to branch master.

commit afb0cd3cd1f96c3d5920a84196a20303ae4769c5
Author: Tom Hacohen <[email protected]>
Date:   Tue May 21 15:33:20 2013 +0100

    Added the 'wrap' parameter, to use a wrapping command around the tests.
    
    A good example would be valgrind.
---
 src/bin/exactness.c        |  3 +++
 src/bin/exactness_config.h |  1 +
 src/bin/run_test.c         | 12 ++++++++----
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/bin/exactness.c b/src/bin/exactness.c
index a47cc84..7fa781c 100644
--- a/src/bin/exactness.c
+++ b/src/bin/exactness.c
@@ -19,6 +19,7 @@ static const Ecore_Getopt optdesc = {
   {
     ECORE_GETOPT_STORE_STR('b', "base-dir", "The location of the rec files."),
     ECORE_GETOPT_STORE_STR('d', "dest-dir", "The location of the images."),
+    ECORE_GETOPT_STORE_STR('w', "wrap", "Use a custom command to launch the 
tests (e.g valgrind)."),
     ECORE_GETOPT_STORE_USHORT('j', "jobs", "The number of jobs to run in 
parallel."),
     ECORE_GETOPT_STORE_TRUE('r', "record", "Run in record mode."),
     ECORE_GETOPT_STORE_TRUE('p', "play", "Run in play mode."),
@@ -47,6 +48,7 @@ main(int argc, char *argv[])
    Ecore_Getopt_Value values[] = {
      ECORE_GETOPT_VALUE_STR(exactness_config.base_dir),
      ECORE_GETOPT_VALUE_STR(exactness_config.dest_dir),
+     ECORE_GETOPT_VALUE_STR(exactness_config.wrap_command),
      ECORE_GETOPT_VALUE_USHORT(exactness_config.jobs),
      ECORE_GETOPT_VALUE_BOOL(mode_record),
      ECORE_GETOPT_VALUE_BOOL(mode_play),
@@ -66,6 +68,7 @@ main(int argc, char *argv[])
    want_quit = EINA_FALSE;
    exactness_config.base_dir = "./recordings";
    exactness_config.dest_dir = "./";
+   exactness_config.wrap_command = "";
    exactness_config.jobs = 1;
    exactness_config.verbose = EINA_FALSE;
 
diff --git a/src/bin/exactness_config.h b/src/bin/exactness_config.h
index dd31c8e..e207c51 100644
--- a/src/bin/exactness_config.h
+++ b/src/bin/exactness_config.h
@@ -10,6 +10,7 @@ struct _Exactness_Config
    unsigned short jobs;
    char *base_dir;
    char *dest_dir;
+   char *wrap_command;
    Eina_Bool verbose;
 };
 
diff --git a/src/bin/run_test.c b/src/bin/run_test.c
index 6ff5ab2..98a38b2 100644
--- a/src/bin/run_test.c
+++ b/src/bin/run_test.c
@@ -15,22 +15,24 @@
 void
 run_test_simulation(const List_Entry *ent, char *buf)
 {
-   snprintf(buf, SCHEDULER_CMD_SIZE, "TSUITE_VERBOSE=%d TSUITE_DEST_DIR='%s' 
TSUITE_FILE_NAME='%s/%s.rec' TSUITE_TEST_NAME='%s' LD_PRELOAD='%s' %s",
+   snprintf(buf, SCHEDULER_CMD_SIZE, "TSUITE_VERBOSE=%d TSUITE_DEST_DIR='%s' 
TSUITE_FILE_NAME='%s/%s.rec' TSUITE_TEST_NAME='%s' LD_PRELOAD='%s' %s %s",
          exactness_config.verbose,
          exactness_config.dest_dir,
          exactness_config.base_dir, ent->name,
          ent->name, LIBEXACTNESS_PATH,
+         exactness_config.wrap_command,
          ent->command);
 }
 
 void
 run_test_play(const List_Entry *ent, char *buf)
 {
-   snprintf(buf, SCHEDULER_CMD_SIZE, "TSUITE_VERBOSE=%d ELM_ENGINE='buffer' 
TSUITE_DEST_DIR='%s/" CURRENT_SUBDIR "' TSUITE_FILE_NAME='%s/%s.rec' 
TSUITE_TEST_NAME='%s' LD_PRELOAD='%s' %s",
+   snprintf(buf, SCHEDULER_CMD_SIZE, "TSUITE_VERBOSE=%d ELM_ENGINE='buffer' 
TSUITE_DEST_DIR='%s/" CURRENT_SUBDIR "' TSUITE_FILE_NAME='%s/%s.rec' 
TSUITE_TEST_NAME='%s' LD_PRELOAD='%s' %s %s",
          exactness_config.verbose,
          exactness_config.dest_dir,
          exactness_config.base_dir, ent->name,
          ent->name, LIBEXACTNESS_PATH,
+         exactness_config.wrap_command,
          ent->command);
 
    run_test_prefix_rm(CURRENT_SUBDIR, ent->name);
@@ -39,22 +41,24 @@ run_test_play(const List_Entry *ent, char *buf)
 void
 run_test_record(const List_Entry *ent, char *buf)
 {
-   snprintf(buf, SCHEDULER_CMD_SIZE, "TSUITE_VERBOSE=%d TSUITE_RECORDING='rec' 
TSUITE_DEST_DIR='%s' TSUITE_FILE_NAME='%s/%s.rec' TSUITE_TEST_NAME='%s' 
LD_PRELOAD='%s' %s",
+   snprintf(buf, SCHEDULER_CMD_SIZE, "TSUITE_VERBOSE=%d TSUITE_RECORDING='rec' 
TSUITE_DEST_DIR='%s' TSUITE_FILE_NAME='%s/%s.rec' TSUITE_TEST_NAME='%s' 
LD_PRELOAD='%s' %s %s",
          exactness_config.verbose,
          exactness_config.dest_dir,
          exactness_config.base_dir, ent->name,
          ent->name, LIBEXACTNESS_PATH,
+         exactness_config.wrap_command,
          ent->command);
 }
 
 void
 run_test_init(const List_Entry *ent, char *buf)
 {
-   snprintf(buf, SCHEDULER_CMD_SIZE, "TSUITE_VERBOSE=%d ELM_ENGINE='buffer' 
TSUITE_DEST_DIR='%s/" ORIG_SUBDIR "' TSUITE_FILE_NAME='%s/%s.rec' 
TSUITE_TEST_NAME='%s' LD_PRELOAD='%s' %s",
+   snprintf(buf, SCHEDULER_CMD_SIZE, "TSUITE_VERBOSE=%d ELM_ENGINE='buffer' 
TSUITE_DEST_DIR='%s/" ORIG_SUBDIR "' TSUITE_FILE_NAME='%s/%s.rec' 
TSUITE_TEST_NAME='%s' LD_PRELOAD='%s' %s %s",
          exactness_config.verbose,
          exactness_config.dest_dir,
          exactness_config.base_dir, ent->name,
          ent->name, LIBEXACTNESS_PATH,
+         exactness_config.wrap_command,
          ent->command);
 
    run_test_prefix_rm(ORIG_SUBDIR, ent->name);

-- 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may

Reply via email to