You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BcweaverTests.java 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver;
  13. import java.io.File;
  14. import junit.framework.Test;
  15. import junit.framework.TestCase;
  16. import junit.framework.TestSuite;
  17. import org.aspectj.util.FileUtil;
  18. public class BcweaverTests extends TestCase {
  19. public static final String TESTDATA_PATH = "../weaver/testdata";
  20. public static final String OUTDIR_PATH = "../weaver/out";
  21. /** @return File outDir (writable) or null if unable to write */
  22. public static File getOutdir() {
  23. File result = new File(OUTDIR_PATH);
  24. if (result.mkdirs() || (result.canWrite() && result.isDirectory())) {
  25. return result;
  26. }
  27. return null;
  28. }
  29. /** best efforts to delete the output directory and any contents */
  30. public static void removeOutDir() {
  31. File outDir = getOutdir();
  32. if (null != outDir) {
  33. FileUtil.deleteContents(outDir);
  34. outDir.delete();
  35. }
  36. }
  37. public static Test suite() {
  38. TestSuite suite = new TestSuite(BcweaverTests.class.getName());
  39. // abstract
  40. // suite.addTestSuite(AbstractWorldTestCase.class);
  41. // $JUnit-BEGIN$
  42. suite.addTestSuite(MemberTestCase.class);
  43. suite.addTestSuite(TypeXTestCase.class);
  44. suite.addTestSuite(WeaverMessagesTestCase.class);
  45. suite.addTestSuite(DumpTestCase.class);
  46. suite.addTest(AllTracingTests.suite());
  47. // $JUnit-END$
  48. return suite;
  49. }
  50. public BcweaverTests(String name) {
  51. super(name);
  52. }
  53. }