Skip to content

Commit

Permalink
[43_2] Re-organize integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii authored Dec 9, 2023
1 parent 7ad1e89 commit fff93e3
Show file tree
Hide file tree
Showing 24 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion TeXmacs/tests/12_1.scm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
(regression-test-group
"get-tag-name" "tag-name"
get-tag-name utf8->cork
(test "get-tag-name" "$TEXMACS_PATH/tests/12_1.bib" "数理逻辑2010汪芳庭")))
(test "get-tag-name" "$TEXMACS_PATH/tests/bib/12_1.bib" "数理逻辑2010汪芳庭")))

(tm-define (test_12_1)
(let ((n (+ (test-get-tag-name))))
Expand Down
2 changes: 1 addition & 1 deletion TeXmacs/tests/17_1.scm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(inherit-modules (texmacs texmacs tm-tools))

(define (test-count-characters)
(load-buffer "$TEXMACS_PATH/tests/17_1.tm")
(load-buffer "$TEXMACS_PATH/tests/tm/17_1.tm")
(regression-test-group
"count-characters" "result"
count-characters :none
Expand Down
2 changes: 1 addition & 1 deletion TeXmacs/tests/43_2.scm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

(define (load-latex path)
(with path (string-append "$TEXMACS_PATH/tests/tex/" path)
(string-load path)))
(string-replace (string-load path) "\r\n" "\n")))

(define (test-export-as-latex)
(regression-test-group
Expand Down
2 changes: 1 addition & 1 deletion TeXmacs/tests/43_3.scm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

(define (load-latex path)
(with path (string-append "$TEXMACS_PATH/tests/tex/" path)
(string-load path)))
(string-replace (string-load path) "\r\n" "\n")))

(define (test-export-as-latex)
(regression-test-group
Expand Down
8 changes: 4 additions & 4 deletions TeXmacs/tests/64_1.scm
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
(embedded-propose tree 4)))

(define (test-ascii-filename)
(load-buffer "$TEXMACS_PATH/tests/64_1.tm")
(load-buffer "$TEXMACS_PATH/tests/tm/64_1.tm")
(let ((image-ascii (tree-ref (root-tree) 1 1))
(image-untitled (tree-ref (root-tree) 1 2))
(image-cork (tree-ref (root-tree) 1 3)))
(regression-test-group
"embedded-propose on latin filename" "embedded-propose-latin"
embedded-propose-4th (file-under-path "$TEXMACS_PATH/tests")
embedded-propose-4th (file-under-path "$TEXMACS_PATH/tests/tm")
(test "cork encoding" image-cork "学生:张佳.png")
(test "ascii" image-ascii "64_1.png")
(test "extension only" image-untitled "64_1-image-4.png"))))

(define (test-cjk-filename)
(load-buffer "$TEXMACS_PATH/tests/64_1_中文文件名.tm")
(load-buffer "$TEXMACS_PATH/tests/tm/64_1_中文文件名.tm")
(let ((image-ascii (tree-ref (root-tree) 1 1))
(image-untitled (tree-ref (root-tree) 1 2))
(image-cork (tree-ref (root-tree) 1 3)))
(regression-test-group
"embedded-propose on unicode filename" "embedded-propose-unicode"
embedded-propose-4th (file-under-path "$TEXMACS_PATH/tests")
embedded-propose-4th (file-under-path "$TEXMACS_PATH/tests/tm")
(test "cork encoding" image-cork "学生:张佳.png")
(test "ascii" image-ascii "64_1.png")
(test "extension only" image-untitled "64_1_中文文件名-image-4.png"))))
Expand Down
6 changes: 3 additions & 3 deletions TeXmacs/tests/9_1.scm
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(define (test-no-title)
(load-buffer "$TEXMACS_PATH/tests/9_1_无标题.tm")
(load-buffer "$TEXMACS_PATH/tests/tm/9_1_无标题.tm")
(regression-test-group
"get-metadata" "result"
get-metadata :none
(test "no title" "title" "9_1_无标题.tm")))

(define (test-title)
(load-buffer "$TEXMACS_PATH/tests/9_1_with_title.tm")
(load-buffer "$TEXMACS_PATH/tests/tm/9_1_with_title.tm")
(regression-test-group
"get-metadata" "result"
get-metadata :none
(test "with title" "title" "标题")))

(define (test-metadata)
(load-buffer "$TEXMACS_PATH/tests/9_1_with_metadata.tm")
(load-buffer "$TEXMACS_PATH/tests/tm/9_1_with_metadata.tm")
(regression-test-group
"get-metadata" "result"
get-metadata :none
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions tests/Plugins/Pdf/pdf_make_attachment_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void
TestHummusPdfMakeAttachment::test_pdf_hummus_make_single_attachment () {

array<url> attachmen_0;
attachmen_0 << url ("$TEXMACS_PATH/tests/29_1_1.tm");
attachmen_0 << url ("$TEXMACS_PATH/tests/tm/29_1_1.tm");
bool attach_judge= pdf_hummus_make_attachments (
url ("$TEXMACS_PATH/tests/images/29_1_1.pdf"), attachmen_0,
url ("$TEXMACS_PATH/tests/images/29_1_1_attach.pdf"));
Expand All @@ -55,7 +55,7 @@ TestHummusPdfMakeAttachment::test_pdf_hummus_make_single_attachment () {
QVERIFY (tm_exist_judge);

QVERIFY (attachment[0] == url ("$TEXMACS_PATH/tests/images/29_1_1.tm"));
QVERIFY (string_load (url ("$TEXMACS_PATH/tests/29_1_1.tm")) ==
QVERIFY (string_load (url ("$TEXMACS_PATH/tests/tm/29_1_1.tm")) ==
string_load (url ("$TEXMACS_PATH/tests/images/29_1_1.tm")));
remove (url ("$TEXMACS_PATH/tests/images/29_1_1_attach.pdf"));
remove (attachment[0]);
Expand Down Expand Up @@ -130,7 +130,7 @@ TestHummusPdfMakeAttachment::test_pdf_hummus_make_zero_attachment () {
void
TestHummusPdfMakeAttachment::test_pdf_hummus_make_attachment_for_wrong_pdf () {
array<url> attachment_0;
attachment_0 << url ("$TEXMACS_PATH/tests/29_1_1.tm");
attachment_0 << url ("$TEXMACS_PATH/tests/tm/29_1_1.tm");
bool attach_judge= pdf_hummus_make_attachments (
url ("$TEXMACS_PATH/tests/images/29_4_4.pdf"), attachment_0,
url ("$TEXMACS_PATH/tests/images/29_4_4_attach.pdf"));
Expand All @@ -144,7 +144,7 @@ void
TestHummusPdfMakeAttachment::test_pdf_hummus_make_attachment_for_no_pdf () {
QVERIFY (!is_regular (url ("$TEXMACS_PATH/tests/images/29_4_5.pdf")));
array<url> attachment_0;
attachment_0 << url ("$TEXMACS_PATH/tests/29_1_1.tm");
attachment_0 << url ("$TEXMACS_PATH/tests/tm/29_1_1.tm");
bool attach_judge= pdf_hummus_make_attachments (
url ("$TEXMACS_PATH/tests/images/29_4_5.pdf"), attachment_0,
url ("$TEXMACS_PATH/tests/images/29_4_5_attach.pdf"));
Expand All @@ -157,11 +157,11 @@ TestHummusPdfMakeAttachment::test_pdf_hummus_make_attachment_for_no_pdf () {
void
TestHummusPdfMakeAttachment::test_get_linked_file_paths () {
array<url> attachment_0;
attachment_0 << url ("$TEXMACS_PATH/tests/29_1_1.tm");
string texmacs_doc_1= string_load (url ("$TEXMACS_PATH/tests/29_1_1.tm"));
tree texmacs_tree_1= texmacs_to_tree (texmacs_doc_1);
array<url> linked_0 = get_linked_file_paths (
texmacs_tree_1, url ("$TEXMACS_PATH/tests/29_1_1.tm"));
attachment_0 << url ("$TEXMACS_PATH/tests/tm/29_1_1.tm");
string texmacs_doc_1 = string_load (url ("$TEXMACS_PATH/tests/tm/29_1_1.tm"));
tree texmacs_tree_1= texmacs_to_tree (texmacs_doc_1);
array<url> linked_0 = get_linked_file_paths (
texmacs_tree_1, url ("$TEXMACS_PATH/tests/tm/29_1_1.tm"));
QVERIFY (N (linked_0) == 0);

string texmacs_doc_2=
Expand Down
5 changes: 3 additions & 2 deletions xmake/research.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ function add_target_research_on_others()
if is_mode("releasedbg") then
if is_plat("mingw", "windows") then
add_installfiles({
"TeXmacs(/tests/*.tm)",
"TeXmacs(/tests/*.bib)",
"TeXmacs(/tests/tm/*.tm)",
"TeXmacs(/tests/tex/*.tex)",
"TeXmacs(/tests/bib/*.bib)",
})
else
add_installfiles({
Expand Down

0 comments on commit fff93e3

Please sign in to comment.