Documentation ¶
Index ¶
- Constants
- Variables
- func AutoCompile(ctx context.Context, fs afero.Fs, s sandbox.Sandbox, workDir, src, dst string) error
- func ExtractHeaderNames(fs afero.Fs, dir string, src []byte) []string
- type Cpp
- func (c Cpp) Compile(ctx context.Context, s sandbox.Sandbox, f sandbox.File, stderr io.Writer, ...) (*sandbox.File, error)
- func (c Cpp) DefaultFilename() string
- func (c Cpp) DisplayName() string
- func (c Cpp) ID() string
- func (Cpp) Run(ctx context.Context, s sandbox.Sandbox, binary sandbox.File, stdin io.Reader, ...) (*sandbox.Status, error)
- func (c Cpp) Test(t *testing.T, s sandbox.Sandbox) error
- type Option
Constants ¶
View Source
const ( TestCodeAplusb = `#include<iostream> using namespace std; int main() { int a,b; cin>>a>>b; cout<<a+b<<"\n"; }` TestCodeCompileError = `#include<lol> lmao; int main(a,b,c); ` TestCodeHelloWorld = `#include<iostream> using namespace std; int main() { cout<<"Hello world"; return 0; }` TestCodeTimeLimit = `#include<iostream> using namespace std; int main() { int n=0; while(1) n++; }` TestCodeRuntimeError = `` /* 130-byte string literal not displayed */ TestCodeRuntimeErrorDiv0 = `#include<iostream> using namespace std; int main() { cerr<<(1/0); }` TestCodeLongSleep = `#include<unistd.h> int main() { sleep(20); } ` TestCodeShortSleep = `#include<unistd.h> int main() { usleep(100); } ` )
Variables ¶
View Source
var DefaultCompileArgs = []string{"-O2", "-static", "-DONLINE_JUDGE"}
View Source
var Std11 = New("cpp11", "C++ 11", WithCompileArgs(append(DefaultCompileArgs, "-std=c++11")))
View Source
var Std14 = New("cpp14", "C++ 14", WithCompileArgs(append(DefaultCompileArgs, "-std=c++14")))
View Source
var Std17 = New("cpp17", "C++ 17", WithCompileArgs(append(DefaultCompileArgs, "-std=c++17")))
Functions ¶
func AutoCompile ¶
Types ¶
type Cpp ¶
type Cpp struct {
// contains filtered or unexported fields
}
func (Cpp) DefaultFilename ¶ added in v0.4.0
func (Cpp) DisplayName ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.