1 diff --git solenv/bin/build.pl solenv/bin/build.pl
2 index d9e862a..d4084b9 100644
3 --- solenv/bin/build.pl
4 +++ solenv/bin/build.pl
6 # the server considered as an error/client crash
7 my %lost_client_jobs = (); # hash containing lost jobs
8 my %job_jobdir = (); # hash containing job-dir pairs
10 + $unit_tests = 0; # use tests.lst in addition to build.lst & build with 'dmake check' there - for unit testing
11 + %unit_tests_dirs; # directories that should be built with 'dmake check'
16 @@ -503,7 +507,11 @@ sub dmake_dir {
18 RemoveFromDependencies($BuildDir, \%LocalDepsHash) if (!$child);
19 return if ($cmd_file || $show);
20 - $error_code = run_job($dmake, $BuildDir);
21 + my $dmake_command = $dmake;
22 + if ($unit_tests && exists $unit_tests_dirs{$BuildDir} && $unit_tests_dirs{$BuildDir}) {
23 + $dmake_command .= " check";
25 + $error_code = run_job($dmake_command, $BuildDir);
29 @@ -512,14 +520,14 @@ sub dmake_dir {
31 # system("$perl $mkout");
33 -# $error_code = system ("$dmake > $log_file 2>&1");
34 -# if (!$grab_output && -f $log_file) {
35 +# $error_code = system ("$dmake $dmake_check > $log_file 2>&1");
36 +# if (!$grab_output && -f $log_file) {
37 # system("cat $log_file");
40 -# $error_code = system ("$dmake");
41 +# $error_code = system ("$dmake $dmake_check");
45 html_store_job_info(\%LocalDepsHash, $BuildDir, $error_code) if (!$child);
47 if ($error_code && $ignore) {
48 @@ -562,8 +570,27 @@ sub store_build_list_content {
50 if (open (BUILD_LST, $build_list_path)) {
51 my @build_lst = <BUILD_LST>;
52 - $build_lists_hash{$module} = \@build_lst;
55 + # add the content of tests.lst to @build_lst if we are issued
58 + (my $tests_path = $build_list_path ) =~ s/build\.lst$/tests.lst/;
59 + if ($tests_path ne $build_list_path && open (TESTS_LST, $tests_path)) {
60 + while (<TESTS_LST>) {
62 + next if (!/\snmake\s/);
64 + push @build_lst, $_;
65 + if (/^\s*\S+\s+(\S+)/ ) {
66 + $unit_tests_dirs{CorrectPath($StandDir . $1)} = 1;
73 + $build_lists_hash{$module} = \@build_lst;
76 $dead_parents{$module}++;
77 @@ -1286,6 +1313,7 @@ sub get_options {
78 push (@dmake_args, get_dmake_args()) if (!$custom_job);
81 + $arg =~ /^check$/ and $unit_tests = 1 and next; # it's a dmake target, but we strip it here to add it later
82 push (@dmake_args, $arg);
85 @@ -1347,6 +1375,10 @@ sub get_dmake_args {
87 while ($arg = shift @ARGV) {
88 next if ($arg =~ /^--$/);
89 + if ($arg =~ /^check$/) {
91 + next; # it's a dmake target, but we strip it here to add it later
93 push (@job_args, $arg);
96 diff --git solenv/inc/target.mk solenv/inc/target.mk
97 index afb9580..614c10e 100644
98 --- solenv/inc/target.mk
99 +++ solenv/inc/target.mk
100 @@ -2080,3 +2080,10 @@ $(SUBDIRS) .PHONY :
101 # if the previous block was a rule or a target, "\#" isn't recognized
102 # as an escaped "#". if it was an assignment, escaping works...
103 some_unique_variable_name:=1
108 +# can be redefined in the makefiles to issue the real tests