Ajout tests de régression
authorHugo Villeneuve <hugo@hugovil.com>
Thu, 5 May 2022 21:14:29 +0000 (17:14 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Fri, 6 May 2022 03:02:13 +0000 (23:02 -0400)
tests/Makefile [new file with mode: 0644]
tests/accords.cp [new file with mode: 0644]
tests/regression.gtx [new file with mode: 0644]

diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644 (file)
index 0000000..6dc99e0
--- /dev/null
@@ -0,0 +1,104 @@
+#*******************************************************************************
+#* Makefile pour cahier de chansons format ChordPro
+#*******************************************************************************
+
+# All variables will be exported by default to sub-makes
+export
+
+TEXINPUTS := .:/usr/local/lib/guitartex/gchords:${TEXINPUTS}
+
+SOURCES := regression
+
+#*******************************************************************************
+#* Directories and include paths
+#*******************************************************************************
+
+# Specifying only the suffixes actually used in this Makefile
+.SUFFIXES:
+.SUFFIXES: .tex .log .aux .dvi .bib
+
+.PHONY: all print pdf clean
+
+# The targets which .SECONDARY depends on are treated as intermediate files, except that they
+# are never automatically deleted.
+.SECONDARY: $(patsubst %,%.dvi,$(SOURCES)) $(patsubst %,%.tex,$(SOURCES))
+
+#*******************************************************************************
+#* Executable programs
+#*******************************************************************************
+SHELL     := /bin/sh
+LATEX     := /usr/bin/latex
+PDFLATEX  := /usr/bin/pdflatex
+DVIPS     := /usr/bin/dvips
+PS2PDF    := ps2pdf13
+SED       := /bin/sed
+GTX2TEX   := gtx2tex --verbose --bold
+
+#*******************************************************************************
+#* Include paths
+#*******************************************************************************
+
+#*******************************************************************************
+#* Main goal
+#*******************************************************************************
+all: $(patsubst %,%.pdf,$(SOURCES))
+
+ps:  $(patsubst %,%.ps,$(SOURCES))
+
+pdf: $(patsubst %,%.pdf,$(SOURCES))
+
+#*******************************************************************************
+#* Definitions of implicit rules by means of pattern rules
+#*******************************************************************************
+%.ps: %.dvi Makefile
+       @echo Generating Postscript from $(notdir $<)
+       @$(DVIPS) -o $@ $<
+
+%.pdf: %.tex Makefile
+       @echo Processing LaTeX file $(notdir $<)
+       @$(PDFLATEX) $*
+
+%.dvi: %.tex Makefile
+       @echo Processing LaTeX file $(notdir $<)
+       @$(LATEX) $*
+
+%.tex: %.gtx *.cp Makefile
+       @echo Processing GuitarTex file $(notdir $<)
+       @$(GTX2TEX) $<
+
+# If you do not want an implicit rule to be used for a target that has no commands, you can
+# give that target empty commands by writing a semicolon.
+
+Makefile: ;
+%.tex: ;
+
+
+#*******************************************************************************
+#* Cleaning rules
+#*******************************************************************************
+clean:
+       @echo "Cleaning..."
+       @rm -rf *~
+       @rm -rf *.log
+       @rm -rf *.dvi
+       @rm -rf *.ps
+       @rm -rf *.pdf
+       @rm -rf *.out
+       @rm -rf *.aux
+       @rm -rf *.toc
+       @rm -rf *.lot
+       @rm -rf *.lof
+       @rm -rf *.bbl
+       @rm -rf *.blg
+       @rm -rf *.glo
+       @rm -rf *.gls
+       @rm -rf *.ilg
+       @rm -rf *.idx
+       @rm -rf *.ind
+       @rm -rf *.capot-*.cp
+       @rm -rf *.transpose-*.cp
+       @for i in $(SOURCES); do \
+         if [ -f $$i.tex ]; then \
+           rm $$i.tex || exit 1; \
+          fi; \
+       done
diff --git a/tests/accords.cp b/tests/accords.cp
new file mode 100644 (file)
index 0000000..a3de57c
--- /dev/null
@@ -0,0 +1,42 @@
+{even}
+{title:Tests de régression}
+{subtitle:guitartex}
+{size:large}
+
+[Ab]Ab, [Abm]Abm, [Ab7]Ab7, [Abmaj7]AbMaj7, [A#]A#, [A#m]A#m, [A#m/Bb]A#m/Bb, [A#maj7]A#Maj7, [Amaj7/Fb]Amaj7/Fb
+
+[A6]A majeur 6
+
+[Ab13]Ab13, [Ab13/Bb]Ab13/Bb, [Abm13/Bb]Abm13/Bb, [Cm13]Cm13
+
+[A7/Bb]A7/Bb, [A7/C#]A7/C#, [A6]A6, [A6/Bb]A6/Bb [A9/Bb]A9/Bb
+
+[Adim]Adim, [Adim/Bb]Adim/Bb, [Adim/C#]Adim/C#, [Adim7/C#]Adim7/C#
+
+Phrase avec 'dim' et 'sus' et 'add' en majuscule
+
+[Asus4]Accord [Asus4]suspendu [Asus4]4e
+
+[Asus4/C#]Accord [Asus4/C#]suspendu [Asus4/C#]4e avec note basse
+
+[Dm7b5]Accord [Dm7b5/Bb]demi-    diminué[Dm7b5/C#] (half-diminished)
+
+[Dmb5]Accord [Dmb5/Bb]diminué [Dmb5/C#](diminished)
+[A7b5]Accord [A7b5/Bb]7e [A7b5/C#]bémol 5
+{np}
+
+[A7sus4]Accord... [A7sus4/Bb]7e ................ [A7sus4/C#]sus4.............. [A9sus4]Accord 9e sus4
+
+[A7add9]A7add9, [A7add9/Bb]A7add9/Bb, [A7add9/C#]A7add9/C#
+
+[G9b]G9b, [A7b]A7b
+
+[C7b9#11]C7b9#11
+
+[F5+]F5+, [F9+]F9+, [Fm9+]Fm9+
+
+[Csus4sus2]
+
+[Dm7#5/C#]
+
+[E7#5]
diff --git a/tests/regression.gtx b/tests/regression.gtx
new file mode 100644 (file)
index 0000000..c431caf
--- /dev/null
@@ -0,0 +1,15 @@
+{document_class:article}
+
+{geometry:letterpaper}
+%% right = pages paires (gauche)
+{geometry:right=0.5cm}
+%% left  = pages impaires (droite)
+{geometry:left=1.6cm}
+{geometry:top=1.2cm}
+{geometry:bottom=1.0cm}
+
+{geometry:headsep=0.3cm}
+
+{font_size:12}
+
+{include:accords.cp}