aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/duktape/files/run-ptest
diff options
context:
space:
mode:
authorNikhil R <nikhil.r@kpit.com>2022-05-25 17:05:54 +0530
committerKhem Raj <raj.khem@gmail.com>2022-05-26 18:54:39 -0700
commit3277a81937bee01437a7ca8634e0f056e318f21b (patch)
treea7ef9762704d529c92881b64340cc59c0bfb1edd /meta-oe/recipes-extended/duktape/files/run-ptest
parentdda4a40fcfdf2bcd8f95c49a2741f2e1df8f0102 (diff)
downloadmeta-openembedded-contrib-3277a81937bee01437a7ca8634e0f056e318f21b.tar.gz
duktape: Add ptest
The Ptest for duktape executes below tests: 1. hello - a helloworld example is basic compilation test that test the APIs - duk_get_top(), duk_push_c_function(), duk_eval_string() 2. eval - a very simple for evaluating expressions from command line which test the APIs - duk_push_string(), duk_insert(), duk_join(), duk_pop() 3. evloop - a basic eventloop implementation test that test the APIs - duk_is_object(), duk_compile() duk_push_c_function(), duk_safe_call() Test Summary: Execution time = 46 sec Signed-off-by: Nikhil R <nikhil.r@kpit.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended/duktape/files/run-ptest')
-rw-r--r--meta-oe/recipes-extended/duktape/files/run-ptest32
1 files changed, 32 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/duktape/files/run-ptest b/meta-oe/recipes-extended/duktape/files/run-ptest
new file mode 100644
index 0000000000..852fb15de4
--- /dev/null
+++ b/meta-oe/recipes-extended/duktape/files/run-ptest
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+./hello &> $test.output 2>&1
+out="Hello world!"
+
+if grep -i "$out" $test.output 2>&1 ; then
+ echo "PASS: Hello duktape"
+else
+ echo "FAIL: Hello duktape"
+fi
+rm -f $test.output
+
+./eval "print('Hello world!'); 123;" > out.log
+
+sed -n '2p' out.log > eval.log
+sed -n '3p' out.log >> eval.log
+
+if grep -w 'Hello world!\|123' eval.log 2>&1; then
+ echo "PASS: eval duktape"
+else
+ echo "FAIL: eval duktape"
+fi
+rm -f eval.log out.log
+
+./evloop timer-test.js > evloop.log 2>&1
+
+if grep -i "no active timers and no sockets to poll" evloop.log 2>&1; then
+ echo "PASS: evloop duktape"
+else
+ echo "FAIL: evloop duktape"
+fi
+rm -f evloop.log