# apt-get libns3-dev ns3
#
#
-sudo: required
+#sudo: required
dist: trusty
language: cpp
compiler:
# - cd ..
# - ls -lR $TRAVIS_BUILD_DIR/LuaInstall
-# Still need sudo for update-alternatives
script:
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3; fi
- cmake -Denable_documentation=OFF -Denable_coverage=OFF -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=OFF -Denable_compile_optimizations=OFF -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON .
# run make in the sonar wrapper && run the tests only if the build suceeded
- ./tools/internal/travis-sonarqube.sh make VERBOSE=1 && ctest --output-on-failure --timeout 100
+# C examples
foreach(x actions-comm actions-storage app-masterworker app-pingpong app-pmm app-token-ring async-wait async-waitall
async-waitany cloud-capping cloud-masterworker cloud-migration cloud-simple cloud-two-tasks
dht-chord dht-pastry energy-consumption energy-onoff energy-pstate energy-ptask energy-vm platform-failures
io-file io-remote io-storage task-priority process-create process-kill process-migration process-suspend
- platform-properties maestro-set process-startkilltime synchro-semaphore trace-categories
+ platform-properties process-startkilltime synchro-semaphore trace-categories
trace-route-user-variables trace-link-user-variables trace-masterworker trace-platform
trace-process-migration trace-host-user-variables)
add_executable (${x} ${x}/${x}.c)
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
endforeach()
+# CPP examples
+foreach(x maestro-set)
+ add_executable (${x} ${x}/${x}.cpp)
+ target_link_libraries(${x} simgrid)
+ set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
+ set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
+ set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
+endforeach()
+
if(HAVE_NS3)
add_executable (network-ns3 network-ns3/network-ns3.c)
target_link_libraries(network-ns3 simgrid)
endforeach()
foreach (file actions-comm actions-storage app-bittorrent app-chainsend app-masterworker app-pingpong async-wait
- async-waitall async-waitany dht-chord dht-kademlia io-remote platform-properties maestro-set
+ async-waitall async-waitany dht-chord dht-kademlia io-remote platform-properties
task-priority)
set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/${file}/${file}_d.xml)
endforeach()
+++ /dev/null
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "simgrid/msg.h"
-
-/** @addtogroup MSG_examples
- *
- * - <b>sendrecv/sendrecv.c: Ping-pong example</b>. It's hard to think of a simpler example. The tesh files laying in
- * the directory are instructive concerning the way to pass options to the simulators (as described in \ref options).
- */
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-
-double task_comm_size_lat = 1;
-double task_comm_size_bw = 10e8;
-
-static int sender(int argc, char *argv[])
-{
- msg_host_t host = NULL;
- double time;
- msg_task_t task_la = NULL;
- msg_task_t task_bw = NULL;
- char sprintf_buffer_la[64];
- char sprintf_buffer_bw[64];
-
- XBT_INFO("sender");
- XBT_INFO("host = %s", argv[1]);
-
- host = MSG_host_by_name(argv[1]);
-
- if (host == NULL) {
- XBT_INFO("Unknown host %s. Stopping Now! ", argv[1]);
- abort();
- }
-
- /* Latency */
- time = MSG_get_clock();
- snprintf(sprintf_buffer_la,64, "latency task");
- task_la = MSG_task_create(sprintf_buffer_la, 0.0, task_comm_size_lat, NULL);
- task_la->data = xbt_new(double, 1);
- *(double *) task_la->data = time;
- XBT_INFO("task_la->data = %e", *((double *) task_la->data));
- MSG_task_send(task_la, argv[1]);
-
- /* Bandwidth */
- time = MSG_get_clock();
- snprintf(sprintf_buffer_bw,64, "bandwidth task");
- task_bw = MSG_task_create(sprintf_buffer_bw, 0.0, task_comm_size_bw, NULL);
- task_bw->data = xbt_new(double, 1);
- *(double *) task_bw->data = time;
- XBT_INFO("task_bw->data = %e", *((double *) task_bw->data));
- MSG_task_send(task_bw, argv[1]);
-
- return 0;
-}
-
-static int receiver(int argc, char *argv[])
-{
- msg_task_t task_la = NULL;
- msg_task_t task_bw = NULL;
-
- XBT_INFO("receiver");
-
- /* Get Latency */
- int a = MSG_task_receive(&task_la,MSG_host_get_name(MSG_host_self()));
- xbt_assert(a == MSG_OK, "Unexpected behavior");
-
- double time1 = MSG_get_clock();
- double sender_time = *((double *) (task_la->data));
- double time = sender_time;
- double communication_time = time1 - time;
- XBT_INFO("Task received : %s", task_la->name);
- xbt_free(task_la->data);
- MSG_task_destroy(task_la);
- XBT_INFO("Communic. time %e", communication_time);
- XBT_INFO("--- la %f ----", communication_time);
-
- /* Get Bandwidth */
- a = MSG_task_receive(&task_bw,MSG_host_get_name(MSG_host_self()));
- xbt_assert(a == MSG_OK, "Unexpected behavior");
- time1 = MSG_get_clock();
- sender_time = *((double *) (task_bw->data));
- time = sender_time;
- communication_time = time1 - time;
- XBT_INFO("Task received : %s", task_bw->name);
- xbt_free(task_bw->data);
- MSG_task_destroy(task_bw);
- XBT_INFO("Communic. time %e", communication_time);
- XBT_INFO("--- bw %f ----", task_comm_size_bw / communication_time);
-
- return 0;
-}
-
-struct application {
- const char* platform_file;
- const char* application_file;
-};
-
-/** Test function */
-static msg_error_t test_all(struct application* app)
-{
- msg_error_t res = MSG_OK;
-
- MSG_create_environment(app->platform_file);
-
- /* Become one of the simulated process.
- *
- * This must be done after the creation of the platform because we are depending attaching to a host.*/
- MSG_process_attach("sender", NULL, MSG_host_by_name("Tremblay"), NULL);
-
- MSG_function_register("receiver", receiver);
-
- MSG_launch_application(app->application_file);
-
- // Execute the sender code:
- const char* argv[3] = { "sender", "Jupiter", NULL };
- sender(2, (char**) argv);
-
- MSG_process_detach();
- return res;
-} /* end_of_test_all */
-
-static void maestro(void* data)
-{
- MSG_main();
-}
-
-/** Main function */
-int main(int argc, char *argv[])
-{
- msg_error_t res = MSG_OK;
-
- struct application app;
- app.platform_file = argv[1];
- app.application_file = argv[2];
-
- SIMIX_set_maestro(maestro, &app);
- MSG_init(&argc, argv);
-
- if (argc != 3) {
- XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]);
- xbt_die("example: %s msg_platform.xml msg_deployment.xml\n",argv[0]);
- }
-
- res = test_all(&app);
-
- XBT_INFO("Total simulation time: %e", MSG_get_clock());
- return res != MSG_OK;
-}
--- /dev/null
+/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/** @addtogroup MSG_examples
+ *
+ * - <b>maestro-set/maestro-set.cpp: Switch the system thread hosting our maestro</b>.
+ * That's a very advanced example in which we move the maestro thread to another process.
+ * Not many users need it (maybe only one, actually), but this example is also a regression test.
+ *
+ * This example is in C++ because we use C++11 threads to ensure that the feature is working as
+ * expected. You can still use that feature from a C code.
+ */
+
+#include "simgrid/msg.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
+
+#include <thread>
+
+std::thread::id root_id;
+
+static void ensure_root_tid() {
+ std::thread::id this_id = std::this_thread::get_id();
+ xbt_assert(root_id == this_id, "I was supposed to be the main thread");
+ XBT_INFO("I am the main thread, as expected");
+}
+static void ensure_other_tid() {
+ std::thread::id this_id = std::this_thread::get_id();
+ xbt_assert(this_id != root_id, "I was NOT supposed to be the main thread");
+ XBT_INFO("I am not the main thread, as expected");
+}
+
+
+
+static int sender(int argc, char *argv[])
+{
+ ensure_root_tid();
+
+ msg_task_t task_la = MSG_task_create("Some task", 0.0, 10e8, NULL);
+ MSG_task_send(task_la, "some mailbox");
+
+ return 0;
+}
+
+static int receiver(int argc, char *argv[])
+{
+ ensure_other_tid();
+
+ msg_task_t task_la = NULL;
+ xbt_assert(MSG_task_receive(&task_la,"some mailbox") == MSG_OK);
+ XBT_INFO("Task received");
+ MSG_task_destroy(task_la);
+
+ return 0;
+}
+
+static void maestro(void* data)
+{
+ ensure_other_tid();
+ MSG_process_create("receiver",&receiver,NULL,MSG_host_by_name("Jupiter"));
+ MSG_main();
+}
+
+/** Main function */
+int main(int argc, char *argv[])
+{
+ root_id = std::this_thread::get_id();
+
+ SIMIX_set_maestro(maestro, NULL);
+ MSG_init(&argc, argv);
+
+ if (argc != 2) {
+ XBT_CRITICAL("Usage: %s platform_file\n", argv[0]);
+ xbt_die("example: %s msg_platform.xml\n",argv[0]);
+ }
+
+ MSG_create_environment(argv[1]);
+
+ /* Become one of the simulated process.
+ *
+ * This must be done after the creation of the platform because we are depending attaching to a host.*/
+ MSG_process_attach("sender", NULL, MSG_host_by_name("Tremblay"), NULL);
+ ensure_root_tid();
+
+ // Execute the sender code:
+ const char* subargv[3] = { "sender", "Jupiter", NULL };
+ sender(2, (char**) subargv);
+
+ MSG_process_detach(); // Become root thread again
+ XBT_INFO("Detached");
+ ensure_root_tid();
+
+ return 0;
+}
#! ./tesh
-! output sort 19
-$ $SG_TEST_EXENV maestro-set/maestro-set$EXEEXT ${srcdir:=.}/../platforms/small_platform.xml ${srcdir:=.}/maestro-set/maestro-set_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [ 0.000000] (1:sender@Tremblay) sender
-> [ 0.000000] (1:sender@Tremblay) host = Jupiter
-> [ 0.000000] (1:sender@Tremblay) task_la->data = 0.000000e+00
-> [ 0.000000] (2:receiver@Jupiter) receiver
-> [ 0.001462] (2:receiver@Jupiter) Task received : latency task
-> [ 0.001462] (2:receiver@Jupiter) Communic. time 1.461656e-03
-> [ 0.001462] (2:receiver@Jupiter) --- la 0.001462 ----
-> [ 0.001462] (1:sender@Tremblay) task_bw->data = 1.461656e-03
-> [138.703988] (0:maestro@) Total simulation time: 1.387040e+02
-> [138.703988] (2:receiver@Jupiter) Task received : bandwidth task
-> [138.703988] (2:receiver@Jupiter) Communic. time 1.387025e+02
-> [138.703988] (2:receiver@Jupiter) --- bw 7209674.030423 ----
+$ $SG_TEST_EXENV maestro-set/maestro-set$EXEEXT ${srcdir:=.}/../platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [ 0.000000] (0:maestro@) I am not the main thread, as expected
+> [ 0.000000] (2:receiver@Jupiter) I am not the main thread, as expected
+> [ 0.000000] (1:sender@Tremblay) I am the main thread, as expected
+> [ 0.000000] (1:sender@Tremblay) I am the main thread, as expected
+> [150.159342] (2:receiver@Jupiter) Task received
+> [150.159342] (0:maestro@) Detached
+> [150.159342] (0:maestro@) I am the main thread, as expected
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
-<platform version="4"><!-- For using with ping_pong, platform_sendrecv.xml -->
- <process host="Jupiter" function="receiver"/>
-</platform>
XBT_INFO("Task '%s' start time: %f, finish time: %f", SD_task_get_name(task), SD_task_get_start_time(task),
SD_task_get_finish_time(task));
}
+ xbt_dynar_free(&changed_tasks);
/* let throttle the communication for taskD if its parent is SD_DONE */
/* the bandwidth is 1.25e8, the data size is 1e7, and we want to throttle the bandwidth by a factor 2.
< replay/actions1.txt
$ mkfile ./split_traces_tesh
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay ./split_traces_tesh --log=smpi_kernel.thres:warning
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay ./split_traces_tesh --log=smpi_kernel.thres:warning
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9'
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304'
*/
XBT_PUBLIC(void) surf_network_model_init_CM02();
-#if HAVE_NS3
/** \ingroup SURF_models
* \brief Initializes the platform with the network model NS3
*
* \see surf_host_model_init_NS3()
*/
XBT_PUBLIC(void) surf_network_model_init_NS3();
-#endif
/** \ingroup SURF_models
* \brief Initializes the platform with the network model Reno
surf_network_model_init_IB},
{"CM02", "Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of small messages are thus poorly modeled).",
surf_network_model_init_CM02},
-#if HAVE_NS3
{"NS3", "Network pseudo-model using the NS3 tcp model instead of an analytic model", surf_network_model_init_NS3},
-#endif
{"Reno", "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
surf_network_model_init_Reno},
{"Reno2", "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
{nullptr, nullptr, nullptr} /* this array must be nullptr terminated */
};
+#if ! HAVE_SMPI
+void surf_network_model_init_SMPI() {
+ xbt_die("Please activate SMPI support in cmake to use the SMPI network model.");
+}
+void surf_network_model_init_IB() {
+ xbt_die("Please activate SMPI support in cmake to use the IB network model.");
+}
+#endif
+#if !HAVE_NS3
+void surf_network_model_init_NS3() {
+ xbt_die("Please activate NS3 support in cmake and install the dependencies to use the NS3 network model.");
+}
+#endif
+
s_surf_model_description_t surf_cpu_model_description[] = {
{"Cas01", "Simplistic CPU model (time=size/power).", surf_cpu_model_init_Cas01},
{nullptr, nullptr, nullptr} /* this array must be nullptr terminated */
*/
int xbt_replay_action_runner(int argc, char *argv[])
{
- int i;
if (xbt_action_fp) { // A unique trace file
while (true) {
char **evt = action_get_action(argv[0]);
if (evt == nullptr)
- break;
+ break;
char* lowername = str_tolower (evt[1]);
action_fun function = (action_fun)xbt_dict_get(xbt_action_funs, lowername);
catch(xbt_ex& e) {
xbt_die("Replay error :\n %s", e.what());
}
- for (i=0;evt[i]!= nullptr;i++)
+ for (int i=0;evt[i]!= nullptr;i++)
free(evt[i]);
free(evt);
}
src/smpi/smpi_topo.cpp
src/smpi/smpi_utils.cpp
src/smpi/smpi_f77.cpp
+
+ src/surf/network_smpi.cpp
+ src/surf/network_ib.cpp
)
set(XBT_SRC
src/surf/network_cm02.cpp
src/surf/network_constant.cpp
src/surf/network_interface.cpp
- src/surf/network_smpi.cpp
- src/surf/network_ib.cpp
src/surf/plugins/energy.cpp
src/surf/PropertyHolder.cpp
src/surf/sg_platf.cpp
/sw
/usr
)
+mark_as_advanced(VALGRIND_EXE)
-if(VALGRIND_EXE)
- message(STATUS "Found valgrind: ${VALGRIND_EXE}")
- set (TESH_OPTION ${TESH_OPTION} --setenv VALGRIND_COMMAND=${CMAKE_HOME_DIRECTORY}/tools/cmake/scripts/my_valgrind.pl)
-endif()
+if(enable_memcheck)
+ if (NOT VALGRIND_EXE MATCHES "NOTFOUND")
+ execute_process(COMMAND ${VALGRIND_EXE} --version OUTPUT_VARIABLE "VALGRIND_VERSION")
+ message(STATUS "Valgrind version: ${VALGRIND_VERSION}")
-if(enable_memcheck_xml)
- SET(VALGRIND_EXTRA_COMMAND_OPTIONS "--xml=yes\ --xml-file=memcheck_test_%p.memcheck\ --child-silent-after-fork=yes")
-endif()
+ set(TESH_WRAPPER ${CMAKE_HOME_DIRECTORY}/tools/cmake/scripts/my_valgrind.pl)
+ set(TESH_WRAPPER ${TESH_WRAPPER}\ --trace-children=yes\ --trace-children-skip=/usr/bin/*,/bin/*\ --leak-check=full\ --show-reachable=yes\ --track-origins=no\ --read-var-info=no\ --num-callers=20\ --suppressions=${CMAKE_HOME_DIRECTORY}/tools/simgrid.supp\ )
+ if(enable_memcheck_xml)
+ SET(TESH_WRAPPER ${TESH_WRAPPER}\ --xml=yes\ --xml-file=memcheck_test_%p.memcheck\ --child-silent-after-fork=yes\ )
+ endif()
-if(VALGRIND_EXE)
- execute_process(COMMAND ${VALGRIND_EXE} --version OUTPUT_VARIABLE "VALGRIND_VERSION")
- string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" NEW_VALGRIND_VERSION "${VALGRIND_VERSION}")
- if(NEW_VALGRIND_VERSION)
- message(STATUS "Valgrind version: ${NEW_VALGRIND_VERSION}")
- set (TESH_OPTION ${TESH_OPTION} --setenv "VALGRIND_OPTIONS=--trace-children=yes\ --trace-children-skip=/usr/bin/*,/bin/*\ --leak-check=full\ --show-reachable=yes\ --track-origins=no\ --read-var-info=no\ --num-callers=20\ --suppressions=${CMAKE_HOME_DIRECTORY}/tools/simgrid.supp\ ${VALGRIND_EXTRA_COMMAND_OPTIONS}" )
- message(STATUS "Valgrind options: ${TESH_OPTION}")
+# message(STATUS "tesh wrapper: ${TESH_WRAPPER}")
+
+ mark_as_advanced(TESH_WRAPPER)
else()
set(enable_memcheck false)
message(STATUS "Error: Command valgrind not found --> enable_memcheck autoset to false.")
endif()
-else()
- set(enable_memcheck false)
- message(FATAL_ERROR "Command valgrind not found --> enable_memcheck autoset to false.")
endif()
-
-mark_as_advanced(VALGRIND_EXE)
IF(WIN32)
STRING(REPLACE "ยง" "\;" ARGT "${ARGT}")
ENDIF()
- ADD_TEST(${NAME} ${TESH_COMMAND} ${TESH_OPTION} ${ARGT})
+ if(TESH_WRAPPER)
+ ADD_TEST(${NAME} ${TESH_COMMAND} --wrapper "${TESH_WRAPPER}" ${TESH_OPTION} ${ARGT})
+ else()
+ ADD_TEST(${NAME} ${TESH_COMMAND} ${TESH_OPTION} ${ARGT})
+ endif()
ENDMACRO()
MACRO(ADD_TESH_FACTORIES NAME FACTORIES)
#!/usr/bin/env perl
-# Copyright (c) 2012-2014. The SimGrid Team.
-# All rights reserved.
+# Copyright (c) 2012-2016. The SimGrid Team. All rights reserved.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the license (GNU LGPL) which comes with this package.
my $count = 0;
while (defined(my $arg = shift)) {
- #print "arg($count)$arg\n";
+# print "arg($count)$arg\n";
if ($arg =~ m!/smpirun$!) {
@argv = ( $arg, "-wrapper", "@argv" );
} elsif ($arg eq "--cd") {
$count++;
}
-#print "COMMAND : $bin $option $cd $path\n";
-#print "cd $path\n";
-#print "valgrind --trace-children=yes --leak-check=full --show-reachable=yes --track-origins=yes --read-var-info=no $bin $option\n";
-#print "@argv\n\n";
+# print "COMMAND:";
+# map { print "$_ " } @argv;
+# print "\n";
+
system @argv;
-$ cmake -E remove_directory temp_testdir_background
-$ mkdir temp_testdir_background
-$ cd temp_testdir_background
+$ cmake -E remove bgtesh.pl bgtesh.data
< use strict;
-< sleep(2);
-< open (FILE, "<tmp_fich") || die "Cannot open tmp_fich: $!\n";
+< sleep(1);
+< open (FILE, "<bgtesh.data") || die "Cannot open bgtesh.data: $!\n";
<
< while (<FILE>) {
< print;
< }
+< close(FILE);
< exit 0;
<
-$ mkfile delayed_cat.pl
+$ mkfile bgtesh.pl
-& perl delayed_cat.pl
+& perl bgtesh.pl
> TOTO
< TOTO
-$ mkfile tmp_fich
+$ mkfile bgtesh.data
$ sleep 2
-$ cd ..
-$ cmake -E remove_directory temp_testdir_background
+$ cmake -E remove bgtesh.pl bgtesh.data
# then, even better:
# ! expect (\1 > 500)
+# TODO: If the output is sorted, we should report it to the users. Corresponding perl chunk
+# print "WARNING: Both the observed output and expected output were sorted as requested.\n";
+# print "WARNING: Output were only sorted using the $sort_prefix first chars.\n"
+# if ( $sort_prefix > 0 );
+# print "WARNING: Use <! output sort 19> to sort by simulated date and process ID only.\n";
+#
+# print "----8<--------------- Begin of unprocessed observed output (as it should appear in file):\n";
+# map {print "> $_\n"} @{$cmd{'unsorted got'}};
+# print "--------------->8---- End of the unprocessed observed output.\n";
+
+
"""
if sys.version_info[0] == 3:
import subprocess
import _thread
-elif sys.version_info[0] < 3:
- import subprocess32 as subprocess
- import thread as _thread
else:
- raise "This program has not been made to exist this long"
+ raise "This program is expected to run with Python3 only"
self.threads = []
self.args_suffix = ""
self.ignore_regexps_common = []
+ self.wrapper = None
def add_thread(self, thread):
self.threads.append(thread)
t.acquire()
t.release()
-
-
-
#Command line object
class Cmd(object):
def __init__(self):
if file is None:
fatal_error("Unable to create file "+filename)
file.write("\n".join(self.input_pipe))
+ file.write("\n")
file.close()
def _cmd_cd(self, argline):
if lock is not None: lock.release()
return
+ if TeshState().wrapper is not None:
+ self.timeout *= 20
+ self.args = TeshState().wrapper + self.args
+
self.args += TeshState().args_suffix
print("["+FileReader().filename+":"+str(self.linenumber)+"] "+self.args)
-
+
args = shlex.split(self.args)
#print (args)
try:
-
-
-
-
-
-
##############
#
# Main
group1.add_argument('--cfg', metavar='arg', help='add parameter --cfg=arg to each command line')
group1.add_argument('--log', metavar='arg', help='add parameter --log=arg to each command line')
group1.add_argument('--enable-coverage', action='store_true', help='ignore output lines starting with "profiling:"')
+ group1.add_argument('--wrapper', metavar='arg', help='Run each command in the provided wrapper (eg valgrind)')
try:
options = parser.parse_args()
TeshState().args_suffix += " --cfg="+options.cfg
if options.log is not None:
TeshState().args_suffix += " --log="+options.log
-
+
+ if options.wrapper is not None:
+ TeshState().wrapper = options.wrapper
#cmd holds the current command line
# tech commands will add some parameters to it
print("Test suite from stdin OK")
else:
print("Test suite `"+f.filename+"' OK")
-
-
-
-
-