|
From: <son...@us...> - 2008-07-29 18:48:15
|
Revision: 382
http://cbench.svn.sourceforge.net/cbench/?rev=382&view=rev
Author: sonicsoft70
Date: 2008-07-29 18:48:13 +0000 (Tue, 29 Jul 2008)
Log Message:
-----------
added a capability that will allow job templates
to let the cbench_gen_jobs script know when they
require a certain gen_jobs module. if the module
is unavailable, cbench_gen_jobs won't try to gen
those jobs. if you do generate jobs that require
custom generation generically, you'll get weird
errors from the jobs when then run
Modified Paths:
--------------
trunk/cbench/tools/cbench_gen_jobs.pl
Modified: trunk/cbench/tools/cbench_gen_jobs.pl
===================================================================
--- trunk/cbench/tools/cbench_gen_jobs.pl 2008-07-28 23:08:49 UTC (rev 381)
+++ trunk/cbench/tools/cbench_gen_jobs.pl 2008-07-29 18:48:13 UTC (rev 382)
@@ -182,13 +182,29 @@
# delete the Cbench internal combobatch "job" since we won't use
# it in this context
delete $templates{combobatch};
+
+# we need to make sure that any job templates we are going to try
+# to generate don't requite a gen_jobs module we don't have
+foreach my $k (keys %templates) {
+ if ($templates{$k}{batch} =~ /#\s+Cbench_require: (\S+)::(\S+)/) {
+ debug_print(2,"DEBUG: job template $k requires $1::$2");
+ if (! exists $genjobs_modules{$2}) {
+ warning_print("Will not generate for job template \'$k\': required module $1::$2 not found\n");
+ delete $templates{$k};
+ }
+ }
+}
+#print Dumper (%templates);
+
# by default the list of jobs is the list of templates found
our @job_list = keys %templates;
debug_print(2,"DEBUG: default job_list= @job_list");
+# if we have no jobs to generate, say so and exit
+if (scalar keys %templates <= 0) {
+ warning_print("No jobs to generate...exiting");
+ exit 1;
+}
-#print Dumper(%custom_gen_hash);
-#print Dumper(%templates);
-
# run initialization subroutines for an custom generation code
custom_gen_init($testset);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|