Move cedet test resource files to follow our conventions

* test/lisp/cedet/semantic-utest-ia.el (ert, ert-x): Require.
(cedet-utest-directory, semantic-utest-test-directory): Remove
variables.
(semantic-utest-ia-doublens.cpp, semantic-utest-ia-subclass.cpp)
(semantic-utest-ia-typedefs.cpp, semantic-utest-ia-struct.cpp)
(semantic-utest-ia-templates.cpp, semantic-utest-ia-using.cpp)
(semantic-utest-ia-nsp.cpp, semantic-utest-ia-localvars.cpp)
(semantic-utest-ia-namespace.cpp)
(semantic-utest-ia-sppcomplete.c, semantic-utest-ia-varnames.c)
(semantic-utest-ia-javacomp.java)
(semantic-utest-ia-varnames.java, semantic-utest-ia-wisent.wy)
(semantic-utest-ia-texi, semantic-utest-ia-make)
(semantic-utest-ia-srecoder): Use 'ert-resource-file'.  Don't
check if file exists; we can assume that it does.

* test/manual/cedet/tests/testjavacomp.java:
* test/manual/cedet/tests/testlocalvars.cpp:
* test/manual/cedet/tests/testnsp.cpp:
* test/manual/cedet/tests/testsppcomplete.c:
* test/manual/cedet/tests/teststruct.cpp:
* test/manual/cedet/tests/testsubclass.cpp:
* test/manual/cedet/tests/testsubclass.hh:
* test/manual/cedet/tests/testtemplates.cpp:
* test/manual/cedet/tests/testtypedefs.cpp:
* test/manual/cedet/tests/testusing.cpp:
* test/manual/cedet/tests/testusing.hh:
* test/manual/cedet/tests/testvarnames.c:
* test/manual/cedet/tests/testvarnames.java:
* test/manual/cedet/tests/testwisent.wy: Move from here...
* test/lisp/cedet/semantic-utest-ia-resources/testjavacomp.java:
* test/lisp/cedet/semantic-utest-ia-resources/testlocalvars.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testnsp.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testsppcomplete.c:
* test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testsubclass.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testsubclass.hh:
* test/lisp/cedet/semantic-utest-ia-resources/testtemplates.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testtypedefs.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testusing.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testusing.hh:
* test/lisp/cedet/semantic-utest-ia-resources/testvarnames.c:
* test/lisp/cedet/semantic-utest-ia-resources/testvarnames.java:
* test/lisp/cedet/semantic-utest-ia-resources/testwisent.wy:
...to here.
This commit is contained in:
Stefan Kangas 2021-02-10 12:44:07 +01:00
parent 62ee5999a7
commit 4786353b2a
21 changed files with 22 additions and 50 deletions

View file

@ -35,4 +35,3 @@ int B::testB() {
int B::testAB() { // %1% ( ( "testfriends.cpp" ) ( "B" "B::testAB" ) )
}

View file

@ -30,121 +30,94 @@
;; (Replace // with contents of comment-start for the language being tested.)
;;; Code:
(require 'ert)
(require 'ert-x)
(require 'semantic)
(require 'semantic/analyze)
(require 'semantic/analyze/refs)
(require 'semantic/symref)
(require 'semantic/symref/filter)
(defvar cedet-utest-directory
(let* ((C (file-name-directory (locate-library "cedet")))
(D (expand-file-name "../../test/manual/cedet/" C)))
D)
"Location of test files for this test suite.")
(defvar semantic-utest-test-directory (expand-file-name "tests" cedet-utest-directory)
"Location of test files.")
(ert-deftest semantic-utest-ia-doublens.cpp ()
(let ((tst (expand-file-name "testdoublens.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testdoublens.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-subclass.cpp ()
(let ((tst (expand-file-name "testsubclass.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testsubclass.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-typedefs.cpp ()
(let ((tst (expand-file-name "testtypedefs.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testtypedefs.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-struct.cpp ()
(let ((tst (expand-file-name "teststruct.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "teststruct.cpp")))
(should-not (semantic-ia-utest tst))))
;;(ert-deftest semantic-utest-ia-union.cpp ()
;; (let ((tst (expand-file-name "testunion.cpp" semantic-utest-test-directory)))
;; (should (file-exists-p tst))
;; (let ((tst (ert-resource-file "testunion.cpp")))
;; (should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-templates.cpp ()
(let ((tst (expand-file-name "testtemplates.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testtemplates.cpp")))
(should-not (semantic-ia-utest tst))))
;;(ert-deftest semantic-utest-ia-friends.cpp ()
;; (let ((tst (expand-file-name "testfriends.cpp" semantic-utest-test-directory)))
;; (should (file-exists-p tst))
;; (let ((tst (ert-resource-file "testfriends.cpp")))
;; (should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-using.cpp ()
(let ((tst (expand-file-name "testusing.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testusing.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-nsp.cpp ()
(skip-unless (executable-find "g++"))
(let ((tst (expand-file-name "testnsp.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testnsp.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-localvars.cpp ()
(let ((tst (expand-file-name "testlocalvars.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testlocalvars.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-namespace.cpp ()
(skip-unless (executable-find "g++"))
(let ((tst (expand-file-name "testnsp.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testnsp.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-sppcomplete.c ()
(let ((tst (expand-file-name "testsppcomplete.c" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testsppcomplete.c")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-varnames.c ()
(let ((tst (expand-file-name "testvarnames.c" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testvarnames.c")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-javacomp.java ()
(let ((tst (expand-file-name "testjavacomp.java" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testjavacomp.java")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-varnames.java ()
(let ((tst (expand-file-name "testvarnames.java" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testvarnames.java")))
(should-not (semantic-ia-utest tst))))
;;(ert-deftest semantic-utest-ia-f90.f90 ()
;; (let ((tst (expand-file-name "testf90.f90" semantic-utest-test-directory)))
;; (should (file-exists-p tst))
;; (let ((tst (ert-resource-file "testf90.f90")))
;; (should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-wisent.wy ()
(let ((tst (expand-file-name "testwisent.wy" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "testwisent.wy")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-texi ()
(let ((tst (expand-file-name "test.texi" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "test.texi")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-make ()
(let ((tst (expand-file-name "test.mk" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "test.mk")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-srecoder ()
(let ((tst (expand-file-name "test.srt" semantic-utest-test-directory)))
(should (file-exists-p tst))
(let ((tst (ert-resource-file "test.srt")))
(should-not (semantic-ia-utest tst))))
;;; Core testing utility