def setUp(self): super()._setUp(bf=BuildFlags( "cmake_vars", cmake_vars=["VARFOO=BAR", "CMAKE_VERBOSE_MAKEFILE=1"]), yml="""\ cmake_vars: VARFOO=BAR CMAKE_VERBOSE_MAKEFILE=1 """)
def check_cm(self, cm): with self.subTest(name=self.name, msg=self.name): for a in self.non_empty: v = cm[a] if a != 'toolchain': v = BuildFlags.flag_str_to_list(v) self.assertEqual(v, getattr(self.bf, a)) for a in BuildFlags.attrs: if a not in self.non_empty: self.assertTrue(not hasattr(cm, a))
def setUp(self): self._setUp(bf=BuildFlags( "cmake_vars_and_cxxflags", cmake_vars=["VARFOO=BAR", "CMAKE_VERBOSE_MAKEFILE=1"], cxxflags=[ "-std=c++11", "-Wall", ]), yml="""\ cmake_vars: VARFOO=BAR CMAKE_VERBOSE_MAKEFILE=1 cxxflags: -std=c++11 -Wall """)
def setUp(self): self._setUp(bf=BuildFlags( "cmake_vars_and_cxxflags", cmake_vars=["VARFOO=BAR", "CMAKE_VERBOSE_MAKEFILE=1"], defines=["FOO", "BAR", "VFOO=baaaaaaaaaa"], cflags=[ "-std=c++11", "-Wall", ], cxxflags=[ "-std=c++11", "-Wall", ], toolchain="somefile.cmake"), yml="""\ cmake_vars: VARFOO=BAR CMAKE_VERBOSE_MAKEFILE=1 defines: FOO BAR VFOO=baaaaaaaaaa cflags: -std=c++11 -Wall cxxflags: -std=c++11 -Wall toolchain: somefile.cmake """)
def setUp(self): self._setUp(bf=BuildFlags("empty"), yml="")
def do_roundtrip_load_save(self): bf = BuildFlags("") bf.load_config(self.cm) cm = CommentedMap() bf.save_config(cm) return cm
def do_roundtrip_save_load(self): cm = CommentedMap() self.bf.save_config(cm) bf = BuildFlags("") bf.load_config(cm) return bf
def do_load(self): cm = self.cm.copy() bf = BuildFlags("") bf.load_config(cm) return bf