def test_set_build_dir(self): host = Host() with self.assertRaises(Host.ConfigError): host.set_fuzzers_json('no_such_build_dir') if not os.getenv('FUCHSIA_DIR'): return build_dir = host.find_build_dir() ssh_config = Host.join(build_dir, 'ssh-keys', 'ssh_config') zxtools = Host.join(build_dir + '.zircon', 'tools') platform = 'mac-x64' if os.uname()[0] == 'Darwin' else 'linux-x64' executable = Host.join(host.get_host_out_dir(), 'symbolize') symbolizer = Host.join( 'prebuilt', 'third_party', 'clang', platform, 'bin', 'llvm-symbolizer', ) host.set_build_dir(build_dir) self.assertNotEqual(len(host._ids), 0) for id in host._ids: self.assertTrue(os.path.exists(id)) self.assertIsNotNone(host._zxtools) self.assertTrue(os.path.exists(host._symbolizer_exec)) self.assertTrue(os.path.exists(host._llvm_symbolizer))
def test_set_symbolizer(self): host = Host() with self.assertRaises(Host.ConfigError): host.set_symbolizer('no_such_executable', 'no_such_symbolizer') if not os.getenv('FUCHSIA_DIR'): return platform = 'mac-x64' if os.uname()[0] == 'Darwin' else 'linux-x64' executable = Host.join(host.get_host_out_dir(), 'symbolize') symbolizer = Host.join('prebuilt', 'third_party', 'clang', platform, 'bin', 'llvm-symbolizer') with self.assertRaises(Host.ConfigError): host.set_symbolizer(executable, 'no_such_symbolizer') with self.assertRaises(Host.ConfigError): host.set_symbolizer('no_such_executable', symbolizer) host.set_symbolizer(executable, symbolizer) self.assertEqual(host._symbolizer_exec, executable) self.assertEqual(host._llvm_symbolizer, symbolizer)