From 0ae0ace516579c20781664fe5924d70070095ec4 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (l)" <j.wuttke@fz-juelich.de>
Date: Sat, 31 Oct 2015 14:19:06 +0100
Subject: [PATCH] add first performance tests (fits to large data sets)

---
 pub/CMakeLists.txt       |  1 +
 pub/ftest/fit1.f2t       |  6 +++---
 pub/ptest/CMakeLists.txt | 18 ++++++++++++++++++
 pub/ptest/fit1.f2t       |  7 +++++++
 pub/ptest/fit2.f2t       |  7 +++++++
 5 files changed, 36 insertions(+), 3 deletions(-)
 create mode 100644 pub/ptest/CMakeLists.txt
 create mode 100755 pub/ptest/fit1.f2t
 create mode 100755 pub/ptest/fit2.f2t

diff --git a/pub/CMakeLists.txt b/pub/CMakeLists.txt
index 3bde8633..ad0aaa6b 100644
--- a/pub/CMakeLists.txt
+++ b/pub/CMakeLists.txt
@@ -44,3 +44,4 @@ add_subdirectory(share)
 add_subdirectory(man)
 add_subdirectory(utest)
 add_subdirectory(ftest)
+add_subdirectory(ptest)
diff --git a/pub/ftest/fit1.f2t b/pub/ftest/fit1.f2t
index f160c8a4..79eefcd6 100755
--- a/pub/ftest/fit1.f2t
+++ b/pub/ftest/fit1.f2t
@@ -1,7 +1,7 @@
 #!/usr/bin/env frida
-fm 31 3 h
-oy 100*(j+x^1.1)
+fm 310 17 h
+oy 100*(j+x^1.7)
 ody! sqrt(1+y)
-cc p0+p1*t
+cc p0+p1*t+p2*t^2+p3*t^3
 cf
 exit(0)
diff --git a/pub/ptest/CMakeLists.txt b/pub/ptest/CMakeLists.txt
new file mode 100644
index 00000000..524405cb
--- /dev/null
+++ b/pub/ptest/CMakeLists.txt
@@ -0,0 +1,18 @@
+# To run the tests on Linux, use 'make test' or 'ctest'.
+# To select which tests to run, use 'ctest -R regex'.
+# To see output from the individual tests, use 'ctest -V'.
+# For more options, run 'ctest --help'.
+
+enable_testing()
+
+# We glob test sources, though this is often considered evil.
+# Just touch CMakeLists.txt each time a test is added or withdrawn.
+
+file(GLOB test_sources "*.f2t")
+
+foreach(test_src ${test_sources})
+    # remove directory path and suffix, to retain just the name of the test
+    string(REGEX REPLACE ".*/" "" test_name "${test_src}")
+    string(REGEX REPLACE ".f2t$" "" test_name "${test_name}")
+    add_test(NAME ${test_name} COMMAND "${test_src}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+endforeach(test_src)
diff --git a/pub/ptest/fit1.f2t b/pub/ptest/fit1.f2t
new file mode 100755
index 00000000..e6fb6636
--- /dev/null
+++ b/pub/ptest/fit1.f2t
@@ -0,0 +1,7 @@
+#!/usr/bin/env frida
+fm 3100 71 h
+oy 100*(j+x^1.7)
+ody! sqrt(1+y)
+cc p0+p1*t+p2*t^2+p3*t^3
+cf
+exit(0)
diff --git a/pub/ptest/fit2.f2t b/pub/ptest/fit2.f2t
new file mode 100755
index 00000000..45c2ebce
--- /dev/null
+++ b/pub/ptest/fit2.f2t
@@ -0,0 +1,7 @@
+#!/usr/bin/env frida
+fm 310 710 h
+oy 100*(j+x^1.7)
+ody! sqrt(1+y)
+cc p0+p1*t+p2*t^2+p3*t^3
+cf
+exit(0)
-- 
GitLab