From Fedora Project Wiki

(Created page with "{{QA/Test_Case |description=This test case ensures that Duktape can correctly interpret and execute embedded Javascript. |setup= # Install a fresh copy of Fedora. # Ensure `duktape` and its development files are installed, possibly using: `dnf install duktape duktape-devel`. # Prepare a sample C/C++ application that embeds Duktape and some basic Javascript code to execute. |actions= # Compile the sample application which embeds Duktape. Here's the code for it in https...")
 
No edit summary
 
Line 8: Line 8:
|actions=
|actions=
# Compile the sample application which embeds Duktape. Here's the code for it in [[https://gist.github.com/sumantro93/039ad8ad9a9aea7c3dc960196506e05e gist]]
# Compile the sample application which embeds Duktape. Here's the code for it in [[https://gist.github.com/sumantro93/039ad8ad9a9aea7c3dc960196506e05e gist]]
# Run the application.
# Complie with `gcc -o duktape_basic duktape_basic.c -lduktape -lm`
# Run the application `./duktape_sample`
# Observe the output or behavior to see if the embedded Javascript code is executed.
# Observe the output or behavior to see if the embedded Javascript code is executed.


|results=
|results=
# The application should compile without errors related to Duktape.
# The application should compile without errors related to Duktape.
`[r00t@fedora ~]$ ./duktape_sample
Hello from Duktape embedded in C!`
# The Javascript code embedded in the application should be executed correctly, producing expected outputs or behaviors.
# The Javascript code embedded in the application should be executed correctly, producing expected outputs or behaviors.



Latest revision as of 09:43, 21 August 2023

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.