summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-10-20 10:28:51 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-10-20 10:28:51 +0800
commit9682d0ef30ea73a00b6ad6153db52bd2d9ae7c73 (patch)
tree1e980e5a7883ca2ed89e902a4e2fabd24248eb72 /tools
parent4bc99a22eb051a3a2fa877a95764a19cea33c8ac (diff)
downloadmrust-9682d0ef30ea73a00b6ad6153db52bd2d9ae7c73.tar.gz
testrunner - Support 'skip-codegen'
Diffstat (limited to 'tools')
-rw-r--r--tools/testrunner/main.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/testrunner/main.cpp b/tools/testrunner/main.cpp
index b1d494c5..148fff9d 100644
--- a/tools/testrunner/main.cpp
+++ b/tools/testrunner/main.cpp
@@ -58,6 +58,12 @@ struct TestDesc
::std::vector<::std::string> m_pre_build;
::std::vector<::std::string> m_extra_flags;
bool ignore;
+ bool no_run;
+ TestDesc()
+ :ignore(false)
+ ,no_run(false)
+ {
+ }
};
struct Timestamp
{
@@ -273,6 +279,10 @@ int main(int argc, const char* argv[])
{
td.ignore = true;
}
+ else if( line.substr(start, 4+1+7) == "skip-codegen" )
+ {
+ td.no_run = true;
+ }
else if( line.substr(start, 14) == "compile-flags:" )
{
auto end = line.find(' ', 3+14);
@@ -413,7 +423,13 @@ int main(int argc, const char* argv[])
test_exe_ts = Timestamp::for_file(test_exe);
}
// - Run the test
- if( test_output_ts < test_exe_ts )
+ if( test.no_run )
+ {
+ ::std::ofstream(test_output.str()) << "";
+ if( opts.debug_level > 0 )
+ DEBUG("No run " << test.m_name);
+ }
+ else if( test_output_ts < test_exe_ts )
{
auto run_out_file_tmp = test_output + ".tmp";
if( !run_executable(test_exe, { test_exe.str().c_str() }, run_out_file_tmp, 10) )