diff options
Diffstat (limited to 'tests/recipe/cxx/testscript')
-rw-r--r-- | tests/recipe/cxx/testscript | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/tests/recipe/cxx/testscript b/tests/recipe/cxx/testscript index 323e049..323d671 100644 --- a/tests/recipe/cxx/testscript +++ b/tests/recipe/cxx/testscript @@ -81,7 +81,7 @@ if (!$static && $test.target == $build.host) return r; if (verb == 1) - text << "cp " << t; + print_diag ("cp", s, t); else if (verb >= 2) text << "cp " << sp << ' ' << tp; @@ -93,7 +93,7 @@ if (!$static && $test.target == $build.host) $* 2>>~%EOE%; %^(c\+\+|ld).*%+ - cp file{foo} + cp file{bar} -> file{foo} EOE cat <<<foo >'bar'; @@ -141,7 +141,7 @@ if (!$static && $test.target == $build.host) const path& tp (t.path ()); if (verb == 1) - text << "test " << t; + print_diag ("test", t); else if (verb >= 2) text << "cat " << tp; @@ -157,7 +157,7 @@ if (!$static && $test.target == $build.host) $* test 2>>~%EOE%; %^(c\+\+|ld).*%+ - cp file{foo} + cp file{bar} -> file{foo} test file{foo} bar EOE @@ -165,6 +165,46 @@ if (!$static && $test.target == $build.host) $* clean 2>- } + : rule + : + { + cat <<EOI >=buildfile; + alias{far}: alias{bar} + alias{bar}: + + alias{~'/f(.+)/'}: alias{~'/b\1/'} + {{ c++ 1 -- + + #include <iostream> + + -- + + recipe + apply (action a, target& t) const override + { + const auto& mrs (t.data<regex_match_results> (a)); + + return [this, mr = mrs.str (1)] (action a, const target& t) + { + return perform_update (a, t, mr); + }; + } + + target_state + perform_update (action, const target&, const string& mr) const + { + text << pattern->rule_name << ": " << mr; + return target_state::changed; + } + }} + EOI + + $* 2>>~%EOE% + %^(c\+\+|ld).*%+ + <ad hoc pattern rule #1>: ar + EOE + } + # Clean recipe builds if the testscript is enabled (see above for details). # -$* clean 2>- |