[Xfce4-commits] [panel-plugins/xfce4-calculator-plugin] 03/08: Bug 12548: Move test scripts to tests subdirectory.

noreply at xfce.org noreply at xfce.org
Mon Jun 20 22:27:47 CEST 2016


This is an automated email from the git hooks/post-receive script.

roland pushed a commit to branch master
in repository panel-plugins/xfce4-calculator-plugin.

commit 011113c232e904a9d5f2822601ee014f3981d3a2
Author: Roland Kuebert <roland.kuebert at gmail.com>
Date:   Mon Jun 20 22:13:12 2016 +0200

    Bug 12548: Move test scripts to tests subdirectory.
    
    Thanks to Wim Hueskes <xfce at wimhueskes.eu>.
---
 .gitignore                                   |  3 +++
 Makefile.am                                  |  1 +
 configure.in.in                              |  1 +
 panel-plugin/Makefile.am                     |  6 ------
 panel-plugin/calctest.c                      |  2 +-
 tests/Makefile.am                            | 11 +++++++++++
 {panel-plugin => tests}/test-func.awk        |  2 +-
 {panel-plugin => tests}/test-minus.awk       |  2 +-
 {panel-plugin => tests}/test-pow.awk         |  2 +-
 {panel-plugin => tests}/test-simple-expr.awk |  2 +-
 10 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/.gitignore b/.gitignore
index 3fb3a10..98fc332 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,3 +35,6 @@ po/POTFILES
 po/stamp-it
 stamp-h1
 test-driver
+panel-plugin/calctest
+tests/*.log
+tests/*.trs
diff --git a/Makefile.am b/Makefile.am
index 7a244fb..a04b36a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,7 @@
 SUBDIRS =								\
 	icons								\
 	panel-plugin 							\
+	tests								\
 	po
 
 distclean-local:
diff --git a/configure.in.in b/configure.in.in
index d2d0efe..15da0a4 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -93,6 +93,7 @@ AC_SUBST([PLATFORM_LDFLAGS])
 AC_OUTPUT([
 Makefile
 panel-plugin/Makefile
+tests/Makefile
 po/Makefile.in
 icons/Makefile
 icons/16x16/Makefile
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 3865199..09db5dc 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -66,16 +66,10 @@ desktop_DATA =								\
 
 EXTRA_DIST =								\
 	$(desktop_in_in_files)						\
-	$(TESTS)							\
 	grammar.txt
 
 CLEANFILES =								\
 	$(desktop_in_files)						\
 	$(desktop_DATA)
 
-TESTS = 								\
-	test-simple-expr.awk						\
-	test-minus.awk							\
-	test-pow.awk
-
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/panel-plugin/calctest.c b/panel-plugin/calctest.c
index 0871201..f0518fd 100644
--- a/panel-plugin/calctest.c
+++ b/panel-plugin/calctest.c
@@ -51,7 +51,7 @@ void calc(const char *input, char *result, size_t result_len)
         g_error_free(err);
     } else if (parsetree) {
         r = eval_parse_tree(parsetree, FALSE);
-        snprintf(result, result_len, "%g\n", r);
+        snprintf(result, result_len, "%.19g\n", r);
     } else
         snprintf(result, result_len, "böö\n");
     free_parsetree(parsetree);
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..0c3bd33
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,11 @@
+# $Id$
+
+EXTRA_DIST =								\
+	$(TESTS)
+
+TESTS = 								\
+	test-simple-expr.awk						\
+	test-minus.awk							\
+	test-pow.awk
+
+# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/panel-plugin/test-func.awk b/tests/test-func.awk
similarity index 87%
rename from panel-plugin/test-func.awk
rename to tests/test-func.awk
index 8314dd6..89f6424 100755
--- a/panel-plugin/test-func.awk
+++ b/tests/test-func.awk
@@ -6,7 +6,7 @@ function abs(x) {
 
 BEGIN{
     expr = "'sqrt(1) + log(1) + ln(1) + exp(1) + sin(1) + cos(1) + tan(1) + asin(1) + arcsin(1) + acos(1) + arccos(1) + atan(1) + arctan(1) + log2(1) + log10(1) + lg(1) + abs(1) + cbrt(1)'"
-    "./calctest " expr | getline res
+    "../panel-plugin/calctest " expr | getline res
     if (abs(res - 3.0) > 1.0e-15) {
         print res
         exit 1
diff --git a/panel-plugin/test-minus.awk b/tests/test-minus.awk
similarity index 74%
rename from panel-plugin/test-minus.awk
rename to tests/test-minus.awk
index f2dd8b6..3becc3a 100755
--- a/panel-plugin/test-minus.awk
+++ b/tests/test-minus.awk
@@ -5,7 +5,7 @@ function abs(x) {
 }
 
 BEGIN{
-    "./calctest '10 - 4 - 3'" | getline res
+    "../panel-plugin/calctest '10 - 4 - 3'" | getline res
     if (abs(res - 3.0) > 1.0e-15) {
         print res
         exit 1
diff --git a/panel-plugin/test-pow.awk b/tests/test-pow.awk
similarity index 76%
rename from panel-plugin/test-pow.awk
rename to tests/test-pow.awk
index 3ba7445..34deebf 100755
--- a/panel-plugin/test-pow.awk
+++ b/tests/test-pow.awk
@@ -5,7 +5,7 @@ function abs(x) {
 }
 
 BEGIN{
-    "./calctest '4^3**2'" | getline res
+    "../panel-plugin/calctest '4^3**2'" | getline res
     if (abs(res - 4096) > 1.0e-15) {
         print res
         exit 1
diff --git a/panel-plugin/test-simple-expr.awk b/tests/test-simple-expr.awk
similarity index 75%
rename from panel-plugin/test-simple-expr.awk
rename to tests/test-simple-expr.awk
index cc743ff..0f5a1bf 100755
--- a/panel-plugin/test-simple-expr.awk
+++ b/tests/test-simple-expr.awk
@@ -5,7 +5,7 @@ function abs(x) {
 }
 
 BEGIN{
-    "./calctest '4.5 + 7/2'" | getline res
+    "../panel-plugin/calctest '4.5 + 7/2'" | getline res
     if (abs(res - 8.0) > 1.0e-15) {
         print res
         exit 1

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list