From Fedora Project Wiki
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.
How to test
- Compile the sample application which embeds Duktape. Here's the code for it in [gist]
- 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.
Expected Results
- 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.
Optional
- Test with different Javascript snippets, including those with functions, loops, and object manipulations, to ensure broad coverage.
- Monitor for memory leaks or stability issues when executing complex Javascript code.