3 # Copyright (c) 2012, 2014. The SimGrid Team.
6 # This program is free software; you can redistribute it and/or modify it
7 # under the terms of the license (GNU LGPL) which comes with this package.
11 # input file = AddTest.txt
14 die "Usage: generate_new_tests.pl AddTests.cmake\n";
17 open MAKETEST, $ARGV[0] or die "Unable to open $ARGV[1]. $!\n";
27 while(defined($line=<MAKETEST>))
30 if($line =~ /BEGIN CONTEXTS FACTORY/) {
35 if($line =~ /HAVE_TRACING/) {
40 if($line =~ /HAVE_LUA/) {
45 if($line =~ /HAVE_RUBY/) {
52 if($line =~ /ADD_TEST.*\/bin\/tesh/)
60 if($line =~ /ADD_TEST\(([\S]+)/)
64 if($line =~ /--cfg\s*\t*(\S*)/)
66 $config_var = "--cfg $1 $config_var";
68 if($line =~ /--cd\s*(\S+)/)
72 if($line =~ /--setenv\s*\t*(\S*)\=(\S*)/)
74 $setenv = "--setenv $1=$2 $setenv";
76 if($line =~ /([\S]+)[)]$/)
81 print "ADD_TEST($name_test-raw \$\{CMAKE_BINARY_DIR\}/bin/tesh --cfg contexts/factory:raw $config_var $setenv $path $tesh_file)\n";
82 print "ADD_TEST($name_test-thread \$\{CMAKE_BINARY_DIR\}/bin/tesh --cfg contexts/factory:thread $config_var $setenv $path $tesh_file)\n";
83 print "ADD_TEST($name_test-ucontext \$\{CMAKE_BINARY_DIR\}/bin/tesh --cfg contexts/factory:ucontext $config_var $setenv $path $tesh_file)\n";
85 elsif($line =~ /set_tests_properties\(([\S]+)/)
88 $line =~ s/$name_temp/$name_temp-raw $name_temp-thread $name_temp-ucontext/g;