![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
github.com/codeiiest/test-runner
Test-Runner is a Go module which can be used to execute programs against particular test cases and get corresponding outputs. The goal is to provide an easy module for testing programs for their correctness. This is one of the many modules required to create a completely functional backend for an "Online Judge".
go get github.com/codeiiest/test-runner
import (
"io/ioutil"
"log"
"github.com/codeiiest/test-runner/runner/run"
)
func test(code string, lang string, filename string){
in := []string{"2", "4", "5"}
out := []string{"4", "16", "25"}
timeLimit := 2 // Time in seconds
memLimit := 500*1024*1024 // Memory in bytes
res := run.Evaluate(code, lang, filename, in, out,
len(in), timeLimit, memLimit)
log.Print(res)
}
Please use the issue tracker. All contributions are more than welcome :)
The gist of this module is that it runs the code passed to it in a docker container, evaluates it by comparing the output of the sent program against the expected output.
Code is first compiled using their respective compilers here in the function Compile(), or if it is interpreted, directly Run()
The compilation takes place inside the container via a bind mounts and the executable is produced
That executable is then run with the evaluate script with parameters of time limit, memory limit, number of test cases, and finally the runner script, which depends on whether the language is compiled or interpreted (for example, directly run python scripts, but C/C++ needs compialtion)
For a thorough understanding of how to use this module, have a look at the tests created for each language.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.