Example #1
0
    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
""")
Example #2
0
 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))
Example #3
0
    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
""")
Example #4
0
    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
""")
Example #5
0
 def setUp(self):
     self._setUp(bf=BuildFlags("empty"), yml="")
Example #6
0
 def do_roundtrip_load_save(self):
     bf = BuildFlags("")
     bf.load_config(self.cm)
     cm = CommentedMap()
     bf.save_config(cm)
     return cm
Example #7
0
 def do_roundtrip_save_load(self):
     cm = CommentedMap()
     self.bf.save_config(cm)
     bf = BuildFlags("")
     bf.load_config(cm)
     return bf
Example #8
0
 def do_load(self):
     cm = self.cm.copy()
     bf = BuildFlags("")
     bf.load_config(cm)
     return bf