How to use the wutils.get_command_template function in wutils

To help you get started, we’ve selected a few wutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github samueljero / snake / ns-3-dev / regression.py View on Github external
if not os.path.exists(reference_traces_path):
            print "Cannot locate reference traces in " + reference_traces_path
            return 1

        if is_pyscript:
            script = os.path.abspath(os.path.join('..', *os.path.split(program)))
            argv = [self.env['PYTHON'], script] + arguments
            try:
                wutils.run_argv(argv, self.env, cwd=trace_output_path, force_no_valgrind=True)
            except Utils.WafError, ex:
                print >> sys.stderr, ex
                return 1
        else:
            try:
                wutils.run_program(program, self.env,
                                   command_template=wutils.get_command_template(self.env, arguments),
                                   cwd=trace_output_path)
            except Utils.WafError, ex:
                print >> sys.stderr, ex
                return 1

        rc = diff(trace_output_path, reference_traces_path, Options.options.verbose)
        if rc:
            print "----------"
            print "Traces differ in test: ", self.test_name
            print "Reference traces in directory: " + reference_traces_path
            print "Traces in directory: " + trace_output_path
            print "Run the following command for details:"
            print "\tdiff -u %s %s" % (reference_traces_path, trace_output_path)
            if not Options.options.verbose:
                print "Or re-run regression testing with option -v"
            print "----------"
github samueljero / snake / ns-3-dev / regression.py View on Github external
def run_reference_generate(self, trace_output_path, program, arguments, is_pyscript):
        if is_pyscript:
            script = os.path.abspath(os.path.join('..', *os.path.split(program)))
            argv = [self.env['PYTHON'], script] + arguments
            try:
                retval = wutils.run_argv(argv, self.env, cwd=trace_output_path, force_no_valgrind=True)
            except Utils.WafError, ex:
                print >> sys.stderr, ex
                return 1
        else:
            try:
                retval = wutils.run_program(program, self.env,
                                            command_template=wutils.get_command_template(self.env, arguments),
                                            cwd=trace_output_path)
            except Utils.WafError, ex:
                print >> sys.stderr, ex
                return 1
        return retval

wutils

A collection of useful functions/classes for data analysis and ML.

MIT
Latest version published 3 years ago

Package Health Score

33 / 100
Full package analysis