You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2018/03/15 17:19:41 UTC
[trafficserver] branch master updated: Framework for CPPAPI
regression test plugin run by a gold test.
This is an automated email from the ASF dual-hosted git repository.
amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 2af8d35 Framework for CPPAPI regression test plugin run by a gold test.
2af8d35 is described below
commit 2af8d354e2565f8241a40112f843f6d7634c296f
Author: Walt Karas <wk...@yahoo-inc.com>
AuthorDate: Tue Mar 6 23:02:18 2018 +0000
Framework for CPPAPI regression test plugin run by a gold test.
---
plugins/Makefile.am | 1 +
plugins/test_cppapi/Makefile.inc | 18 +++++++++
plugins/test_cppapi/test_cppapi.cc | 45 +++++++++++++++++++++++
tests/gold_tests/pluginTest/cppapi/cppapi.test.py | 29 +++++++++++++++
4 files changed, 93 insertions(+)
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index f7046fd..3e12147 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -42,6 +42,7 @@ include s3_auth/Makefile.inc
include stats_over_http/Makefile.inc
include tcpinfo/Makefile.inc
include xdebug/Makefile.inc
+include test_cppapi/Makefile.inc
if BUILD_EXPERIMENTAL_PLUGINS
diff --git a/plugins/test_cppapi/Makefile.inc b/plugins/test_cppapi/Makefile.inc
new file mode 100644
index 0000000..d1a7c97
--- /dev/null
+++ b/plugins/test_cppapi/Makefile.inc
@@ -0,0 +1,18 @@
+# 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.
+
+pkglib_LTLIBRARIES += test_cppapi/test_cppapi.la
+test_cppapi_test_cppapi_la_SOURCES = test_cppapi/test_cppapi.cc
diff --git a/plugins/test_cppapi/test_cppapi.cc b/plugins/test_cppapi/test_cppapi.cc
new file mode 100644
index 0000000..a2c782f
--- /dev/null
+++ b/plugins/test_cppapi/test_cppapi.cc
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+#include "ts/ts.h"
+
+// Placeholder test.
+//
+namespace Test1
+{
+void
+x()
+{
+ TSReleaseAssert(true);
+}
+
+} // end namespace Test1;
+
+void
+TSPluginInit(int, const char **)
+{
+ TSPluginRegistrationInfo info;
+
+ info.plugin_name = "test_cppapi";
+ info.vendor_name = "Apache Software Foundation";
+ info.support_email = "dev@trafficserver.apache.org";
+
+ TSReleaseAssert(TSPluginRegister(&info) == TS_SUCCESS);
+
+ Test1::x();
+}
diff --git a/tests/gold_tests/pluginTest/cppapi/cppapi.test.py b/tests/gold_tests/pluginTest/cppapi/cppapi.test.py
new file mode 100644
index 0000000..1f4f0c3
--- /dev/null
+++ b/tests/gold_tests/pluginTest/cppapi/cppapi.test.py
@@ -0,0 +1,29 @@
+# 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.
+
+Test.Summary = '''
+Execute plugin with cppapi tests.
+'''
+
+ts = Test.MakeATSProcess("ts")
+
+ts.Disk.plugin_config.AddLine('test_cppapi.so')
+
+tr = Test.AddTestRun()
+tr.Processes.Default.StartBefore(Test.Processes.ts)
+tr.Processes.Default.Command = "echo run test_cppapi plugin"
+tr.Processes.Default.ReturnCode = 0
+tr.Processes.StillRunningAfter = ts
--
To stop receiving notification emails like this one, please contact
amc@apache.org.