From Fedora Project Wiki

Revision as of 09:43, 21 August 2023 by Sumantrom (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

This test case ensures that Duktape can correctly interpret and execute embedded Javascript.

Setup

  1. Install a fresh copy of Fedora.
  2. Ensure duktape and its development files are installed, possibly using: dnf install duktape duktape-devel.
  3. Prepare a sample C/C++ application that embeds Duktape and some basic Javascript code to execute.

How to test

  1. Compile the sample application which embeds Duktape. Here's the code for it in [gist]
  2. Complie with gcc -o duktape_basic duktape_basic.c -lduktape -lm
  3. Run the application ./duktape_sample
  4. Observe the output or behavior to see if the embedded Javascript code is executed.

Expected Results

  1. The application should compile without errors related to Duktape.

[r00t@fedora ~]$ ./duktape_sample Hello from Duktape embedded in C!

  1. The Javascript code embedded in the application should be executed correctly, producing expected outputs or behaviors.

Optional

  1. Test with different Javascript snippets, including those with functions, loops, and object manipulations, to ensure broad coverage.
  2. Monitor for memory leaks or stability issues when executing complex Javascript code.