blob: 32cead4be956e725ad9ab56ee9294a9a95fcd481 [file] [log] [blame]
Diana Picus3b2ef822016-10-13 16:53:18 +03001"""Command line interface tests for llvmprojs.py
2
3Note that although this uses the unittest framework, it does *not* contain unit
4tests.
5
6"""
7
8import shutil
9import os
10import subprocess
11import unittest
12
Diana Picus3b2ef822016-10-13 16:53:18 +030013from tempfile import mkdtemp
14from uuid import uuid4
15
16from linaropy.cd import cd
Diana Picus3601bea2017-05-29 11:26:18 +020017from llvmtestcase import LLVMTestCase
Diana Picus3b2ef822016-10-13 16:53:18 +030018
19
Diana Picus3601bea2017-05-29 11:26:18 +020020class Testllvmprojs(LLVMTestCase):
Diana Picusb4307602017-04-05 19:48:39 +020021
Diana Picus3b2ef822016-10-13 16:53:18 +030022 @classmethod
Diana Picus81089db2017-05-05 22:26:49 +020023 def llvm_projects(cls, *args, **kwargs):
Diana Picus3601bea2017-05-29 11:26:18 +020024 return cls.command_with_defaults("projects", *args, **kwargs)
Diana Picus81089db2017-05-05 22:26:49 +020025
26 @classmethod
Diana Picusefc7bda2017-06-09 19:14:08 +020027 def get_subproj_repo(cls, subproj):
28 return os.path.join(cls.repos, subproj)
29
30 @classmethod
Diana Picus3b2ef822016-10-13 16:53:18 +030031 def setUpClass(cls):
32 """Create the file structure and environment that llvmprojs expects"""
33 cls.llvm_root = mkdtemp()
34 cls.repos = os.path.join(cls.llvm_root, "repos")
35
36 cls.all_repos = ("llvm", "clang", "compiler-rt", "lld", "lldb",
37 "libcxx", "libcxxabi", "libunwind", "test-suite")
38
Diana Picus3b2ef822016-10-13 16:53:18 +030039 # Create dummy repos
40 for reponame in cls.all_repos:
Diana Picus3601bea2017-05-29 11:26:18 +020041 cls.create_dummy_repo(cls.get_subproj_repo(reponame))
Diana Picus3b2ef822016-10-13 16:53:18 +030042
43 @classmethod
44 def tearDownClass(cls):
45 shutil.rmtree(cls.llvm_root)
46
47 @classmethod
48 def setUp(cls):
Diana Picus81089db2017-05-05 22:26:49 +020049 cls.env = os.path.join(cls.llvm_root, "env" + str(uuid4()))
50 cls.llvm_src = os.path.join(cls.env, "llvm")
Diana Picus3b2ef822016-10-13 16:53:18 +030051
52 # Create LLVM worktree
53 cls.branch = "br" + str(uuid4())
Diana Picus3601bea2017-05-29 11:26:18 +020054 cls.add_worktree(cls.get_subproj_repo("llvm"), cls.llvm_src,
55 cls.branch)
Diana Picus3b2ef822016-10-13 16:53:18 +030056
Diana Picus3b2ef822016-10-13 16:53:18 +030057 @classmethod
58 def tearDown(cls):
59 # Clean up the directories where we might have added subprojects.
60 # This isn't 100% clean, because we don't clean up the repos between
61 # tests (so any branches will remain), but it's good enough for the
62 # current tests.
63 for subprojdir in (os.path.join(cls.llvm_src, "projects"),
64 os.path.join(cls.llvm_src, "tools")):
65 if os.path.isdir(subprojdir):
66 shutil.rmtree(subprojdir)
67 os.makedirs(subprojdir)
68
69 # Run prune on the original repos, to remove any dangling worktrees.
70 for reponame in cls.all_repos:
Diana Picus3601bea2017-05-29 11:26:18 +020071 repopath = cls.get_subproj_repo(reponame)
Diana Picus3b2ef822016-10-13 16:53:18 +030072 with cd(repopath):
73 cls.run_quietly(["git", "worktree", "prune"])
74
Diana Picusadb07c42017-11-22 16:12:57 +010075 def test_repos_arg_is_compulsory_for_add(self):
Diana Picus81089db2017-05-05 22:26:49 +020076 """
Diana Picusadb07c42017-11-22 16:12:57 +010077 Test that we must pass in the repos when adding a subproject, but not
78 for other combinations of arguments.
Diana Picus81089db2017-05-05 22:26:49 +020079 """
80 with self.assertRaises(subprocess.CalledProcessError) as context:
Diana Picus81089db2017-05-05 22:26:49 +020081 self.run_with_output(
Diana Picus9f756862017-12-20 10:35:08 +010082 self.llvm_projects(
83 "--source-dir",
84 self.llvm_src,
85 "--add",
86 "clang"))
Diana Picus81089db2017-05-05 22:26:49 +020087
88 self.assertRegex(
89 str(context.exception.output),
Diana Picusadb07c42017-11-22 16:12:57 +010090 "(.*\n)*.*When adding a subproject you must also pass the --repos argument(.*\n)*")
Diana Picus81089db2017-05-05 22:26:49 +020091
Diana Picusadb07c42017-11-22 16:12:57 +010092 # These should not raise.
Diana Picus9f756862017-12-20 10:35:08 +010093 self.run_with_output(self.llvm_projects("--source-dir", self.llvm_src))
Diana Picusadb07c42017-11-22 16:12:57 +010094 self.run_with_output(
Diana Picus9f756862017-12-20 10:35:08 +010095 self.llvm_projects(
96 "--source-dir",
97 self.llvm_src,
98 "--remove",
99 "clang"))
Diana Picus81089db2017-05-05 22:26:49 +0200100
Diana Picus9f756862017-12-20 10:35:08 +0100101 def test_source_dir_is_compulsory(self):
Diana Picus81089db2017-05-05 22:26:49 +0200102 """
Diana Picus9f756862017-12-20 10:35:08 +0100103 Test that we must pass in the source dir for various combinations of
Diana Picus81089db2017-05-05 22:26:49 +0200104 input args.
105 """
106 with self.assertRaises(subprocess.CalledProcessError) as context:
Diana Picus9f756862017-12-20 10:35:08 +0100107 self.run_with_output(self.llvm_projects())
Diana Picus81089db2017-05-05 22:26:49 +0200108
109 self.assertRegex(
110 str(context.exception.output),
Diana Picus9f756862017-12-20 10:35:08 +0100111 "(.*\n)*.*the following arguments are required:(.*)--source-dir(.*\n)*")
Diana Picus81089db2017-05-05 22:26:49 +0200112
113 with self.assertRaises(subprocess.CalledProcessError) as context:
114 self.run_with_output(
115 self.llvm_projects(
Diana Picusadb07c42017-11-22 16:12:57 +0100116 "--repos", self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200117 "--add", "clang", env=None))
118
119 self.assertRegex(
120 str(context.exception.output),
Diana Picus9f756862017-12-20 10:35:08 +0100121 "(.*\n)*.*the following arguments are required:(.*)--source-dir(.*\n)*")
Diana Picus81089db2017-05-05 22:26:49 +0200122
123 with self.assertRaises(subprocess.CalledProcessError) as context:
124 self.run_with_output(
125 self.llvm_projects(
126 "--remove", "clang", env=None))
127
128 self.assertRegex(
129 str(context.exception.output),
Diana Picus9f756862017-12-20 10:35:08 +0100130 "(.*\n)*.*the following arguments are required:(.*)--source-dir(.*\n)*")
Diana Picus81089db2017-05-05 22:26:49 +0200131
Diana Picus3b2ef822016-10-13 16:53:18 +0300132 def test_dump_empty_config(self):
133 """
134 Test that we're correctly dumping an empty configuration (i.e. no
135 projects linked) when running llvmprojs without arguments.
136 """
Diana Picus9f756862017-12-20 10:35:08 +0100137 output = self.run_with_output(
138 self.llvm_projects("--source-dir", self.llvm_src))
Diana Picusb4307602017-04-05 19:48:39 +0200139 self.assertRegex(output, "Projects linked:.*\n.*none.*")
Diana Picus3b2ef822016-10-13 16:53:18 +0300140
141 def test_add_remove_subprojects(self):
142 """
143 Test that we can add and remove one or several subprojects.
144 """
Diana Picusadb07c42017-11-22 16:12:57 +0100145 output = self.run_with_output(self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100146 "--source-dir", self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100147 "--repos", self.repos,
148 "--add", "clang"))
Diana Picusb4307602017-04-05 19:48:39 +0200149 self.assertRegex(output, "Projects linked:.*\n.*clang.*")
Diana Picus3b2ef822016-10-13 16:53:18 +0300150
Diana Picus81089db2017-05-05 22:26:49 +0200151 output = self.run_with_output(
152 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100153 "--source-dir", self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100154 "--repos", self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200155 "--add", "libcxx", "lldb"))
Diana Picusb4307602017-04-05 19:48:39 +0200156 self.assertRegex(
Diana Picus3b2ef822016-10-13 16:53:18 +0300157 output,
158 "Projects linked:.*\n" +
159 ".*clang.*\n" +
160 ".*libcxx.*\n" +
161 ".*lldb.*")
162
Diana Picus9f756862017-12-20 10:35:08 +0100163 output = self.run_with_output(
164 self.llvm_projects(
165 "--source-dir",
166 self.llvm_src,
167 "--remove",
168 "libcxx"))
Diana Picusb4307602017-04-05 19:48:39 +0200169 self.assertRegex(output,
170 "Projects linked:.*\n" +
171 ".*clang.*\n" +
172 ".*lldb.*")
Diana Picus3b2ef822016-10-13 16:53:18 +0300173
Diana Picus81089db2017-05-05 22:26:49 +0200174 output = self.run_with_output(
175 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100176 "--source-dir", self.llvm_src,
Diana Picus81089db2017-05-05 22:26:49 +0200177 "--remove", "clang", "lldb"))
Diana Picusb4307602017-04-05 19:48:39 +0200178 self.assertRegex(output,
179 "Projects linked:.*\n" +
180 ".*none.*")
Diana Picus3b2ef822016-10-13 16:53:18 +0300181
182 def test_add_remove_invalid_subprojects(self):
183 """
184 Test that we error out nicely when trying to add/remove invalid
185 subprojects.
186 """
187 with self.assertRaises(subprocess.CalledProcessError) as context:
Diana Picus81089db2017-05-05 22:26:49 +0200188 self.run_with_output(
189 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100190 "--source-dir", self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100191 "--repos", self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200192 "--add", "inventedsubproject"))
Diana Picus3b2ef822016-10-13 16:53:18 +0300193
Diana Picusb4307602017-04-05 19:48:39 +0200194 self.assertRegex(
195 str(context.exception.output),
Diana Picus3b2ef822016-10-13 16:53:18 +0300196 "(.*\n)*.*invalid choice:.*inventedsubproject(.*\n)*")
197
198 with self.assertRaises(subprocess.CalledProcessError) as context:
Diana Picus81089db2017-05-05 22:26:49 +0200199 self.run_with_output(
200 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100201 "--source-dir", self.llvm_src,
Diana Picus81089db2017-05-05 22:26:49 +0200202 "--remove",
203 "inventedsubproject"))
Diana Picus3b2ef822016-10-13 16:53:18 +0300204
Diana Picusb4307602017-04-05 19:48:39 +0200205 self.assertRegex(
206 str(context.exception.output),
Diana Picus3b2ef822016-10-13 16:53:18 +0300207 "(.*\n)*.*invalid choice:.*inventedsubproject(.*\n)*")
208
209 def test_duplicate_add_remove(self):
210 """
211 Test that we don't crash when trying to add / remove the same subproject
212 twice with the same command.
213 """
Diana Picus81089db2017-05-05 22:26:49 +0200214 output = self.run_with_output(
215 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100216 "--source-dir", self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100217 "--repos", self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200218 "--add", "clang", "lld", "clang"))
Diana Picusb4307602017-04-05 19:48:39 +0200219 self.assertRegex(output,
220 "Projects linked:.*\n" +
221 ".*clang.*\n" +
222 ".*lld.*")
Diana Picus3b2ef822016-10-13 16:53:18 +0300223
Diana Picus81089db2017-05-05 22:26:49 +0200224 output = self.run_with_output(
225 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100226 "--source-dir", self.llvm_src,
Diana Picus81089db2017-05-05 22:26:49 +0200227 "--remove", "lld", "lld", "clang"))
Diana Picusb4307602017-04-05 19:48:39 +0200228 self.assertRegex(output,
229 "Projects linked:.*\n" +
230 ".*none.*")
Diana Picus3b2ef822016-10-13 16:53:18 +0300231
232 def test_redundant_add_remove(self):
233 """
234 Test that we can add a subproject that already exists (either because it
235 was added by our script or manually) or remove a subproject that doesn't
236 exist.
237 """
Diana Picus3601bea2017-05-29 11:26:18 +0200238 self.add_worktree(self.get_subproj_repo("clang"),
239 os.path.join(self.llvm_src, "tools", "clang"),
240 self.branch)
241 self.add_worktree(
242 self.get_subproj_repo("compiler-rt"),
Diana Picus3b2ef822016-10-13 16:53:18 +0300243 os.path.join(self.llvm_src, "projects", "compiler-rt"),
244 self.branch)
245
Diana Picusadb07c42017-11-22 16:12:57 +0100246 output = self.run_with_output(self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100247 "--source-dir", self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100248 "--repos", self.repos,
249 "--add", "clang"))
Diana Picusb4307602017-04-05 19:48:39 +0200250 self.assertRegex(output,
251 "Projects linked:.*\n" +
252 ".*clang.*")
Diana Picus3b2ef822016-10-13 16:53:18 +0300253
Diana Picus81089db2017-05-05 22:26:49 +0200254 output = self.run_with_output(
255 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100256 "--source-dir", self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100257 "--repos", self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200258 "--add", "compiler-rt", "lld"))
Diana Picusb4307602017-04-05 19:48:39 +0200259 self.assertRegex(
Diana Picus3b2ef822016-10-13 16:53:18 +0300260 output,
261 "Projects linked:.*\n" +
262 ".*clang.*\n" +
263 ".*compiler-rt.*\n" +
264 ".*lld.*")
265
Diana Picus81089db2017-05-05 22:26:49 +0200266 output = self.run_with_output(
267 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100268 "--source-dir", self.llvm_src,
Diana Picus81089db2017-05-05 22:26:49 +0200269 "--remove", "lldb", "libcxx", "lld"))
Diana Picusb4307602017-04-05 19:48:39 +0200270 self.assertRegex(
Diana Picus3b2ef822016-10-13 16:53:18 +0300271 output,
272 "Projects linked:.*\n" +
273 ".*clang.*\n" +
274 ".*compiler-rt.*")
275
276 def test_simultaneous_add_remove(self):
277 """
278 Test that we error out when someone is trying to add and remove the same
279 project with the same command.
280 """
281 # Try the really basic case and make sure we're not touching anything
282 with self.assertRaises(subprocess.CalledProcessError) as context:
Diana Picus81089db2017-05-05 22:26:49 +0200283 self.run_with_output(
284 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100285 "--source-dir",
286 self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100287 "--repos",
288 self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200289 "--add",
290 "clang",
291 "--remove",
292 "clang"))
Diana Picus3b2ef822016-10-13 16:53:18 +0300293
Diana Picusb4307602017-04-05 19:48:39 +0200294 self.assertRegex(
295 str(context.exception.output),
Diana Picus3b2ef822016-10-13 16:53:18 +0300296 "(.*\n)*.*Can't add and remove clang at the same time(.*\n)*")
297
298 self.assertFalse(
299 os.path.exists(
300 os.path.join(self.llvm_src, "tools", "clang")))
301
302 # Try something a bit more complicated and make sure we're not touching
303 # anything
Diana Picus3601bea2017-05-29 11:26:18 +0200304 self.add_worktree(
305 self.get_subproj_repo("lld"),
Diana Picus3b2ef822016-10-13 16:53:18 +0300306 os.path.join(self.llvm_src, "tools", "lld"),
307 self.branch)
308
309 with self.assertRaises(subprocess.CalledProcessError) as context:
Diana Picus81089db2017-05-05 22:26:49 +0200310 self.run_with_output(
311 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100312 "--source-dir",
313 self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100314 "--repos",
315 self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200316 "--add",
317 "clang",
318 "lld",
319 "libcxx",
320 "--remove",
321 "lld",
322 "libcxx"))
Diana Picusb4307602017-04-05 19:48:39 +0200323 self.assertRegex(
324 str(context.exception.output),
Diana Picus3b2ef822016-10-13 16:53:18 +0300325 "(.*\n)*" +
326 ".*Can't add and remove (lld|libcxx) at the same time(.*\n)*")
327
328 # Make sure we didn't touch anything
329 self.assertFalse(
330 os.path.exists(
331 os.path.join(self.llvm_src, "tools", "clang")))
332 self.assertTrue(
333 os.path.exists(
334 os.path.join(self.llvm_src, "tools", "lld")))
335 self.assertFalse(
336 os.path.exists(
337 os.path.join(self.llvm_src, "projects", "libcxx")))
338
339 def test_multiple_adds_removes(self):
340 """
341 Test that we can have multiple --add and --remove options in the same
342 command and that only the last one of each kind matters.
343 """
Diana Picus81089db2017-05-05 22:26:49 +0200344 output = self.run_with_output(
345 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100346 "--source-dir",
347 self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100348 "--repos",
349 self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200350 "--add",
351 "libcxxabi",
352 "--remove",
353 "lld",
354 "lldb",
355 "--add",
356 "clang",
357 "libcxx",
358 "--remove",
359 "libunwind"))
Diana Picusb4307602017-04-05 19:48:39 +0200360 self.assertRegex(output,
361 "Projects linked:.*\n" +
362 ".*clang.*\n" +
363 ".*libcxx.*\n")
Diana Picus3b2ef822016-10-13 16:53:18 +0300364
Diana Picus81089db2017-05-05 22:26:49 +0200365 output = self.run_with_output(
366 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100367 "--source-dir",
368 self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100369 "--repos",
370 self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200371 "--add",
372 "libunwind",
373 "libcxxabi",
374 "--remove",
375 "clang",
376 "libcxx",
377 "--add",
378 "compiler-rt",
379 "--remove",
380 "libcxxabi"))
Diana Picusb4307602017-04-05 19:48:39 +0200381 self.assertRegex(output,
382 "Projects linked:.*\n" +
383 ".*clang.*\n" +
384 ".*compiler-rt.*\n" +
385 ".*libcxx.*\n")
Diana Picus3b2ef822016-10-13 16:53:18 +0300386
Diana Picus81089db2017-05-05 22:26:49 +0200387 output = self.run_with_output(
388 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100389 "--source-dir",
390 self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100391 "--repos",
392 self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200393 "--add",
394 "libcxx",
395 "--remove",
396 "lld",
397 "--add",
398 "lld",
399 "--remove",
400 "libcxx"))
Diana Picusb4307602017-04-05 19:48:39 +0200401 self.assertRegex(output,
402 "Projects linked:.*\n" +
403 ".*clang.*\n" +
404 ".*compiler-rt.*\n" +
405 ".*lld.*\n")
Diana Picus81089db2017-05-05 22:26:49 +0200406
407 def test_different_env(self):
408 """
409 Test that we can have different environments in completely different
410 paths and they don't interfere when we try to add/remove projects.
411 """
412 # Create a separate environment
413 new_env = mkdtemp()
Diana Picus9f756862017-12-20 10:35:08 +0100414 new_llvm_src = os.path.join(new_env, "llvm")
Diana Picus81089db2017-05-05 22:26:49 +0200415 new_branch = "br" + str(uuid4())
Diana Picus9f756862017-12-20 10:35:08 +0100416 self.add_worktree(
417 self.get_subproj_repo("llvm"),
418 new_llvm_src,
419 new_branch)
Diana Picus81089db2017-05-05 22:26:49 +0200420
421 # Check that we start with a clean slate in both the new environment and
422 # the one that's already set up
Diana Picus9f756862017-12-20 10:35:08 +0100423 output = self.run_with_output(self.llvm_projects("--source-dir",
424 self.llvm_src))
Diana Picus81089db2017-05-05 22:26:49 +0200425 self.assertRegex(output, "Projects linked:.*\n.*none.*")
426
Diana Picus9f756862017-12-20 10:35:08 +0100427 output = self.run_with_output(self.llvm_projects("--source-dir",
428 new_llvm_src))
Diana Picus81089db2017-05-05 22:26:49 +0200429 self.assertRegex(output, "Projects linked:.*\n.*none.*")
430
431 # Make sure that adding projects works
432 output = self.run_with_output(
433 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100434 "--source-dir", self.llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100435 "--repos", self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200436 "--add", "clang", "lld"))
437 self.assertRegex(output, "Projects linked:.*\n.*clang.*\n.*lld.*\n")
438
439 output = self.run_with_output(
440 self.llvm_projects(
Diana Picus9f756862017-12-20 10:35:08 +0100441 "--source-dir",
442 new_llvm_src,
Diana Picusadb07c42017-11-22 16:12:57 +0100443 "--repos",
444 self.repos,
Diana Picus81089db2017-05-05 22:26:49 +0200445 "--add",
446 "libcxx",
Diana Picus9f756862017-12-20 10:35:08 +0100447 "libcxxabi"))
Diana Picus81089db2017-05-05 22:26:49 +0200448 self.assertRegex(output,
449 "Projects linked:.*\n.*libcxx.*\n.*libcxxabi.*\n.*")
450
Diana Picus9f756862017-12-20 10:35:08 +0100451 output = self.run_with_output(
452 self.llvm_projects("--source-dir", self.llvm_src))
Diana Picus81089db2017-05-05 22:26:49 +0200453 self.assertRegex(output, "Projects linked:.*\n.*clang.*\n.*lld.*\n")
454
455 # Make sure that removing projects works
Diana Picus9f756862017-12-20 10:35:08 +0100456 output = self.run_with_output(
457 self.llvm_projects(
458 "--source-dir", self.llvm_src,
459 "--remove", "lld"))
Diana Picus81089db2017-05-05 22:26:49 +0200460 self.assertRegex(output, "Projects linked:.*\n.*clang.*\n")
461
462 output = self.run_with_output(self.llvm_projects("--remove", "libcxx",
Diana Picus9f756862017-12-20 10:35:08 +0100463 "--source-dir",
464 new_llvm_src))
Diana Picus81089db2017-05-05 22:26:49 +0200465 self.assertRegex(output,
466 "Projects linked:.*\n.*libcxxabi.*\n.*")
467
Diana Picus9f756862017-12-20 10:35:08 +0100468 output = self.run_with_output(
469 self.llvm_projects("--source-dir", self.llvm_src))
Diana Picus81089db2017-05-05 22:26:49 +0200470 self.assertRegex(output, "Projects linked:.*\n.*clang.*\n")
471
472 shutil.rmtree(new_env)