How to use the tmt.runCmd function in tmt

To help you get started, we’ve selected a few tmt 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 thewca / tnoodle / noderacer / tmtproject.py View on Github external
def assertNodeInstallation(self):
        retVal = 1
        try:
            retVal = tmt.runCmd([ 'npm', '-version' ], interactive=True)
        except:
            pass
        if retVal != 0:
            print()
            print("It appears you do not have npm (node's package manager) installed.")
            print("Install node (http://nodejs.org/, it should provide npm) and try again.")
            sys.exit(1)
github thewca / tnoodle / stackmat-flash / tmtproject.py View on Github external
def configure(self):
        tmt.EclipseProject.configure(self)
        tmt.WinstoneServer.addPlugin(self)

        self.APPLET_FILENAME = join(self.name, 'StackApplet.swf')
        try:
            retVal, stdOut, stdErr = tmt.runCmd([ 'mxmlc', '--version' ])
        except OSError:
            retVal = 1

        self.mxmlcInstalled = (retVal == 0)
github thewca / tnoodle / noderacer / tmtproject.py View on Github external
def compile(self):
        self.assertNodeInstallation()
        oldDir = self._chdir()
        retVal = tmt.runCmd([ 'npm', 'install' ], interactive=True)
        assert retVal == 0
        os.chdir(oldDir)
github thewca / tnoodle / stackmat-flash / tmtproject.py View on Github external
# directory to the generated stackmat-flash/bin/StackApplet.swf.
                # This allows people without the flex sdk installed to work on tnoodle.
                # Fortunately, we don't follow symlinks when evaluating whether
                # a project needs to be rebuilt, so this symlink hack doesn't
                # force infinite rebuilds if mxmlc is installed.
                if not tmt.args.skip_noflex_warning:
                    realOutSwf = self.APPLET_FILENAME
                    print("""\n\nWARNING: It appears you do not have the flex sdk installed (specifically the mxmlc binary), which is needed to build stackmat-flash. I'm going to go ahead and use the version of %s from the git repository.""" % ( realOutSwf ))
                self.checkoutSwf(tempBin)
            else:
                # Wowow, you've gotta love it when you have such great tools
                asFile = join(src, 'StackApplet.as')
                if exists(asFile):
                    assert self.mxmlcInstalled
                    outSwf = self.APPLET_FILENAME
                    retVal, stdout, stderr = tmt.runCmd([ 'mxmlc', '-benchmark=True', '-creator=tnoodle', '-static-link-runtime-shared-libraries=true', '-output=%s' % outSwf, asFile ], showStatus=True)
                    assert retVal == 0

                    # Yikes. mxmlc doesn't seem to have any command line args to treat
                    # warnings as errors. Look what they've made me do!
                    assert len(stderr) == 0

            # Neither of the two operations above update the timestamp of a file in self.bin.
            # We explicitly update timestamp of a file in self.bin so there aren't any issues where we try
            # to recompile this project when we don't need to.
            f = open(join(tempBin, ".timestamp"), 'w')
            f.write("%s" % time.time())
github thewca / tnoodle / noderacer / tmtproject.py View on Github external
def run(self):
        self.compile()
        oldDir = self._chdir()
        tmt.runCmd([ 'node', 'noderacer.js' ], interactive=True)
        os.chdir(oldDir)
github thewca / tnoodle / stackmat-flash / tmtproject.py View on Github external
def checkoutSwf(self, bin):
        # If mxmlc is not installed, then we restore our applet from the repository,
        # because we can't recreate it.
        retVal, stdout, stderr = tmt.runCmd([ 'git', 'checkout', self.APPLET_FILENAME ], showStatus=True)
        assert retVal == 0