You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by de...@apache.org on 2016/01/29 19:12:36 UTC
incubator-systemml git commit: [SYSTEMML-370] Moved functions.terms
tests to functions.misc
Repository: incubator-systemml
Updated Branches:
refs/heads/master 5956a6125 -> 1f685e90b
[SYSTEMML-370] Moved functions.terms tests to functions.misc
Closes #55.
Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/1f685e90
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/1f685e90
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/1f685e90
Branch: refs/heads/master
Commit: 1f685e90bceedc6c58643d649fc214a7d3143750
Parents: 5956a61
Author: Glenn Weidner <gw...@us.ibm.com>
Authored: Fri Jan 29 10:07:07 2016 -0800
Committer: Deron Eriksson <de...@us.ibm.com>
Committed: Fri Jan 29 10:07:07 2016 -0800
----------------------------------------------------------------------
.../misc/ScalarMatrixUnaryBinaryTermTest.java | 66 ++++++++++++++++++++
.../misc/ScalarToMatrixInLoopTest.java | 51 +++++++++++++++
.../terms/ScalarMatrixUnaryBinaryTermTest.java | 66 --------------------
.../terms/ScalarToMatrixInLoopTest.java | 51 ---------------
.../functions/misc/TestScalarToMatrixInLoop.dml | 34 ++++++++++
src/test/scripts/functions/misc/TestTerm1.dml | 30 +++++++++
.../terms/TestScalarToMatrixInLoop.dml | 34 ----------
src/test/scripts/functions/terms/TestTerm1.dml | 30 ---------
.../functions/misc/ZPackageSuite.java | 2 +
.../functions/terms/ZPackageSuite.java | 37 -----------
10 files changed, 183 insertions(+), 218 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1f685e90/src/test/java/org/apache/sysml/test/integration/functions/misc/ScalarMatrixUnaryBinaryTermTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/sysml/test/integration/functions/misc/ScalarMatrixUnaryBinaryTermTest.java b/src/test/java/org/apache/sysml/test/integration/functions/misc/ScalarMatrixUnaryBinaryTermTest.java
new file mode 100644
index 0000000..eb4758c
--- /dev/null
+++ b/src/test/java/org/apache/sysml/test/integration/functions/misc/ScalarMatrixUnaryBinaryTermTest.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sysml.test.integration.functions.misc;
+
+import org.junit.Test;
+
+import org.apache.sysml.test.integration.AutomatedTestBase;
+import org.apache.sysml.test.integration.TestConfiguration;
+import org.apache.sysml.test.utils.TestUtils;
+
+
+public class ScalarMatrixUnaryBinaryTermTest extends AutomatedTestBase
+{
+ private static final String TEST_DIR = "functions/misc/";
+ private static final String TEST_CLASS_DIR = TEST_DIR + ScalarMatrixUnaryBinaryTermTest.class.getSimpleName() + "/";
+ private static final String TEST_NAME = "TestTerm1";
+
+ @Override
+ public void setUp() {
+ addTestConfiguration(TEST_NAME, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME, new String[] {}));
+ }
+
+ @Test
+ public void testTerm1() {
+ int rows = 5, cols = 5;
+
+ TestConfiguration config = getTestConfiguration(TEST_NAME);
+ config.addVariable("rows", rows);
+ config.addVariable("cols", cols);
+
+ loadTestConfiguration(config);
+
+ double[][] a = createNonRandomMatrixValues(rows, cols);
+ writeInputMatrix("a", a);
+
+ double[][] w = new double[rows][cols];
+ for (int i = 0; i < rows; i++) {
+ for (int j = 0; j < cols; j++) {
+ w[i][j] = 1 + a[i][j];
+ }
+ }
+ w = TestUtils.performMatrixMultiplication(w, w);
+ writeExpectedMatrix("w", w);
+
+ runTest();
+
+ compareResults();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1f685e90/src/test/java/org/apache/sysml/test/integration/functions/misc/ScalarToMatrixInLoopTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/sysml/test/integration/functions/misc/ScalarToMatrixInLoopTest.java b/src/test/java/org/apache/sysml/test/integration/functions/misc/ScalarToMatrixInLoopTest.java
new file mode 100644
index 0000000..6df8a01
--- /dev/null
+++ b/src/test/java/org/apache/sysml/test/integration/functions/misc/ScalarToMatrixInLoopTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sysml.test.integration.functions.misc;
+
+import org.junit.Test;
+
+import org.apache.sysml.test.integration.AutomatedTestBase;
+import org.apache.sysml.test.integration.TestConfiguration;
+
+
+public class ScalarToMatrixInLoopTest extends AutomatedTestBase
+{
+ private static final String TEST_DIR = "functions/misc/";
+ private static final String TEST_CLASS_DIR = TEST_DIR + ScalarToMatrixInLoopTest.class.getSimpleName() + "/";
+ private static final String TEST_NAME = "ScalarToMatrixInLoop";
+
+ @Override
+ public void setUp() {
+ addTestConfiguration(TEST_NAME, new TestConfiguration(TEST_CLASS_DIR, "TestScalarToMatrixInLoop", new String[] {}));
+ }
+
+ @Test
+ public void testScalarToMatrixInLoop() {
+ int rows = 5, cols = 5;
+
+ TestConfiguration config = getTestConfiguration(TEST_NAME);
+ config.addVariable("rows", rows);
+ config.addVariable("cols", cols);
+
+ loadTestConfiguration(config);
+
+ runTest();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1f685e90/src/test/java/org/apache/sysml/test/integration/functions/terms/ScalarMatrixUnaryBinaryTermTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/sysml/test/integration/functions/terms/ScalarMatrixUnaryBinaryTermTest.java b/src/test/java/org/apache/sysml/test/integration/functions/terms/ScalarMatrixUnaryBinaryTermTest.java
deleted file mode 100644
index d6efe26..0000000
--- a/src/test/java/org/apache/sysml/test/integration/functions/terms/ScalarMatrixUnaryBinaryTermTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.sysml.test.integration.functions.terms;
-
-import org.junit.Test;
-
-import org.apache.sysml.test.integration.AutomatedTestBase;
-import org.apache.sysml.test.integration.TestConfiguration;
-import org.apache.sysml.test.utils.TestUtils;
-
-
-public class ScalarMatrixUnaryBinaryTermTest extends AutomatedTestBase
-{
- private static final String TEST_DIR = "functions/terms/";
- private static final String TEST_CLASS_DIR = TEST_DIR + ScalarMatrixUnaryBinaryTermTest.class.getSimpleName() + "/";
- private static final String TEST_NAME = "TestTerm1";
-
- @Override
- public void setUp() {
- addTestConfiguration(TEST_NAME, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME, new String[] {}));
- }
-
- @Test
- public void testTerm1() {
- int rows = 5, cols = 5;
-
- TestConfiguration config = getTestConfiguration(TEST_NAME);
- config.addVariable("rows", rows);
- config.addVariable("cols", cols);
-
- loadTestConfiguration(config);
-
- double[][] a = createNonRandomMatrixValues(rows, cols);
- writeInputMatrix("a", a);
-
- double[][] w = new double[rows][cols];
- for (int i = 0; i < rows; i++) {
- for (int j = 0; j < cols; j++) {
- w[i][j] = 1 + a[i][j];
- }
- }
- w = TestUtils.performMatrixMultiplication(w, w);
- writeExpectedMatrix("w", w);
-
- runTest();
-
- compareResults();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1f685e90/src/test/java/org/apache/sysml/test/integration/functions/terms/ScalarToMatrixInLoopTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/sysml/test/integration/functions/terms/ScalarToMatrixInLoopTest.java b/src/test/java/org/apache/sysml/test/integration/functions/terms/ScalarToMatrixInLoopTest.java
deleted file mode 100644
index 824f726..0000000
--- a/src/test/java/org/apache/sysml/test/integration/functions/terms/ScalarToMatrixInLoopTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.sysml.test.integration.functions.terms;
-
-import org.junit.Test;
-
-import org.apache.sysml.test.integration.AutomatedTestBase;
-import org.apache.sysml.test.integration.TestConfiguration;
-
-
-public class ScalarToMatrixInLoopTest extends AutomatedTestBase
-{
- private static final String TEST_DIR = "functions/terms/";
- private static final String TEST_CLASS_DIR = TEST_DIR + ScalarToMatrixInLoopTest.class.getSimpleName() + "/";
- private static final String TEST_NAME = "ScalarToMatrixInLoop";
-
- @Override
- public void setUp() {
- addTestConfiguration(TEST_NAME, new TestConfiguration(TEST_CLASS_DIR, "TestScalarToMatrixInLoop", new String[] {}));
- }
-
- @Test
- public void testScalarToMatrixInLoop() {
- int rows = 5, cols = 5;
-
- TestConfiguration config = getTestConfiguration(TEST_NAME);
- config.addVariable("rows", rows);
- config.addVariable("cols", cols);
-
- loadTestConfiguration(config);
-
- runTest();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1f685e90/src/test/scripts/functions/misc/TestScalarToMatrixInLoop.dml
----------------------------------------------------------------------
diff --git a/src/test/scripts/functions/misc/TestScalarToMatrixInLoop.dml b/src/test/scripts/functions/misc/TestScalarToMatrixInLoop.dml
new file mode 100644
index 0000000..6b52283
--- /dev/null
+++ b/src/test/scripts/functions/misc/TestScalarToMatrixInLoop.dml
@@ -0,0 +1,34 @@
+#-------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+# junit test class: org.apache.sysml.test.integration.functions.misc.ScalarToMatrixInLoop.java
+
+A = Rand(cols=$$cols$$, rows=$$rows$$);
+W = 5;
+i = 0;
+W = A + W; #otherwise rejected because loop has conditional type change.
+while( i < 1)
+{
+ W = A + W;
+ i = i + 1;
+}
+
+write(W, "$$outdir$$w", format="text");
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1f685e90/src/test/scripts/functions/misc/TestTerm1.dml
----------------------------------------------------------------------
diff --git a/src/test/scripts/functions/misc/TestTerm1.dml b/src/test/scripts/functions/misc/TestTerm1.dml
new file mode 100644
index 0000000..3b26426
--- /dev/null
+++ b/src/test/scripts/functions/misc/TestTerm1.dml
@@ -0,0 +1,30 @@
+#-------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+# junit test class: org.apache.sysml.test.integration.functions.misc.ScalarMatrixUnaryBinaryTest.java
+
+A = read("$$indir$$a", rows=$$rows$$, cols=$$cols$$, format="text");
+
+W = 1;
+W = W + A;
+W = W + W;
+
+write(W, "$$outdir$$w", format="text");
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1f685e90/src/test/scripts/functions/terms/TestScalarToMatrixInLoop.dml
----------------------------------------------------------------------
diff --git a/src/test/scripts/functions/terms/TestScalarToMatrixInLoop.dml b/src/test/scripts/functions/terms/TestScalarToMatrixInLoop.dml
deleted file mode 100644
index 303ae50..0000000
--- a/src/test/scripts/functions/terms/TestScalarToMatrixInLoop.dml
+++ /dev/null
@@ -1,34 +0,0 @@
-#-------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#-------------------------------------------------------------
-
-# junit test class: org.apache.sysml.test.integration.functions.terms.ScalarToMatrixInLoop.java
-
-A = Rand(cols=$$cols$$, rows=$$rows$$);
-W = 5;
-i = 0;
-W = A + W; #otherwise rejected because loop has conditional type change.
-while( i < 1)
-{
- W = A + W;
- i = i + 1;
-}
-
-write(W, "$$outdir$$w", format="text");
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1f685e90/src/test/scripts/functions/terms/TestTerm1.dml
----------------------------------------------------------------------
diff --git a/src/test/scripts/functions/terms/TestTerm1.dml b/src/test/scripts/functions/terms/TestTerm1.dml
deleted file mode 100644
index c5daaf2..0000000
--- a/src/test/scripts/functions/terms/TestTerm1.dml
+++ /dev/null
@@ -1,30 +0,0 @@
-#-------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#-------------------------------------------------------------
-
-# junit test class: org.apache.sysml.test.integration.functions.terms.ScalarMatrixUnaryBinaryTest.java
-
-A = read("$$indir$$a", rows=$$rows$$, cols=$$cols$$, format="text");
-
-W = 1;
-W = W + A;
-W = W + W;
-
-write(W, "$$outdir$$w", format="text");
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1f685e90/src/test_suites/java/org/apache/sysml/test/integration/functions/misc/ZPackageSuite.java
----------------------------------------------------------------------
diff --git a/src/test_suites/java/org/apache/sysml/test/integration/functions/misc/ZPackageSuite.java b/src/test_suites/java/org/apache/sysml/test/integration/functions/misc/ZPackageSuite.java
index 81068d4..453ba5f 100644
--- a/src/test_suites/java/org/apache/sysml/test/integration/functions/misc/ZPackageSuite.java
+++ b/src/test_suites/java/org/apache/sysml/test/integration/functions/misc/ZPackageSuite.java
@@ -45,6 +45,8 @@ import org.junit.runners.Suite;
RewriteSlicedMatrixMultTest.class,
ScalarAssignmentTest.class,
ScalarFunctionTest.class,
+ ScalarMatrixUnaryBinaryTermTest.class,
+ ScalarToMatrixInLoopTest.class,
SetWorkingDirTest.class,
ValueTypeAutoCastingTest.class,
ValueTypeCastingTest.class
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1f685e90/src/test_suites/java/org/apache/sysml/test/integration/functions/terms/ZPackageSuite.java
----------------------------------------------------------------------
diff --git a/src/test_suites/java/org/apache/sysml/test/integration/functions/terms/ZPackageSuite.java b/src/test_suites/java/org/apache/sysml/test/integration/functions/terms/ZPackageSuite.java
deleted file mode 100644
index 06bef2e..0000000
--- a/src/test_suites/java/org/apache/sysml/test/integration/functions/terms/ZPackageSuite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.sysml.test.integration.functions.terms;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/** Group together the tests in this package into a single suite so that the Maven build
- * won't run two of them at once. */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ScalarMatrixUnaryBinaryTermTest.class,
- ScalarToMatrixInLoopTest.class
-})
-
-
-/** This class is just a holder for the above JUnit annotations. */
-public class ZPackageSuite {
-
-}