private void runTest( String testname, String zipfile_path, String proj_path, String arg_file_paths[]) throws CoreException { LogHandle log = LogFactory.getLogHandle(testname); CoreReleaseTests.clearErrors(); BundleUtils utils = new BundleUtils(SVCoreTestsPlugin.getDefault().getBundle()); cleanupWorkspace(); // Create a new project for the File test_dir = new File(fTmpDir, testname); File db_dir = new File(fTmpDir, "db"); if (test_dir.exists()) { assertTrue(test_dir.delete()); } assertTrue(test_dir.mkdirs()); if (db_dir.exists()) { assertTrue(db_dir.delete()); } assertTrue(db_dir.mkdirs()); utils.unpackBundleZipToFS(zipfile_path, test_dir); File project_path = new File(test_dir, proj_path); fProject = TestUtils.createProject(project_path.getName(), project_path); // Setup appropriate project settings SVDBProjectManager p_mgr = SVCorePlugin.getDefault().getProjMgr(); SVDBProjectData p_data = p_mgr.getProjectData(fProject); // Add an argument-file paths SVProjectFileWrapper p_wrapper = p_data.getProjectFileWrapper().duplicate(); if (arg_file_paths != null) { for (String arg_file : arg_file_paths) { p_wrapper.getArgFilePaths().add(new SVDBPath(arg_file)); p_wrapper.getArgFilePaths().add(new SVDBPath(arg_file)); } } p_data.setProjectFileWrapper(p_wrapper); SVDBIndexCollection project_index = p_data.getProjectIndexMgr(); assertNoErrors(log, project_index); // force index loading project_index.loadIndex(new NullProgressMonitor()); IndexTestUtils.assertNoErrWarn(log, project_index); for (Exception e : CoreReleaseTests.getErrors()) { System.out.println("TEST: " + getName() + " " + e.getMessage()); } assertEquals(0, CoreReleaseTests.getErrors().size()); project_index.dispose(); LogFactory.removeLogHandle(log); }
private void runTest(String name, String path) { BundleUtils utils = new BundleUtils(SVCoreTestsPlugin.getDefault().getBundle()); File pdir = new File(fTmpDir, path); assertTrue(pdir.mkdirs()); utils.unpackBundleZipToFS("uvmprimer-master.zip", pdir); utils.unpackBundleZipToFS("uvm.zip", pdir); File filelist = new File(pdir, "filelist.f"); SVFileUtils.copy( "+define+QUESTA\n" + "+incdir+./uvm/src\n" + "./uvm/src/uvm_pkg.sv\n" + "+incdir+./uvmprimer-master/" + path + "\n" + "-F uvmprimer-master/" + path + "/rtl.f\n" + "-F uvmprimer-master/" + path + "/tb.f\n", filelist); ISVDBIndex index = fIndexRgy.findCreateIndex( new NullProgressMonitor(), "GENERIC", filelist.toString(), SVDBArgFileIndexFactory.TYPE, null); index.loadIndex(new NullProgressMonitor()); IndexTestUtils.assertNoErrWarn(fLog, index); }