From 32dff3b7ad9845fcfd8fcad8a0d8f61fc2cae81d Mon Sep 17 00:00:00 2001 From: j8takagi Date: Mon, 9 Dec 2013 19:19:45 +0900 Subject: [PATCH] =?utf8?q?test=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF?= =?utf8?q?=E3=83=88=E3=83=AA=E3=83=BC=E3=81=ABAutotest.mk=E3=81=AB?= =?utf8?q?=E3=82=88=E3=82=8B=E3=83=86=E3=82=B9=E3=83=88=E6=A9=9F=E8=83=BD?= =?utf8?q?=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- latex_mk/test/Define.mk | 140 ++++++++++++++++ latex_mk/test/Makefile | 165 +++++++++++++++++-- latex_mk/test/Test.mk | 165 +++++++++++++++++++ latex_mk/test/bibtex/0.txt | 26 +++ latex_mk/test/bibtex/Makefile | 69 +------- latex_mk/test/bibtex/cmd | 1 + latex_mk/test/bibtex/desc.txt | 1 + latex_mk/test/crossref/0.txt | 7 + latex_mk/test/crossref/Makefile | 11 +- latex_mk/test/crossref/cmd | 1 + latex_mk/test/crossref/desc.txt | 1 + latex_mk/test/dirs.txt | 20 +++ latex_mk/test/error_crossref/0.txt | 16 ++ latex_mk/test/error_crossref/Makefile | 11 +- latex_mk/test/error_crossref/cmd | 1 + latex_mk/test/error_crossref/desc.txt | 1 + latex_mk/test/error_no_end_seq/0.txt | 10 ++ latex_mk/test/error_no_end_seq/Makefile | 17 +- latex_mk/test/error_no_end_seq/cmd | 1 + latex_mk/test/error_no_end_seq/desc.txt | 1 + latex_mk/test/error_no_graphic_file/0.txt | 1 + latex_mk/test/error_no_graphic_file/Makefile | 14 +- latex_mk/test/error_no_graphic_file/cmd | 1 + latex_mk/test/error_no_graphic_file/desc.txt | 1 + latex_mk/test/error_undef_ctl_seq/0.txt | 14 ++ latex_mk/test/error_undef_ctl_seq/Makefile | 16 +- latex_mk/test/error_undef_ctl_seq/cmd | 1 + latex_mk/test/error_undef_ctl_seq/desc.txt | 1 + latex_mk/test/graphics_comment/0.txt | 5 + latex_mk/test/graphics_comment/Makefile | 20 +-- latex_mk/test/graphics_comment/cmd | 1 + latex_mk/test/graphics_comment/desc.txt | 1 + latex_mk/test/graphics_eps/0.txt | 12 ++ latex_mk/test/graphics_eps/Makefile | 39 +---- latex_mk/test/graphics_eps/cmd | 1 + latex_mk/test/graphics_eps/desc.txt | 1 + latex_mk/test/graphics_multi/0.txt | 5 + latex_mk/test/graphics_multi/Makefile | 2 + latex_mk/test/graphics_multi/cmd | 1 + latex_mk/test/graphics_multi/desc.txt | 1 + latex_mk/test/graphics_pdf/0.txt | 13 ++ latex_mk/test/graphics_pdf/Makefile | 39 +---- latex_mk/test/graphics_pdf/cmd | 1 + latex_mk/test/graphics_pdf/desc.txt | 1 + latex_mk/test/ln-desc.sh | 19 +++ latex_mk/test/makeindex/0.txt | 34 ++++ latex_mk/test/makeindex/Makefile | 49 +----- latex_mk/test/makeindex/cmd | 1 + latex_mk/test/makeindex/desc.txt | 1 + latex_mk/test/otsuberuto_zo/0.txt | 5 + latex_mk/test/otsuberuto_zo/Makefile | 3 +- latex_mk/test/otsuberuto_zo/cmd | 1 + latex_mk/test/otsuberuto_zo/desc.txt | 1 + latex_mk/test/otsuberuto_zo_s/0.txt | 5 + latex_mk/test/otsuberuto_zo_s/Makefile | 11 +- latex_mk/test/otsuberuto_zo_s/cmd | 1 + latex_mk/test/otsuberuto_zo_s/desc.txt | 1 + latex_mk/test/pdfbookmarks/0.txt | 20 +++ latex_mk/test/pdfbookmarks/Makefile | 2 + latex_mk/test/pdfbookmarks/cmd | 1 + latex_mk/test/pdfbookmarks/desc.txt | 1 + latex_mk/test/sample/0.txt | 5 + latex_mk/test/sample/Makefile | 3 +- latex_mk/test/sample/cmd | 1 + latex_mk/test/sample/desc.txt | 1 + latex_mk/test/sanposhojo/0.txt | 12 ++ latex_mk/test/sanposhojo/Makefile | 13 +- latex_mk/test/sanposhojo/cmd | 1 + latex_mk/test/sanposhojo/desc.txt | 1 + latex_mk/test/simple/0.txt | 15 ++ latex_mk/test/simple/Makefile | 39 +---- latex_mk/test/simple/cmd | 1 + latex_mk/test/simple/desc.txt | 1 + latex_mk/test/toc/0.txt | 32 ++++ latex_mk/test/toc/Makefile | 44 +---- latex_mk/test/toc/cmd | 1 + latex_mk/test/toc/desc.txt | 1 + latex_mk/test/toc_pdfbookmarks/0.txt | 35 ++++ latex_mk/test/toc_pdfbookmarks/Makefile | 2 + latex_mk/test/toc_pdfbookmarks/cmd | 1 + latex_mk/test/toc_pdfbookmarks/desc.txt | 1 + 81 files changed, 843 insertions(+), 380 deletions(-) create mode 100644 latex_mk/test/Define.mk create mode 100644 latex_mk/test/Test.mk create mode 100644 latex_mk/test/bibtex/0.txt create mode 100755 latex_mk/test/bibtex/cmd create mode 120000 latex_mk/test/bibtex/desc.txt create mode 100644 latex_mk/test/crossref/0.txt create mode 100755 latex_mk/test/crossref/cmd create mode 120000 latex_mk/test/crossref/desc.txt create mode 100644 latex_mk/test/dirs.txt create mode 100644 latex_mk/test/error_crossref/0.txt create mode 100755 latex_mk/test/error_crossref/cmd create mode 120000 latex_mk/test/error_crossref/desc.txt create mode 100644 latex_mk/test/error_no_end_seq/0.txt create mode 100755 latex_mk/test/error_no_end_seq/cmd create mode 120000 latex_mk/test/error_no_end_seq/desc.txt create mode 100644 latex_mk/test/error_no_graphic_file/0.txt create mode 100755 latex_mk/test/error_no_graphic_file/cmd create mode 120000 latex_mk/test/error_no_graphic_file/desc.txt create mode 100644 latex_mk/test/error_undef_ctl_seq/0.txt create mode 100755 latex_mk/test/error_undef_ctl_seq/cmd create mode 120000 latex_mk/test/error_undef_ctl_seq/desc.txt create mode 100644 latex_mk/test/graphics_comment/0.txt create mode 100755 latex_mk/test/graphics_comment/cmd create mode 120000 latex_mk/test/graphics_comment/desc.txt create mode 100644 latex_mk/test/graphics_eps/0.txt create mode 100755 latex_mk/test/graphics_eps/cmd create mode 120000 latex_mk/test/graphics_eps/desc.txt create mode 100644 latex_mk/test/graphics_multi/0.txt create mode 100644 latex_mk/test/graphics_multi/Makefile create mode 100755 latex_mk/test/graphics_multi/cmd create mode 120000 latex_mk/test/graphics_multi/desc.txt create mode 100644 latex_mk/test/graphics_pdf/0.txt create mode 100755 latex_mk/test/graphics_pdf/cmd create mode 120000 latex_mk/test/graphics_pdf/desc.txt create mode 100644 latex_mk/test/ln-desc.sh create mode 100644 latex_mk/test/makeindex/0.txt create mode 100755 latex_mk/test/makeindex/cmd create mode 120000 latex_mk/test/makeindex/desc.txt create mode 100644 latex_mk/test/otsuberuto_zo/0.txt mode change 120000 => 100644 latex_mk/test/otsuberuto_zo/Makefile create mode 100755 latex_mk/test/otsuberuto_zo/cmd create mode 120000 latex_mk/test/otsuberuto_zo/desc.txt create mode 100644 latex_mk/test/otsuberuto_zo_s/0.txt create mode 100755 latex_mk/test/otsuberuto_zo_s/cmd create mode 120000 latex_mk/test/otsuberuto_zo_s/desc.txt create mode 100644 latex_mk/test/pdfbookmarks/0.txt create mode 100644 latex_mk/test/pdfbookmarks/Makefile create mode 100755 latex_mk/test/pdfbookmarks/cmd create mode 120000 latex_mk/test/pdfbookmarks/desc.txt create mode 100644 latex_mk/test/sample/0.txt mode change 120000 => 100644 latex_mk/test/sample/Makefile create mode 100755 latex_mk/test/sample/cmd create mode 120000 latex_mk/test/sample/desc.txt create mode 100644 latex_mk/test/sanposhojo/0.txt create mode 100755 latex_mk/test/sanposhojo/cmd create mode 120000 latex_mk/test/sanposhojo/desc.txt create mode 100644 latex_mk/test/simple/0.txt create mode 100755 latex_mk/test/simple/cmd create mode 120000 latex_mk/test/simple/desc.txt create mode 100644 latex_mk/test/toc/0.txt create mode 100755 latex_mk/test/toc/cmd create mode 120000 latex_mk/test/toc/desc.txt create mode 100644 latex_mk/test/toc_pdfbookmarks/0.txt create mode 100644 latex_mk/test/toc_pdfbookmarks/Makefile create mode 100755 latex_mk/test/toc_pdfbookmarks/cmd create mode 120000 latex_mk/test/toc_pdfbookmarks/desc.txt diff --git a/latex_mk/test/Define.mk b/latex_mk/test/Define.mk new file mode 100644 index 0000000..bb55bd4 --- /dev/null +++ b/latex_mk/test/Define.mk @@ -0,0 +1,140 @@ +# autotest.mk > test_template > Define.mk +# 自動テスト用の変数、マクロ定義 + +ifndef DEFINE_INCLUDED +DEFINE_INCLUDED = 1 + +# 現在の日時 +DATE = $(shell date +"%F %T") + +# Makefile +MAKEFILE := Makefile + +###################################################################### +# コマンド +###################################################################### + +CAT := cat +CHMOD := chmod +CP := cp +DEV_NULL := /dev/null +DIFF := diff -c +ECHO := echo +EXPR := expr +FIND := find +GREP := grep +LINECOUNT := wc -l +LN := ln -s +MKDIR := mkdir -p +MV := mv +SED := sed +TIME := time +TR := tr +VALGRIND := valgrind +VALGRINDFLAG := -q --leak-check=full --log-file=valgrind.log + +###################################################################### +# テストグループとテストでの共通マクロ +###################################################################### + +# chk_var_null: 引数がNULLの場合、エラー +# 用例: $(call chk_var_null,var) +define chk_var_null + $(if $1,,$(error NULL argument)) +endef + +# chk_file_ext: 指定されたファイルが実在する場合、エラー +# 用例: $(call chk_file_ext,file) +define chk_file_ext + $(if $(wildcard $1),$(error $1 exists in $(CURDIR))) +endef + +# 指定したディレクトリーを作成 +# 引数は、ディレクトリー名 +# 用例: $(call create_dir,name) +define create_dir + $(call chk_var_null,$1) + $(call chk_file_ext,$1) + $(MKDIR) $1 +endef + +# テストディレクトリーのMakefileを作成 +# 引数は、Makefile名、依存ファイル群 +# 用例: $(call create_makefile,file,list_include_file) +define create_makefile + $(RM) $1 + $(foreach infile,$2,$(ECHO) "include ../$(infile)" >>$1; ) + $(if $(filter $(SRC),c),$(call puts_cmd_c,$1)) +endef + +# C言語の関数をテストするための設定を、指定されたファイルに出力 +# 引数は、ファイル名 +# 用例: $(call puts_cmd_c,file) +define puts_cmd_c + $(ECHO) >>$1 + $(ECHO) "CC := gcc" >>$1 + $(ECHO) "CFLAGS := -Wall" >>$1 + $(ECHO) >>$1 + $(ECHO) ".INTERMEDIATE:" "$$""(CMD_FILE)" >>$1 + $(ECHO) >>$1 + $(ECHO) "CMDSRC_FILE := cmd.c" >>$1 + $(ECHO) "TESTTARGET_FILES := # Set test target files" >>$1 + $(ECHO) >>$1 + $(ECHO) "$$""(CMD_FILE):" "$$""(CMDSRC_FILE)" "$$""(TESTTARGET_FILES)" >>$1 + $(ECHO) " ""$$""(CC)" "$$""(CFLAGS)" "-o" "$$""@" "$$""^" >>$1 +endef + +###################################################################### +# テストグループのディレクトリー +###################################################################### + +# テストグループとテストの変数を定義したMakefile +DEFINE_FILE := Define.mk + +# テストのターゲットを定義したMakefile +TEST_MAKEFILE := Test.mk + +# すべてのMakefile群 +MAKEFILES := $(DEFINE_FILE) $(TEST_MAKEFILE) + +# すべてのMakefile群の絶対パス +MAKEFILES_ABS := $(foreach file,$(MAKEFILES),$(CURDIR)/$(file)) + +###################################################################### +# テストのディレクトリー +###################################################################### + +# テストコマンドファイル +CMD_FILE := cmd + +# テスト説明ファイル +DESC_FILE := desc.txt + +# テスト想定ファイル +TEST0_FILE := 0.txt + +# テスト結果ファイル +TEST1_FILE := 1.txt + +# テストの、想定結果と結果の差分ファイル +DIFF_FILE := diff.log + +# テストエラーファイル +ERR_FILE := err.log + +# テストログファイル +LOG_FILE := summary.log + +# 実行時間ファイル +TIME_FILE := time.log + +# valgrindによるメモリーチェックファイル +VALGRIND_FILE := valgrind.log + +# テスト詳細レポートファイル +DETAIL_FILE := detail.log + +# テストの結果として作成されるファイル群 +TEST_RES_FILES := $(TEST1_FILE) $(DIFF_FILE) $(ERR_FILE) $(LOG_FILE) $(DETAIL_FILE) $(TIME_FILE) + +endif diff --git a/latex_mk/test/Makefile b/latex_mk/test/Makefile index 2500724..238e48b 100644 --- a/latex_mk/test/Makefile +++ b/latex_mk/test/Makefile @@ -1,21 +1,158 @@ -.PHONY: all clean distclean - -FIND := find -ECHO := /bin/echo -# 複数の子ディレクトリーでmakeを実行 -# 用例: $(call make_dirs,list_dir,target,options) -define make_dirs - $(foreach d,$1,$(ECHO) '---------- $d ----------'; $(MAKE) $3 -C $d $2; ) -endef +# autotest.mk > template > Group.mk +# テストグループのMakefile +# +# オペレーター +# make : すべてのテストを実行し、結果をログファイルに出力 +# make check : ↓ +# make checkall : すべてのテストを実行し、結果と実行時間をログファイルに出力 +# make time : すべてのテストを実行し、実行時間をログファイルに出力 +# make create : TESTNAMEで指定されたテストを新規に作成 +# make clean : すべてのテストで、"make" で生成されたファイルをクリア +# make time-clean: すべてのテストで、実行時間のログファイルをクリア +# make valgrind: すべてのテストで、valgrindによるメモリリークチェックを実行する +# make valgrind-clean: すべてのテストで、valgrindのログファイルをクリア + +SHELL = /bin/sh + +include Define.mk + +verbose ?= 1 + +###################################################################### +# テストグループのディレクトリー +###################################################################### + +# グループディレクトリー +GROUP_DIR := $(CURDIR) + +# グループ名。ディレクトリ名から取得 +GROUP := $(notdir $(GROUP_DIR)) # テスト名。カレントディレクトリー内の、名前が大文字または.以外で始まるディレクトリー TESTS = $(notdir $(shell $(FIND) -maxdepth 1 -name "[^A-Z.]*" -type d)) -all: - @$(call make_dirs,$(TESTS),$@,-s) +# テストグループログファイル +GROUP_LOG_FILE := $(shell $(ECHO) $(GROUP) | $(TR) '[a-z]' '[A-Z]').log + +# テストグループレポートファイル +GROUP_REPORT_FILE := Summary.log + +# テストグループ実行時間ファイル +GROUP_TIME_FILE := $(shell echo $(GROUP) | $(TR) '[a-z]' '[A-Z]')_time.log + +# テストグループvalgrindファイル +GROUP_VALGRIND_FILE := $(shell echo $(GROUP) | $(TR) '[a-z]' '[A-Z]')_valgrind.log + +# グループで、テスト結果として作成されるファイル群 +GROUP_RES_FILES := $(GROUP_LOG_FILE) $(GROUP_REPORT_FILE) $(GROUP_TIME_FILE) $(GROUP_VALGRIND_FILE) + +# テストごとのログファイル +TEST_LOG_FILES := $(foreach test,$(TESTS),$(test)/$(LOG_FILE)) + +###################################################################### +# テストグループのマクロ +###################################################################### + +# テストごとのファイルをグループファイルに出力 +# 引数は、テストのリスト、グループファイル、テストファイル +# 用例: $(call group_log,files_test_log,file_group_log) +define group_log + $(if $(filter 1,$(verbose)),$(ECHO) '$(CURDIR) - $(words $1) tests') + $(foreach target,$1,$(call group_log_each,$(target),$2)) + $(if $(filter 1,$(verbose)),$(ECHO)) +endef + +# テストのログファイルをグループログファイルに出力。引数は、テスト、グループログファイル +# 用例: $(call group_log_each,file_test_log,file_group_log) +define group_log_each + $(if $(filter 1,$(verbose)),$(ECHO) -n '.') + $(ECHO) $(dir $1) >>$2; + if test -s $1; then $(CAT) $1 >>$2; else $(ECHO) $(dir $1)": no log" >>$2; fi + $(ECHO) >>$2; +endef + +# 成功したテストの数。テストグループログファイルから取得 +SUCCESS_TEST = $(shell $(GREP) "^[^A-Z.].*: Test Success" $(GROUP_LOG_FILE) | $(LINECOUNT)) + +# 失敗したテストの数。テストグループログファイルから取得 +FAIL_TEST = $(shell $(GREP) "^[^A-Z.].*: Test Failure" $(GROUP_LOG_FILE) | $(LINECOUNT)) + +# すべてのテストの数 +ALL_TEST = $(shell $(EXPR) $(SUCCESS_TEST) + $(FAIL_TEST)) + +# テストごとの実行時間ファイル +TEST_TIME_FILES := $(foreach test,$(TESTS),$(test)/$(TIME_FILE)) + +# テストごとのvalgrindファイル +TEST_VALGRIND_FILES := $(foreach test,$(TESTS),$(test)/$(VALGRIND_FILE)) + +# テストの結果を、グループログファイルを元にレポート。 +# 引数は、グループ名、グループログファイル、グループレポートファイル +# 用例: $(call group_report,name,file_log,file_report) +define group_report + $(ECHO) '$1: $(SUCCESS_TEST) / $(ALL_TEST) tests passed. Details in $(GROUP_DIR)/$2' >$3 + if test $(FAIL_TEST) -eq 0; then $(ECHO) "$1: All tests are succeded." >>$3; fi +endef + +# リストで指定したディレクトリーでmakeを実行 +# 用例: $(call make_targets,list_dir,target) +define make_targets + $(if $(filter 1,$(verbose)),$(ECHO) '$(CURDIR) - $2';) + $(foreach dir,$1,$(call make_target_each,$(dir),$2)) +endef + +# 指定したディレクトリーでmakeを実行 +# 用例: $(call make_target_each,tests,target) +define make_target_each + $(MAKE) $2 -sC $1; +endef + +.PHONY: check checkall time valgrind create clean time-clean valgrind-clean + +check checkall: clean $(GROUP_REPORT_FILE) + @$(CAT) $(GROUP_REPORT_FILE) + @exit $(FAIL_TEST) + +time: time-clean $(GROUP_TIME_FILE) + @$(CAT) $(GROUP_TIME_FILE) + +create: + @$(call create_dir,$(TEST)) + @$(call create_makefile,$(TEST)/$(MAKEFILE),$(MAKEFILES)) clean: - @$(call make_dirs,$(TESTS),$@) + @$(call make_targets,$(TESTS),$@) + @$(RM) $(GROUP_RES_FILES); + +time-clean: + @$(call make_targets,$(TESTS),$@) + @$(RM) $(GROUP_TIME_FILE); + +valgrind: + @$(call make_targets,$(TESTS),$@) + @$(RM) $(GROUP_RES_FILES); + +valgrind-clean: + @$(call make_targets,$(TESTS),$@) + @$(RM) $(GROUP_VALGRIND_FILE); + +$(GROUP_REPORT_FILE): $(GROUP_LOG_FILE) + @$(call group_report,$(GROUP),$^,$@) + +$(GROUP_LOG_FILE): $(TEST_LOG_FILES) + @$(call group_log,$^,$@) + +$(TEST_LOG_FILES): + @$(MAKE) $(MAKECMDGOALS) -sC $(dir $@) NODISP=1 + +$(GROUP_TIME_FILE): $(TEST_TIME_FILES) + @$(call group_log,$^,$@) + +$(TEST_TIME_FILES): + @$(MAKE) time -sC $(dir $@) + +$(GROUP_VALGRIND_FILE): $(TEST_VALGRIND_FILES) + @$(call group_log,$^,$@) -distclean: - @$(call make_dirs,$(TESTS),$@) +$(TEST_VALGRIND_FILES): + @$(MAKE) time -sC $(dir $@) diff --git a/latex_mk/test/Test.mk b/latex_mk/test/Test.mk new file mode 100644 index 0000000..56c0766 --- /dev/null +++ b/latex_mk/test/Test.mk @@ -0,0 +1,165 @@ +# autotest.mk > test_template > Test.mk +# 自動テスト用のMakefile +# +# 要: Define.mk Define_test.mk +# +# オペレーター +# make : CMDの標準出力をTEST1_FILEに保存したあと、TEST0_FILEとの差分を比較し、結果をLOG_FILEに出力 +# make check : ↓ +# make set : CMDの標準出力をTEST0_FILEに保存。TEST0_FILEが存在する場合は実行しない +# make reset : CMDの標準出力をTEST0_FILEに保存。TEST0_FILEが存在する場合は上書き +# make time : CMDの実行にかかった時間をTIME_FILEに保存し、出力 +# make time-clean: "make time" で作成されたファイルをクリア +# make valgrind: valgrind CMDの標準出力をVARGRIND_FILEに保存 +# make clean : "make" で作成されたファイルをクリア +# make all-clean: "make" と "make set" で作成されたファイルをクリア +SHELL = /bin/bash + +###################################################################### +# マクロ +###################################################################### + +# 指定されたファイルをチェックし、空の場合は削除 +# 引数は、対象ファイル +# 用例: $(call rm_null,file_target) +define rm_null + if test ! -s $1; then $(RM) $1; fi +endef + +# 説明ファイルの内容を、指定されたファイルに出力 +# 引数は、出力ファイル +# 用例: $(call desc_log,file_out) +define desc_log + if test -s $(DESC_FILE); then $(CAT) $(DESC_FILE) >>$1; fi +endef + +# テスト実行の経過時間を、指定されたファイルに出力して表示 +# 引数は、テスト名、コマンドファイル、出力ファイル +# 用例: $(call time_cmd,file_cmd,file_out) +define time_cmd + if test ! -x $1; then $(CHMOD) u+x $1; fi + ($(TIME) ./$1 1>$(DEV_NULL) 2>$(DEV_NULL)) 2>&1 | $(GREP) '^real' >$2 +endef + +# valgrindによるメモリーチェック結果を、指定されたファイルに出力して表示 +# 引数は、テスト名、コマンドファイル、出力ファイル +# 用例: $(call valgrind_cmd,file_cmd,file_out) +define valgrind_cmd + -$(VALGRIND) $(VALGRINDFLAG) $(strip $(shell tail -1 $(CMD_FILE))) 1>/dev/null 2>&1 +endef + +# テスト実行コマンド。 +# コマンドファイルを実行し、標準出力を指定されたファイルに保存。 +# エラー発生時は、エラー出力を出力ファイルとエラーファイルに保存。 +# 引数は、コマンドファイル、出力ファイル、エラーファイル +# 用例: $(call exec_cmd,file_cmd,file_out,file_err) +define exec_cmd + if test ! -x $1; then $(CHMOD) u+x $1; fi + ./$1 >>$2 2>$3 + if test -s $3; then $(CAT) $3 >>$2; fi + $(MV) $2 $2.tmp && $(SED) -e "s%$(CURDIR)%\$$PWD%g" $2.tmp >$2 && $(RM) $2.tmp + $(call rm_null,$3) +endef + +# 2つのファイルを比較し、差分ファイルを作成 +# 引数は、2ファイルのリスト、差分ファイル +# 用例: $(call diff_files,files,file_out) +define diff_files + $(DIFF) $1 >$2 2>&1 + $(call rm_null,$2) +endef + +# 差分ファイルの内容をログファイルに出力 +# 引数は、テスト名、差分ファイル、ログファイル +# 用例: $(call test_log,name,file_diff,file_log) +define test_log + $(call desc_log,$3) + if test ! -s $2; then RES=Success; else RES=Failure; fi; $(ECHO) "$1: Test $$RES $(DATE)" >>$3 + $(ECHO) "Details in $(CURDIR)/$(DETAIL_FILE)" >>$3 +endef + +# NODISPが設定されていない時は、ログファイルを表示 +# 引数は、ログファイル +# 用例: $(call disp_test_log,file_log) +define disp_test_log + $(if $(NODISP),,$(CAT) $1) +endef + +# ファイル群から、ファイル名とファイルの内容を指定されたファイルに出力 +# 引数は、対象ファイル群、出力ファイル +# 用例: $(call report_files,list_file_target,file_out) +define report_files + $(foreach tfile,$1,$(call report_file,$(tfile),$2)) +endef + +# ファイル名とファイルの内容を指定されたファイルに出力 +# 引数は、対象ファイル、出力ファイル +# 用例: $(call report_file,file_target,file_out) +define report_file + $(call chk_var_null,$1) + if test -s $1; then $(ECHO) "== $1 ==" >>$2; $(call echo_hr,$2); cat $1 >>$2; $(call echo_hr,$2); $(ECHO) >>$2; fi +endef + +define echo_hr + $(ECHO) "----------------------------------------------------------------------" >>$1 +endef + +# テスト名。カレントディレクトリー名から取得 +TEST = $(notdir $(CURDIR)) + +# コマンドファイルのソース +CMDSRC_FILE ?= $(CMD_FILE) + +.PHONY: check set reset clean all-clean time time-clean valgrind valgrind-clean + +check: clean $(DETAIL_FILE) + @$(call disp_test_log,$(LOG_FILE)) + +checkall: clean $(DETAIL_FILE) $(TIME_FILE) + @$(CAT) $(TIME_FILE) >>$(LOG_FILE) + @$(call disp_test_log,$(LOG_FILE)) + +set: $(CMD_FILE) + @$(call chk_file_ext,$(TEST0_FILE)) + @-$(call exec_cmd,$(CMD_FILE),$(TEST0_FILE),$(ERR_FILE)) + @$(CAT) $(TEST0_FILE) + +reset: all-clean $(CMD_FILE) + @-$(call exec_cmd,$(CMD_FILE),$(TEST0_FILE),$(ERR_FILE)) + @$(CAT) $(TEST0_FILE) + +clean: + @$(RM) $(TEST_RES_FILES) $(TIME_FILE) $(VALGRIND_FILE) + +all-clean: clean + @$(RM) $(TEST0_FILE) + +time: time-clean $(TIME_FILE) + @$(CAT) $(TIME_FILE) + +time-clean: + @$(RM) $(TIME_FILE) + +valgrind: valgrind-clean $(VALGRIND_FILE) + if test -s $(VALGRIND_FILE); then $(ECHO) $(CURDIR) && $(CAT) $(VALGRIND_FILE); else $(RM) $(VALGRIND_FILE); fi + +valgrind-clean: + @$(RM) $(VALGRIND_FILE) + +$(TEST1_FILE): $(CMD_FILE) + @-$(call exec_cmd,$^,$@,$(ERR_FILE)) + +$(DIFF_FILE): $(TEST0_FILE) $(TEST1_FILE) + @-$(call diff_files,$^,$@) + +$(LOG_FILE): $(DIFF_FILE) + @$(call test_log,$(TEST),$^,$@) + +$(DETAIL_FILE): $(LOG_FILE) + @$(call report_files,$(LOG_FILE) $(CMDSRC_FILE) $(TEST0_FILE) $(ERR_FILE) $(DIFF_FILE) $(TEST1_FILE),$@) + +$(TIME_FILE): $(CMD_FILE) + @$(call time_cmd,$^,$@) + +$(VALGRIND_FILE): $(CMD_FILE) + $(call valgrind_cmd,$^,$@) diff --git a/latex_mk/test/bibtex/0.txt b/latex_mk/test/bibtex/0.txt new file mode 100644 index 0000000..5b23ef5 --- /dev/null +++ b/latex_mk/test/bibtex/0.txt @@ -0,0 +1,26 @@ +bibtex.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES= BIBDB=ref.bib +bibtex.d is generated by scanning bibtex.tex and bibtex.fls. +---------- bibtex_1.pdf: rebase ---------- +platex -interaction=batchmode bibtex.tex +pbibtex bibtex.aux +`bibtex.bbl' -> `bibtex.bbl_prev' +platex -interaction=batchmode bibtex.tex +LaTeX Warning: There were undefined references. +platex -interaction=batchmode bibtex.tex +dvipdfmx bibtex.dvi +`bibtex.pdf' -> `bibtex_1.pdf' + +patching file bibtex.tex +---------- bibtex_2.pdf: update ---------- +bibtex.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=bibtex.bbl GRAPHICFILES= BIBDB=ref.bib +bibtex.d is generated by scanning bibtex.tex and bibtex.fls. +platex -interaction=batchmode bibtex.tex +pbibtex bibtex.aux +`bibtex.bbl' -> `bibtex.bbl_prev' +platex -interaction=batchmode bibtex.tex +LaTeX Warning: There were undefined references. +platex -interaction=batchmode bibtex.tex +dvipdfmx bibtex.dvi +`bibtex.pdf' -> `bibtex_2.pdf' diff --git a/latex_mk/test/bibtex/Makefile b/latex_mk/test/bibtex/Makefile index 8373ada..b6dac59 100644 --- a/latex_mk/test/bibtex/Makefile +++ b/latex_mk/test/bibtex/Makefile @@ -1,67 +1,2 @@ -.PHONY: all bib-update bib-rebase body-update rebase clean distclean - -CAT := cat -CMP := cmp -s -SED := sed - -TEXTARGETS := bibtex.pdf - -$(TEXTARGETS): - -all: - @$(MAKE) -s bibtex_1.pdf - @$(ECHO) '--------------------' - @$(MAKE) -s bibtex_2.pdf - @$(ECHO) '--------------------' - @$(MAKE) -s bibtex_3.pdf - @$(ECHO) '--------------------' - @$(MAKE) -s bibtex_4.pdf - @$(ECHO) '--------------------' - @$(MAKE) -s bibtex_5.pdf - -bibtex_1.pdf: rebase - $(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s bibtex.pdf - $(CP) -v bibtex.pdf $@ - -bibtex_2.pdf: body-update - $(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s bibtex.pdf - $(CP) -v bibtex.pdf $@ - -bibtex_3.pdf: rebase bibtex.pdf bib-update - $(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s bibtex.pdf - $(CP) -v bibtex.pdf $@ - -bibtex_4.pdf: body-update bib-update - $(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s bibtex.pdf - $(CP) -v bibtex.pdf $@ - -bibtex_5.pdf: rebase bibtex.pdf body-update bib-update - $(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s bibtex.pdf - $(CP) -v bibtex.pdf $@ - -include latex.mk - -rebase: bib-rebase body-rebase - -bib-update: bib-rebase - $(CAT) jpnbook_add.bib >>jpnbook.bib - -bib-rebase: - $(CMP) jpnbook.bib.base jpnbook.bib || $(CP) -v jpnbook.bib.base jpnbook.bib - -body-update: body-rebase - $(SED) -i.bak -e 's/本文変更なし。/本文を変更。/' bibtex.tex - -body-rebase: - $(CMP) bibtex.tex.base bibtex.tex || $(CP) -v bibtex.tex.base bibtex.tex - -clean: tex-clean - $(RM) *.bak - -distclean: rebase clean tex-distclean - $(RM) bibtex_*.pdf +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/bibtex/cmd b/latex_mk/test/bibtex/cmd new file mode 100755 index 0000000..34e2b08 --- /dev/null +++ b/latex_mk/test/bibtex/cmd @@ -0,0 +1 @@ +cd ../../sample/bibtex && make -s distclean >/dev/null && make -s all diff --git a/latex_mk/test/bibtex/desc.txt b/latex_mk/test/bibtex/desc.txt new file mode 120000 index 0000000..23d82f0 --- /dev/null +++ b/latex_mk/test/bibtex/desc.txt @@ -0,0 +1 @@ +../../sample/bibtex/desc.txt \ No newline at end of file diff --git a/latex_mk/test/crossref/0.txt b/latex_mk/test/crossref/0.txt new file mode 100644 index 0000000..81c6aa4 --- /dev/null +++ b/latex_mk/test/crossref/0.txt @@ -0,0 +1,7 @@ +crossref.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES= BIBDB= +crossref.d is generated by scanning crossref.tex and crossref.fls. +platex -interaction=batchmode crossref.tex +LaTeX Warning: There were undefined references. +platex -interaction=batchmode crossref.tex +dvipdfmx crossref.dvi diff --git a/latex_mk/test/crossref/Makefile b/latex_mk/test/crossref/Makefile index 6a147f5..b6dac59 100644 --- a/latex_mk/test/crossref/Makefile +++ b/latex_mk/test/crossref/Makefile @@ -1,9 +1,2 @@ -TEXTARGETS := crossref.pdf - -all: $(TEXTARGETS) - -include latex.mk - -clean: tex-clean - -distclean: clean tex-distclean +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/crossref/cmd b/latex_mk/test/crossref/cmd new file mode 100755 index 0000000..8fdcecc --- /dev/null +++ b/latex_mk/test/crossref/cmd @@ -0,0 +1 @@ +cd ../../sample/crossref && make -s distclean && make -s all diff --git a/latex_mk/test/crossref/desc.txt b/latex_mk/test/crossref/desc.txt new file mode 120000 index 0000000..f2e7bb8 --- /dev/null +++ b/latex_mk/test/crossref/desc.txt @@ -0,0 +1 @@ +../../sample/crossref/desc.txt \ No newline at end of file diff --git a/latex_mk/test/dirs.txt b/latex_mk/test/dirs.txt new file mode 100644 index 0000000..d485522 --- /dev/null +++ b/latex_mk/test/dirs.txt @@ -0,0 +1,20 @@ +. +otsuberuto_zo +makeindex +sanposhojo +graphics_comment +error_crossref +toc_pdfbookmarks +crossref +otsuberuto_zo_s +error_no_end_seq +bibtex +graphics_eps +simple +toc +error_undef_ctl_seq +graphics_multi +sample +graphics_pdf +pdfbookmarks +error_no_graphic_file diff --git a/latex_mk/test/error_crossref/0.txt b/latex_mk/test/error_crossref/0.txt new file mode 100644 index 0000000..47b3441 --- /dev/null +++ b/latex_mk/test/error_crossref/0.txt @@ -0,0 +1,16 @@ +crossref.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES= BIBDB= +crossref.d is generated by scanning crossref.tex and crossref.fls. +platex -interaction=batchmode crossref.tex +LaTeX Warning: There were undefined references. +platex -interaction=batchmode crossref.tex +LaTeX Warning: There were undefined references. +platex -interaction=batchmode crossref.tex +LaTeX Warning: There were undefined references. +platex -interaction=batchmode crossref.tex +platex is run 3 times, but there are still undefined references. +crossref.tex:46: LaTeX Warning: Reference `noexist' on page 1 undefined on input line 46. + +LaTeX Warning: There were undefined references. + +make: *** [crossref.dvi] Error 1 diff --git a/latex_mk/test/error_crossref/Makefile b/latex_mk/test/error_crossref/Makefile index 6a147f5..b6dac59 100644 --- a/latex_mk/test/error_crossref/Makefile +++ b/latex_mk/test/error_crossref/Makefile @@ -1,9 +1,2 @@ -TEXTARGETS := crossref.pdf - -all: $(TEXTARGETS) - -include latex.mk - -clean: tex-clean - -distclean: clean tex-distclean +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/error_crossref/cmd b/latex_mk/test/error_crossref/cmd new file mode 100755 index 0000000..2c364b0 --- /dev/null +++ b/latex_mk/test/error_crossref/cmd @@ -0,0 +1 @@ +cd ../../sample/error_crossref && make -s distclean && make -s all 2>&1 | sed -e 's/make\[[0-9]*\]/make/g' diff --git a/latex_mk/test/error_crossref/desc.txt b/latex_mk/test/error_crossref/desc.txt new file mode 120000 index 0000000..e8a4f8a --- /dev/null +++ b/latex_mk/test/error_crossref/desc.txt @@ -0,0 +1 @@ +../../sample/error_crossref/desc.txt \ No newline at end of file diff --git a/latex_mk/test/error_no_end_seq/0.txt b/latex_mk/test/error_no_end_seq/0.txt new file mode 100644 index 0000000..9da7979 --- /dev/null +++ b/latex_mk/test/error_no_end_seq/0.txt @@ -0,0 +1,10 @@ +error_no_end_seq.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES= BIBDB= +error_no_end_seq.d is generated by scanning error_no_end_seq.tex and error_no_end_seq.fls. +platex -interaction=batchmode error_no_end_seq.tex +! Emergency stop. +<*> error_no_end_seq.tex + +*** (job aborted, no legal \end found) + +make: *** [error_no_end_seq.dvi] Error 1 diff --git a/latex_mk/test/error_no_end_seq/Makefile b/latex_mk/test/error_no_end_seq/Makefile index caaeb82..b6dac59 100644 --- a/latex_mk/test/error_no_end_seq/Makefile +++ b/latex_mk/test/error_no_end_seq/Makefile @@ -1,15 +1,2 @@ -TEXTARGETS := simple.pdf - -CMP := cmp -s -SED := sed - -.PHONY: all update rebase clean distclean - -all: - $(MAKE) -s $(TEXTARGETS) && exit 1 || exit 0 - -include latex.mk - -clean: tex-clean - -distclean: tex-distclean +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/error_no_end_seq/cmd b/latex_mk/test/error_no_end_seq/cmd new file mode 100755 index 0000000..c7825a5 --- /dev/null +++ b/latex_mk/test/error_no_end_seq/cmd @@ -0,0 +1 @@ +cd ../../sample/error_no_end_seq && make -s distclean && make -s all 2>&1 | sed -e 's/make\[[0-9]*\]/make/g' diff --git a/latex_mk/test/error_no_end_seq/desc.txt b/latex_mk/test/error_no_end_seq/desc.txt new file mode 120000 index 0000000..60fa092 --- /dev/null +++ b/latex_mk/test/error_no_end_seq/desc.txt @@ -0,0 +1 @@ +../../sample/error_no_end_seq/desc.txt \ No newline at end of file diff --git a/latex_mk/test/error_no_graphic_file/0.txt b/latex_mk/test/error_no_graphic_file/0.txt new file mode 100644 index 0000000..7c7144d --- /dev/null +++ b/latex_mk/test/error_no_graphic_file/0.txt @@ -0,0 +1 @@ +make: *** No rule to make target `error_no_graphic_file.pdf'. Stop. diff --git a/latex_mk/test/error_no_graphic_file/Makefile b/latex_mk/test/error_no_graphic_file/Makefile index f89d4b6..b6dac59 100644 --- a/latex_mk/test/error_no_graphic_file/Makefile +++ b/latex_mk/test/error_no_graphic_file/Makefile @@ -1,12 +1,2 @@ -.PHONY: all update clean distclean - -TEXTARGETS := graphics.pdf - -all: - $(MAKE) -s graphics.pdf && exit 1 || exit 0 - -include latex.mk - -clean: tex-clean - -distclean: clean tex-distclean +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/error_no_graphic_file/cmd b/latex_mk/test/error_no_graphic_file/cmd new file mode 100755 index 0000000..41b3205 --- /dev/null +++ b/latex_mk/test/error_no_graphic_file/cmd @@ -0,0 +1 @@ +cd ../../sample/error_no_graphic_file && make -s distclean && make -s all 2>&1 | sed -e 's/make\[[0-9]*\]/make/g' diff --git a/latex_mk/test/error_no_graphic_file/desc.txt b/latex_mk/test/error_no_graphic_file/desc.txt new file mode 120000 index 0000000..a0c7fbf --- /dev/null +++ b/latex_mk/test/error_no_graphic_file/desc.txt @@ -0,0 +1 @@ +../../sample/error_no_graphic_file/desc.txt \ No newline at end of file diff --git a/latex_mk/test/error_undef_ctl_seq/0.txt b/latex_mk/test/error_undef_ctl_seq/0.txt new file mode 100644 index 0000000..863bc74 --- /dev/null +++ b/latex_mk/test/error_undef_ctl_seq/0.txt @@ -0,0 +1,14 @@ +simple.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES= BIBDB= +simple.d is generated by scanning simple.tex and simple.fls. +platex -interaction=batchmode simple.tex +! Undefined control sequence. +simple.tex:4: l.4 「何人もの\textbt + {ニュートン}がいた(There were several Newtons)」 +The control sequence at the end of the top line +of your error message was never \def'ed. If you have +misspelled it (e.g., `\hobx'), type `I' and the correct +spelling (e.g., `I\hbox'). Otherwise just continue, +and I'll forget about whatever was undefined. + +make: *** [simple.dvi] Error 1 diff --git a/latex_mk/test/error_undef_ctl_seq/Makefile b/latex_mk/test/error_undef_ctl_seq/Makefile index 4cd712d..b6dac59 100644 --- a/latex_mk/test/error_undef_ctl_seq/Makefile +++ b/latex_mk/test/error_undef_ctl_seq/Makefile @@ -1,14 +1,2 @@ -TEXTARGETS := simple.pdf - -CMP := cmp -s -SED := sed - -.PHONY: all clean distclean - -all: $(TEXTARGETS) - -include latex.mk - -clean: tex-clean - -distclean: clean tex-distclean +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/error_undef_ctl_seq/cmd b/latex_mk/test/error_undef_ctl_seq/cmd new file mode 100755 index 0000000..d3a1b8b --- /dev/null +++ b/latex_mk/test/error_undef_ctl_seq/cmd @@ -0,0 +1 @@ +cd ../../sample/error_undef_ctl_seq && make -s distclean && make -s all 2>&1 | sed -e 's/make\[[0-9]*\]/make/g' diff --git a/latex_mk/test/error_undef_ctl_seq/desc.txt b/latex_mk/test/error_undef_ctl_seq/desc.txt new file mode 120000 index 0000000..7eea9af --- /dev/null +++ b/latex_mk/test/error_undef_ctl_seq/desc.txt @@ -0,0 +1 @@ +../../sample/error_undef_ctl_seq/desc.txt \ No newline at end of file diff --git a/latex_mk/test/graphics_comment/0.txt b/latex_mk/test/graphics_comment/0.txt new file mode 100644 index 0000000..1181793 --- /dev/null +++ b/latex_mk/test/graphics_comment/0.txt @@ -0,0 +1,5 @@ +graphics_comment.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES=tiger1.pdf tiger4.pdf BIBDB= +graphics_comment.d is generated by scanning graphics_comment.tex and graphics_comment.fls. +platex -interaction=batchmode graphics_comment.tex +dvipdfmx graphics_comment.dvi diff --git a/latex_mk/test/graphics_comment/Makefile b/latex_mk/test/graphics_comment/Makefile index 39abe36..b6dac59 100644 --- a/latex_mk/test/graphics_comment/Makefile +++ b/latex_mk/test/graphics_comment/Makefile @@ -1,18 +1,2 @@ -.PHONY: all update rebase - -TEXTARGETS := graphics_comment.pdf - -CMP := cmp -s -CP := cp -CONVERT := convert - -$(TEXTARGETS): - -all: $(TEXTARGETS) - -include latex.mk - -clean: tex-clean - -distclean: rebase clean tex-distclean - $(RM) graphics_*.pdf +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/graphics_comment/cmd b/latex_mk/test/graphics_comment/cmd new file mode 100755 index 0000000..ab411a6 --- /dev/null +++ b/latex_mk/test/graphics_comment/cmd @@ -0,0 +1 @@ +cd ../../sample/graphics_comment && make -s distclean && make -s all diff --git a/latex_mk/test/graphics_comment/desc.txt b/latex_mk/test/graphics_comment/desc.txt new file mode 120000 index 0000000..a4f7ecb --- /dev/null +++ b/latex_mk/test/graphics_comment/desc.txt @@ -0,0 +1 @@ +../../sample/graphics_comment/desc.txt \ No newline at end of file diff --git a/latex_mk/test/graphics_eps/0.txt b/latex_mk/test/graphics_eps/0.txt new file mode 100644 index 0000000..30d5b0d --- /dev/null +++ b/latex_mk/test/graphics_eps/0.txt @@ -0,0 +1,12 @@ +graphics_eps.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES=tiger.eps BIBDB= +graphics_eps.d is generated by scanning graphics_eps.tex and graphics_eps.fls. +---------- graphics_eps_1.pdf: rebase ---------- +platex -interaction=batchmode graphics_eps.tex +dvipdfmx graphics_eps.dvi +`graphics_eps.pdf' -> `graphics_eps_1.pdf' +-------------------- +---------- graphics_eps_2.pdf: update ---------- +platex -interaction=batchmode graphics_eps.tex +dvipdfmx graphics_eps.dvi +`graphics_eps.pdf' -> `graphics_eps_2.pdf' diff --git a/latex_mk/test/graphics_eps/Makefile b/latex_mk/test/graphics_eps/Makefile index b50b90f..b6dac59 100644 --- a/latex_mk/test/graphics_eps/Makefile +++ b/latex_mk/test/graphics_eps/Makefile @@ -1,37 +1,2 @@ -.PHONY: all update rebase - -TEXTARGETS := graphics_eps.pdf - -CMP := cmp -s -CP := cp -CONVERT := convert - -$(TEXTARGETS): - -all: - @$(MAKE) -s graphics_eps_1.pdf - @$(ECHO) '--------------------' - @$(MAKE) -s graphics_eps_2.pdf - -graphics_eps_1.pdf: rebase - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s graphics_eps.pdf - $(CP) -v graphics_eps.pdf $@ - -graphics_eps_2.pdf: update - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s graphics_eps.pdf - $(CP) -v graphics_eps.pdf $@ - -rebase: - $(CMP) tiger.eps.base tiger.eps || $(CP) tiger.eps.base tiger.eps - -update: - $(CONVERT) Panthera_tigris_tigris.jpg tiger.eps - -include latex.mk - -clean: tex-clean - -distclean: rebase clean tex-distclean - $(RM) graphics_eps_*.pdf +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/graphics_eps/cmd b/latex_mk/test/graphics_eps/cmd new file mode 100755 index 0000000..3a019b3 --- /dev/null +++ b/latex_mk/test/graphics_eps/cmd @@ -0,0 +1 @@ +cd ../../sample/graphics_eps && make -s distclean && make -s all diff --git a/latex_mk/test/graphics_eps/desc.txt b/latex_mk/test/graphics_eps/desc.txt new file mode 120000 index 0000000..80b74e3 --- /dev/null +++ b/latex_mk/test/graphics_eps/desc.txt @@ -0,0 +1 @@ +../../sample/graphics_eps/desc.txt \ No newline at end of file diff --git a/latex_mk/test/graphics_multi/0.txt b/latex_mk/test/graphics_multi/0.txt new file mode 100644 index 0000000..8b23533 --- /dev/null +++ b/latex_mk/test/graphics_multi/0.txt @@ -0,0 +1,5 @@ +graphics.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES=banana.jpg cherry.jpg fruits.jpg grapefruits.jpg melon.jpg orange.jpg BIBDB= +graphics.d is generated by scanning graphics.tex and graphics.fls. +platex -interaction=batchmode graphics.tex +dvipdfmx graphics.dvi diff --git a/latex_mk/test/graphics_multi/Makefile b/latex_mk/test/graphics_multi/Makefile new file mode 100644 index 0000000..b6dac59 --- /dev/null +++ b/latex_mk/test/graphics_multi/Makefile @@ -0,0 +1,2 @@ +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/graphics_multi/cmd b/latex_mk/test/graphics_multi/cmd new file mode 100755 index 0000000..166b2ed --- /dev/null +++ b/latex_mk/test/graphics_multi/cmd @@ -0,0 +1 @@ +cd ../../sample/graphics_multi && make -s distclean && make -s all diff --git a/latex_mk/test/graphics_multi/desc.txt b/latex_mk/test/graphics_multi/desc.txt new file mode 120000 index 0000000..6c0bd85 --- /dev/null +++ b/latex_mk/test/graphics_multi/desc.txt @@ -0,0 +1 @@ +../../sample/graphics_multi/desc.txt \ No newline at end of file diff --git a/latex_mk/test/graphics_pdf/0.txt b/latex_mk/test/graphics_pdf/0.txt new file mode 100644 index 0000000..48e8f9b --- /dev/null +++ b/latex_mk/test/graphics_pdf/0.txt @@ -0,0 +1,13 @@ +`tiger.pdf.base' -> `tiger.pdf' +graphics_pdf.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES=tiger.pdf BIBDB= +graphics_pdf.d is generated by scanning graphics_pdf.tex and graphics_pdf.fls. +---------- graphics_pdf_1.pdf: rebase ---------- +platex -interaction=batchmode graphics_pdf.tex +dvipdfmx graphics_pdf.dvi +`graphics_pdf.pdf' -> `graphics_pdf_1.pdf' +-------------------- +---------- graphics_pdf_2.pdf: update ---------- +platex -interaction=batchmode graphics_pdf.tex +dvipdfmx graphics_pdf.dvi +`graphics_pdf.pdf' -> `graphics_pdf_2.pdf' diff --git a/latex_mk/test/graphics_pdf/Makefile b/latex_mk/test/graphics_pdf/Makefile index 65c475a..b6dac59 100644 --- a/latex_mk/test/graphics_pdf/Makefile +++ b/latex_mk/test/graphics_pdf/Makefile @@ -1,37 +1,2 @@ -.PHONY: all update rebase - -TEXTARGETS := graphics_pdf.pdf - -CMP := cmp -s -CP := cp -CONVERT := convert - -$(TEXTARGETS): - -all: - @$(MAKE) -s graphics_pdf_1.pdf - @$(ECHO) '--------------------' - @$(MAKE) -s graphics_pdf_2.pdf - -graphics_pdf_1.pdf: rebase - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s graphics_pdf.pdf - $(CP) -v graphics_pdf.pdf $@ - -graphics_pdf_2.pdf: update - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s graphics_pdf.pdf - $(CP) -v graphics_pdf.pdf $@ - -rebase: - $(CMP) tiger.pdf.base tiger.pdf || $(CP) -v tiger.pdf.base tiger.pdf - -update: - $(CONVERT) Panthera_tigris_tigris.jpg tiger.pdf - -include latex.mk - -clean: tex-clean - -distclean: rebase clean tex-distclean - $(RM) graphics_pdf_*.pdf +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/graphics_pdf/cmd b/latex_mk/test/graphics_pdf/cmd new file mode 100755 index 0000000..e06c36d --- /dev/null +++ b/latex_mk/test/graphics_pdf/cmd @@ -0,0 +1 @@ +cd ../../sample/graphics_pdf && make -s distclean && make -s all diff --git a/latex_mk/test/graphics_pdf/desc.txt b/latex_mk/test/graphics_pdf/desc.txt new file mode 120000 index 0000000..c97d927 --- /dev/null +++ b/latex_mk/test/graphics_pdf/desc.txt @@ -0,0 +1 @@ +../../sample/graphics_pdf/desc.txt \ No newline at end of file diff --git a/latex_mk/test/ln-desc.sh b/latex_mk/test/ln-desc.sh new file mode 100644 index 0000000..71e1fba --- /dev/null +++ b/latex_mk/test/ln-desc.sh @@ -0,0 +1,19 @@ +ln -s ../../sample/bibtex/desc.txt bibtex/desc.txt +ln -s ../../sample/crossref/desc.txt crossref/desc.txt +ln -s ../../sample/error_crossref/desc.txt error_crossref/desc.txt +ln -s ../../sample/error_no_end_seq/desc.txt error_no_end_seq/desc.txt +ln -s ../../sample/error_no_graphic_file/desc.txt error_no_graphic_file/desc.txt +ln -s ../../sample/error_undef_ctl_seq/desc.txt error_undef_ctl_seq/desc.txt +ln -s ../../sample/graphics_comment/desc.txt graphics_comment/desc.txt +ln -s ../../sample/graphics_eps/desc.txt graphics_eps/desc.txt +ln -s ../../sample/graphics_multi/desc.txt graphics_multi/desc.txt +ln -s ../../sample/graphics_pdf/desc.txt graphics_pdf/desc.txt +ln -s ../../sample/makeindex/desc.txt makeindex/desc.txt +ln -s ../../sample/otsuberuto_zo/desc.txt otsuberuto_zo/desc.txt +ln -s ../../sample/otsuberuto_zo_s/desc.txt otsuberuto_zo_s/desc.txt +ln -s ../../sample/pdfbookmarks/desc.txt pdfbookmarks/desc.txt +ln -s ../../sample/sample/desc.txt sample/desc.txt +ln -s ../../sample/sanposhojo/desc.txt sanposhojo/desc.txt +ln -s ../../sample/simple/desc.txt simple/desc.txt +ln -s ../../sample/toc/desc.txt toc/desc.txt +ln -s ../../sample/toc_pdfbookmarks/desc.txt toc_pdfbookmarks/desc.txt diff --git a/latex_mk/test/makeindex/0.txt b/latex_mk/test/makeindex/0.txt new file mode 100644 index 0000000..5546215 --- /dev/null +++ b/latex_mk/test/makeindex/0.txt @@ -0,0 +1,34 @@ +makeindex.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=makeindex.ind GRAPHICFILES= BIBDB= +makeindex.d is generated by scanning makeindex.tex and makeindex.fls. +---------- makeindex_1.pdf: rebase ---------- +platex -interaction=batchmode makeindex.tex +`makeindex.idx' -> `makeindex.idx_prev' +mendex makeindex.idx +`makeindex.ind' -> `makeindex.ind_prev' +platex -interaction=batchmode makeindex.tex +dvipdfmx makeindex.dvi +`makeindex.pdf' -> `makeindex_1.pdf' +-------------------- +---------- makeindex_2.pdf: body-update ---------- +makeindex.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=makeindex.ind GRAPHICFILES= BIBDB= +makeindex.d is generated by scanning makeindex.tex and makeindex.fls. +platex -interaction=batchmode makeindex.tex +`makeindex.idx' -> `makeindex.idx_prev' +mendex makeindex.idx +makeindex.ind_prev is up to date. +dvipdfmx makeindex.dvi +`makeindex.pdf' -> `makeindex_2.pdf' +-------------------- +---------- makeindex_3.pdf: index-update ---------- +makeindex.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=makeindex.ind GRAPHICFILES= BIBDB= +makeindex.d is generated by scanning makeindex.tex and makeindex.fls. +platex -interaction=batchmode makeindex.tex +`makeindex.idx' -> `makeindex.idx_prev' +mendex makeindex.idx +`makeindex.ind' -> `makeindex.ind_prev' +platex -interaction=batchmode makeindex.tex +dvipdfmx makeindex.dvi +`makeindex.pdf' -> `makeindex_3.pdf' diff --git a/latex_mk/test/makeindex/Makefile b/latex_mk/test/makeindex/Makefile index c6e0f03..b6dac59 100644 --- a/latex_mk/test/makeindex/Makefile +++ b/latex_mk/test/makeindex/Makefile @@ -1,47 +1,2 @@ -TEXTARGETS := makeindex.pdf - -.PHONY: all index-update rebase index-rebase tex-update tex-rebase clean distclean - -CMP := cmp -s -SED := sed - -$(TEXTARGETS): - -all: - @$(MAKE) -s makeindex_1.pdf - @$(ECHO) '--------------------' - @$(MAKE) -s makeindex_2.pdf - @$(ECHO) '--------------------' - @$(MAKE) -s makeindex_3.pdf - -makeindex_1.pdf: rebase - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s makeindex.pdf - @$(CP) -v makeindex.pdf $@ - -makeindex_2.pdf: body-update - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s makeindex.pdf - @$(CP) -v makeindex.pdf $@ - -makeindex_3.pdf: index-update - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s makeindex.pdf - @$(CP) -v makeindex.pdf $@ - -body-update: - $(SED) -i.bak -e 's/本文変更なし。/本文を変更。/' makeindex.tex - -index-update: - $(SED) -i.bak -e 's/楽譜の/楽譜\\index{がくふ@楽譜}の/' makeindex.tex - -rebase: - $(CMP) makeindex.tex.base makeindex.tex || $(CP) -v makeindex.tex.base makeindex.tex - -include latex.mk - -clean: tex-clean - $(RM) *.bak - -distclean: rebase clean tex-distclean - $(RM) makeindex_*.pdf +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/makeindex/cmd b/latex_mk/test/makeindex/cmd new file mode 100755 index 0000000..77d0a53 --- /dev/null +++ b/latex_mk/test/makeindex/cmd @@ -0,0 +1 @@ +cd ../../sample/makeindex && make -s distclean >/dev/null && make -s all diff --git a/latex_mk/test/makeindex/desc.txt b/latex_mk/test/makeindex/desc.txt new file mode 120000 index 0000000..4617abe --- /dev/null +++ b/latex_mk/test/makeindex/desc.txt @@ -0,0 +1 @@ +../../sample/makeindex/desc.txt \ No newline at end of file diff --git a/latex_mk/test/otsuberuto_zo/0.txt b/latex_mk/test/otsuberuto_zo/0.txt new file mode 100644 index 0000000..9d3ec3c --- /dev/null +++ b/latex_mk/test/otsuberuto_zo/0.txt @@ -0,0 +1,5 @@ +otsuberuto_zo.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES=azlogo.eps BIBDB= +otsuberuto_zo.d is generated by scanning otsuberuto_zo.tex and otsuberuto_zo.fls. +platex -interaction=batchmode otsuberuto_zo.tex +dvipdfmx otsuberuto_zo.dvi diff --git a/latex_mk/test/otsuberuto_zo/Makefile b/latex_mk/test/otsuberuto_zo/Makefile deleted file mode 120000 index 2862b17..0000000 --- a/latex_mk/test/otsuberuto_zo/Makefile +++ /dev/null @@ -1 +0,0 @@ -../Makefile.template \ No newline at end of file diff --git a/latex_mk/test/otsuberuto_zo/Makefile b/latex_mk/test/otsuberuto_zo/Makefile new file mode 100644 index 0000000..b6dac59 --- /dev/null +++ b/latex_mk/test/otsuberuto_zo/Makefile @@ -0,0 +1,2 @@ +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/otsuberuto_zo/cmd b/latex_mk/test/otsuberuto_zo/cmd new file mode 100755 index 0000000..0b86f78 --- /dev/null +++ b/latex_mk/test/otsuberuto_zo/cmd @@ -0,0 +1 @@ +cd ../../sample/otsuberuto_zo && make -s distclean && make -s all diff --git a/latex_mk/test/otsuberuto_zo/desc.txt b/latex_mk/test/otsuberuto_zo/desc.txt new file mode 120000 index 0000000..0068b11 --- /dev/null +++ b/latex_mk/test/otsuberuto_zo/desc.txt @@ -0,0 +1 @@ +../../sample/otsuberuto_zo/desc.txt \ No newline at end of file diff --git a/latex_mk/test/otsuberuto_zo_s/0.txt b/latex_mk/test/otsuberuto_zo_s/0.txt new file mode 100644 index 0000000..bf326a1 --- /dev/null +++ b/latex_mk/test/otsuberuto_zo_s/0.txt @@ -0,0 +1,5 @@ +otsuberuto_zo.fls is generated. +Makefiles variable -- TEXFILES=body.tex daigo.tex daiichi.tex daini.tex style.tex LATEXINTFILES= GRAPHICFILES=azlogo.eps BIBDB= +otsuberuto_zo.d is generated by scanning otsuberuto_zo.tex and otsuberuto_zo.fls. +platex -interaction=batchmode otsuberuto_zo.tex +dvipdfmx otsuberuto_zo.dvi diff --git a/latex_mk/test/otsuberuto_zo_s/Makefile b/latex_mk/test/otsuberuto_zo_s/Makefile index 1e7aeaa..b6dac59 100644 --- a/latex_mk/test/otsuberuto_zo_s/Makefile +++ b/latex_mk/test/otsuberuto_zo_s/Makefile @@ -1,9 +1,2 @@ -TEXTARGETS := otsuberuto_zo.pdf - -all: $(TEXTARGETS) - -include latex.mk - -clean: tex-clean - -distclean: clean tex-distclean +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/otsuberuto_zo_s/cmd b/latex_mk/test/otsuberuto_zo_s/cmd new file mode 100755 index 0000000..dbf265d --- /dev/null +++ b/latex_mk/test/otsuberuto_zo_s/cmd @@ -0,0 +1 @@ +cd ../../sample/otsuberuto_zo_s && make -s distclean && make -s all diff --git a/latex_mk/test/otsuberuto_zo_s/desc.txt b/latex_mk/test/otsuberuto_zo_s/desc.txt new file mode 120000 index 0000000..1a90972 --- /dev/null +++ b/latex_mk/test/otsuberuto_zo_s/desc.txt @@ -0,0 +1 @@ +../../sample/otsuberuto_zo_s/desc.txt \ No newline at end of file diff --git a/latex_mk/test/pdfbookmarks/0.txt b/latex_mk/test/pdfbookmarks/0.txt new file mode 100644 index 0000000..0575da6 --- /dev/null +++ b/latex_mk/test/pdfbookmarks/0.txt @@ -0,0 +1,20 @@ +pdfbookmarks.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=pdfbookmarks.out GRAPHICFILES= BIBDB= +pdfbookmarks.d is generated by scanning pdfbookmarks.tex and pdfbookmarks.fls. +---------- pdfbookmarks_1.pdf: rebase ---------- +platex -interaction=batchmode pdfbookmarks.tex +`pdfbookmarks.out' -> `pdfbookmarks.out_prev' +platex -interaction=batchmode pdfbookmarks.tex +dvipdfmx pdfbookmarks.dvi +`pdfbookmarks.pdf' -> `pdfbookmarks_1.pdf' +-------------------- +patching file pdfbookmarks.tex +---------- pdfbookmarks_2.pdf: update ---------- +pdfbookmarks.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=pdfbookmarks.out GRAPHICFILES= BIBDB= +pdfbookmarks.d is generated by scanning pdfbookmarks.tex and pdfbookmarks.fls. +platex -interaction=batchmode pdfbookmarks.tex +`pdfbookmarks.out' -> `pdfbookmarks.out_prev' +platex -interaction=batchmode pdfbookmarks.tex +dvipdfmx pdfbookmarks.dvi +`pdfbookmarks.pdf' -> `pdfbookmarks_2.pdf' diff --git a/latex_mk/test/pdfbookmarks/Makefile b/latex_mk/test/pdfbookmarks/Makefile new file mode 100644 index 0000000..b6dac59 --- /dev/null +++ b/latex_mk/test/pdfbookmarks/Makefile @@ -0,0 +1,2 @@ +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/pdfbookmarks/cmd b/latex_mk/test/pdfbookmarks/cmd new file mode 100755 index 0000000..3a4dda7 --- /dev/null +++ b/latex_mk/test/pdfbookmarks/cmd @@ -0,0 +1 @@ +cd ../../sample/pdfbookmarks && make -s distclean >/dev/null && make -s all diff --git a/latex_mk/test/pdfbookmarks/desc.txt b/latex_mk/test/pdfbookmarks/desc.txt new file mode 120000 index 0000000..015c53e --- /dev/null +++ b/latex_mk/test/pdfbookmarks/desc.txt @@ -0,0 +1 @@ +../../sample/pdfbookmarks/desc.txt \ No newline at end of file diff --git a/latex_mk/test/sample/0.txt b/latex_mk/test/sample/0.txt new file mode 100644 index 0000000..a00c4c5 --- /dev/null +++ b/latex_mk/test/sample/0.txt @@ -0,0 +1,5 @@ +sample.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES= BIBDB= +sample.d is generated by scanning sample.tex and sample.fls. +platex -interaction=batchmode sample.tex +dvipdfmx sample.dvi diff --git a/latex_mk/test/sample/Makefile b/latex_mk/test/sample/Makefile deleted file mode 120000 index 2862b17..0000000 --- a/latex_mk/test/sample/Makefile +++ /dev/null @@ -1 +0,0 @@ -../Makefile.template \ No newline at end of file diff --git a/latex_mk/test/sample/Makefile b/latex_mk/test/sample/Makefile new file mode 100644 index 0000000..b6dac59 --- /dev/null +++ b/latex_mk/test/sample/Makefile @@ -0,0 +1,2 @@ +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/sample/cmd b/latex_mk/test/sample/cmd new file mode 100755 index 0000000..8a91d5b --- /dev/null +++ b/latex_mk/test/sample/cmd @@ -0,0 +1 @@ +cd ../../sample/sample && make -s distclean && make -s all diff --git a/latex_mk/test/sample/desc.txt b/latex_mk/test/sample/desc.txt new file mode 120000 index 0000000..26d2025 --- /dev/null +++ b/latex_mk/test/sample/desc.txt @@ -0,0 +1 @@ +../../sample/sample/desc.txt \ No newline at end of file diff --git a/latex_mk/test/sanposhojo/0.txt b/latex_mk/test/sanposhojo/0.txt new file mode 100644 index 0000000..d3ee98d --- /dev/null +++ b/latex_mk/test/sanposhojo/0.txt @@ -0,0 +1,12 @@ +q1_ans.fls is generated. +Makefiles variable -- TEXFILES=q1_q.tex LATEXINTFILES=q1_ans.out GRAPHICFILES=q1_0.pdf q1_1.pdf q1_2.pdf BIBDB= +q1_ans.d is generated by scanning q1_ans.tex and q1_ans.fls. +q1.fls is generated. +Makefiles variable -- TEXFILES=q1_q.tex LATEXINTFILES= GRAPHICFILES=q1_0.pdf q1_1.pdf q1_2.pdf BIBDB= +q1.d is generated by scanning q1.tex and q1.fls. +platex -interaction=batchmode q1.tex +dvipdfmx q1.dvi +platex -interaction=batchmode q1_ans.tex +`q1_ans.out' -> `q1_ans.out_prev' +platex -interaction=batchmode q1_ans.tex +dvipdfmx q1_ans.dvi diff --git a/latex_mk/test/sanposhojo/Makefile b/latex_mk/test/sanposhojo/Makefile index b03d196..b6dac59 100644 --- a/latex_mk/test/sanposhojo/Makefile +++ b/latex_mk/test/sanposhojo/Makefile @@ -1,11 +1,2 @@ -TEXTARGETS = q1.pdf q1_ans.pdf - -.PHONY: all - -all: $(TEXTARGETS) - -include latex.mk eukleides.mk - -distclean: tex-distclean eukleides-distclean - -clean: tex-clean eukleides-clean +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/sanposhojo/cmd b/latex_mk/test/sanposhojo/cmd new file mode 100755 index 0000000..2e32f19 --- /dev/null +++ b/latex_mk/test/sanposhojo/cmd @@ -0,0 +1 @@ +cd ../../sample/sanposhojo && make -s distclean && make -s all diff --git a/latex_mk/test/sanposhojo/desc.txt b/latex_mk/test/sanposhojo/desc.txt new file mode 120000 index 0000000..cec4619 --- /dev/null +++ b/latex_mk/test/sanposhojo/desc.txt @@ -0,0 +1 @@ +../../sample/sanposhojo/desc.txt \ No newline at end of file diff --git a/latex_mk/test/simple/0.txt b/latex_mk/test/simple/0.txt new file mode 100644 index 0000000..f84845e --- /dev/null +++ b/latex_mk/test/simple/0.txt @@ -0,0 +1,15 @@ +simple.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES= BIBDB= +simple.d is generated by scanning simple.tex and simple.fls. +---------- simple_1.pdf: rebase ---------- +platex -interaction=batchmode simple.tex +dvipdfmx simple.dvi +`simple.pdf' -> `simple_1.pdf' +-------------------- +---------- simple_2.pdf: update ---------- +simple.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES= GRAPHICFILES= BIBDB= +simple.d is generated by scanning simple.tex and simple.fls. +platex -interaction=batchmode simple.tex +dvipdfmx simple.dvi +`simple.pdf' -> `simple_2.pdf' diff --git a/latex_mk/test/simple/Makefile b/latex_mk/test/simple/Makefile index 04ab342..b6dac59 100644 --- a/latex_mk/test/simple/Makefile +++ b/latex_mk/test/simple/Makefile @@ -1,37 +1,2 @@ -TEXTARGETS := simple.pdf - -CMP := cmp -s -SED := sed - -.PHONY: all update rebase clean distclean - -$(TEXTARGETS): - -all: - @$(MAKE) -s simple_1.pdf - @$(ECHO) '--------------------' - @$(MAKE) -s simple_2.pdf - -simple_1.pdf: rebase - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s simple.pdf - @$(CP) -v simple.pdf $@ - -simple_2.pdf: update - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s simple.pdf - @$(CP) -v simple.pdf $@ - -update: - $(SED) -i.bak -e 's/,/、/g' -e 's/./。/g' simple.tex - -rebase: - $(CMP) simple.tex.base simple.tex || $(CP) -v simple.tex.base simple.tex - -include latex.mk - -clean: tex-clean - $(RM) *.bak - -distclean: rebase clean tex-distclean - $(RM) simple_*.pdf +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/simple/cmd b/latex_mk/test/simple/cmd new file mode 100755 index 0000000..10faa63 --- /dev/null +++ b/latex_mk/test/simple/cmd @@ -0,0 +1 @@ +cd ../../sample/simple && make -s distclean >/dev/null && make -s all diff --git a/latex_mk/test/simple/desc.txt b/latex_mk/test/simple/desc.txt new file mode 120000 index 0000000..77d3244 --- /dev/null +++ b/latex_mk/test/simple/desc.txt @@ -0,0 +1 @@ +../../sample/simple/desc.txt \ No newline at end of file diff --git a/latex_mk/test/toc/0.txt b/latex_mk/test/toc/0.txt new file mode 100644 index 0000000..c4ea77b --- /dev/null +++ b/latex_mk/test/toc/0.txt @@ -0,0 +1,32 @@ +`toc.tex.5th' -> `toc.tex' +toc.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=toc.toc GRAPHICFILES= BIBDB= +toc.d is generated by scanning toc.tex and toc.fls. +---------- toc_1.pdf: rebase ---------- +platex -interaction=batchmode toc.tex +`toc.toc' -> `toc.toc_prev' +platex -interaction=batchmode toc.tex +dvipdfmx toc.dvi +`toc.pdf' -> `toc_1.pdf' +-------------------- +patching file toc.tex +---------- toc_2.pdf: add ---------- +toc.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=toc.toc GRAPHICFILES= BIBDB= +toc.d is generated by scanning toc.tex and toc.fls. +platex -interaction=batchmode toc.tex +toc.toc_prev is up to date. +dvipdfmx toc.dvi +`toc.pdf' -> `toc_2.pdf' +-------------------- +`toc.tex.5th' -> `toc.tex' +patching file toc.tex +---------- toc_3.pdf: update ---------- +toc.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=toc.toc GRAPHICFILES= BIBDB= +toc.d is generated by scanning toc.tex and toc.fls. +platex -interaction=batchmode toc.tex +`toc.toc' -> `toc.toc_prev' +platex -interaction=batchmode toc.tex +dvipdfmx toc.dvi +`toc.pdf' -> `toc_3.pdf' diff --git a/latex_mk/test/toc/Makefile b/latex_mk/test/toc/Makefile index dac8be3..b6dac59 100644 --- a/latex_mk/test/toc/Makefile +++ b/latex_mk/test/toc/Makefile @@ -1,42 +1,2 @@ -TEXTARGETS := toc.pdf - -CMP := cmp -s -DIFF := diff -PATCH := patch - -.PHONY: all update rebase clean distclean - -$(TEXTARGETS): - -all: - @$(MAKE) -s toc_1.pdf - @$(ECHO) '--------------------' - @$(MAKE) -s toc_2.pdf - -toc_1.pdf: rebase - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s toc.pdf - @$(CP) -v toc.pdf $@ - -toc_2.pdf: update - @$(ECHO) '---------- $@: $^ ----------' - @$(MAKE) -s toc.pdf - @$(CP) -v toc.pdf $@ - -update: toc.tex.6th.patch - @$(PATCH) <$< - -toc.tex.6th.patch: - @$(MAKE) -s rebase - @$(DIFF) -u toc.tex toc.tex.6th >$@ || exit 0 - -rebase: - $(CMP) toc.tex.5th toc.tex || $(CP) -v toc.tex.5th toc.tex - -include latex.mk - -clean: tex-clean - -distclean: rebase tex-distclean - $(RM) *.patch - $(RM) toc_*.pdf +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/toc/cmd b/latex_mk/test/toc/cmd new file mode 100755 index 0000000..4f84be4 --- /dev/null +++ b/latex_mk/test/toc/cmd @@ -0,0 +1 @@ +cd ../../sample/toc && make -s distclean && make -s all diff --git a/latex_mk/test/toc/desc.txt b/latex_mk/test/toc/desc.txt new file mode 120000 index 0000000..d40364d --- /dev/null +++ b/latex_mk/test/toc/desc.txt @@ -0,0 +1 @@ +../../sample/toc/desc.txt \ No newline at end of file diff --git a/latex_mk/test/toc_pdfbookmarks/0.txt b/latex_mk/test/toc_pdfbookmarks/0.txt new file mode 100644 index 0000000..bb6e19b --- /dev/null +++ b/latex_mk/test/toc_pdfbookmarks/0.txt @@ -0,0 +1,35 @@ +`toc_pdfbookmarks.tex.5th' -> `toc_pdfbookmarks.tex' +toc_pdfbookmarks.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=toc_pdfbookmarks.out toc_pdfbookmarks.toc GRAPHICFILES= BIBDB= +toc_pdfbookmarks.d is generated by scanning toc_pdfbookmarks.tex and toc_pdfbookmarks.fls. +---------- toc_pdfbookmarks_1.pdf: rebase ---------- +platex -interaction=batchmode toc_pdfbookmarks.tex +`toc_pdfbookmarks.out' -> `toc_pdfbookmarks.out_prev' +`toc_pdfbookmarks.toc' -> `toc_pdfbookmarks.toc_prev' +platex -interaction=batchmode toc_pdfbookmarks.tex +dvipdfmx toc_pdfbookmarks.dvi +`toc_pdfbookmarks.pdf' -> `toc_pdfbookmarks_1.pdf' +-------------------- +patching file toc_pdfbookmarks.tex +---------- toc_pdfbookmarks_2.pdf: add ---------- +toc_pdfbookmarks.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=toc_pdfbookmarks.out toc_pdfbookmarks.toc GRAPHICFILES= BIBDB= +toc_pdfbookmarks.d is generated by scanning toc_pdfbookmarks.tex and toc_pdfbookmarks.fls. +platex -interaction=batchmode toc_pdfbookmarks.tex +toc_pdfbookmarks.out_prev is up to date. +toc_pdfbookmarks.toc_prev is up to date. +dvipdfmx toc_pdfbookmarks.dvi +`toc_pdfbookmarks.pdf' -> `toc_pdfbookmarks_2.pdf' +-------------------- +`toc_pdfbookmarks.tex.5th' -> `toc_pdfbookmarks.tex' +patching file toc_pdfbookmarks.tex +---------- toc_pdfbookmarks_3.pdf: update ---------- +toc_pdfbookmarks.fls is generated. +Makefiles variable -- TEXFILES= LATEXINTFILES=toc_pdfbookmarks.out toc_pdfbookmarks.toc GRAPHICFILES= BIBDB= +toc_pdfbookmarks.d is generated by scanning toc_pdfbookmarks.tex and toc_pdfbookmarks.fls. +platex -interaction=batchmode toc_pdfbookmarks.tex +`toc_pdfbookmarks.out' -> `toc_pdfbookmarks.out_prev' +`toc_pdfbookmarks.toc' -> `toc_pdfbookmarks.toc_prev' +platex -interaction=batchmode toc_pdfbookmarks.tex +dvipdfmx toc_pdfbookmarks.dvi +`toc_pdfbookmarks.pdf' -> `toc_pdfbookmarks_3.pdf' diff --git a/latex_mk/test/toc_pdfbookmarks/Makefile b/latex_mk/test/toc_pdfbookmarks/Makefile new file mode 100644 index 0000000..b6dac59 --- /dev/null +++ b/latex_mk/test/toc_pdfbookmarks/Makefile @@ -0,0 +1,2 @@ +include ../Define.mk +include ../Test.mk diff --git a/latex_mk/test/toc_pdfbookmarks/cmd b/latex_mk/test/toc_pdfbookmarks/cmd new file mode 100755 index 0000000..6683420 --- /dev/null +++ b/latex_mk/test/toc_pdfbookmarks/cmd @@ -0,0 +1 @@ +cd ../../sample/toc_pdfbookmarks && make -s distclean && make -s all diff --git a/latex_mk/test/toc_pdfbookmarks/desc.txt b/latex_mk/test/toc_pdfbookmarks/desc.txt new file mode 120000 index 0000000..8bc10b9 --- /dev/null +++ b/latex_mk/test/toc_pdfbookmarks/desc.txt @@ -0,0 +1 @@ +../../sample/toc_pdfbookmarks/desc.txt \ No newline at end of file -- 2.18.0