def test_make_clean(self,): fs.cd("tests/data/makeproj") make.make() self._test(True, fs.isfile("foo")) self._test(True, fs.isfile("foo.o")) make.clean() self._test(False, fs.isfile("foo")) self._test(False, fs.isfile("foo.o")) fs.cdpop()
def test_make_clean(): fs.cd("labm8/data/test/makeproj") make.make() assert fs.isfile("foo") assert fs.isfile("foo.o") make.clean() assert not fs.isfile("foo") assert not fs.isfile("foo.o") fs.cdpop()
def setup(self): """ Testcase setup. To setup a test case, we need to checkout the correct git branch, set the optimisation level, and build the program. """ const = self.invars["const"] olevel = self.invars["Olevel"] # Checkout correct source. if const: git.checkout("master") else: git.checkout("no-const") # Set Olevel system.sed("(^OPTIMISATION_LEVEL = ).*", "\\1{}" % olevel, "Makefile") # Build project. make.clean() make.target("./examples/example1")
def setup(self): """ Testcase setup. Set the correct border size, then build the benchmark. """ border = self.invars["border"] # Set the border size. system.sed("(define NORTH) [0-9]+", "\\1 {}" % border[0], self.SRC) system.sed("(define WEST) [0-9]+", "\\1 {}" % border[1], self.SRC) system.sed("(define SOUTH) [0-9]+", "\\1 {}" % border[2], self.SRC) system.sed("(define EAST) [0-9]+", "\\1 {}" % border[3], self.SRC) # Build benchmark. fs.cd(BUILD_ROOT) make.clean() make.target("SimpleBig")