MCPcopy Create free account
hub / github.com/LanceLRQ/deer-executor / compileTestlibCodeFile

Function compileTestlibCodeFile

client/packmgr/compile.go:17–37  ·  view source on GitHub ↗

针对Testlib支持的编译方法

(source, name, binRoot, configDir, libraryDir, typeName string)

Source from the content-addressed store, hash-verified

15
16// 针对Testlib支持的编译方法
17func compileTestlibCodeFile(source, name, binRoot, configDir, libraryDir, typeName string) error {
18 fmt.Printf("build %s [%s]...", typeName, name)
19 prefix, ok := constants.TestlibBinaryPrefixs[typeName]
20 if !ok {
21 prefix = ""
22 }
23 genCodeFile := path.Join(configDir, source)
24 compileTarget := path.Join(binRoot, prefix+name)
25 _, err := os.Stat(genCodeFile)
26 if err != nil && os.IsNotExist(err) {
27 return errors.Errorf("cannot find %s's source code", typeName)
28 }
29 compiler := provider.NewGnucppCompileProvider()
30 ok, ceinfo := compiler.ManualCompile(genCodeFile, compileTarget, []string{libraryDir})
31 if ok {
32 fmt.Println("Done.")
33 } else {
34 fmt.Printf("Error.\n\n%s", ceinfo)
35 }
36 return nil
37}
38
39// 编译作业代码
40func compileWorkCodeFiles(config structs.JudgeConfiguration, libraryDir string) error {

Callers 1

compileWorkCodeFilesFunction · 0.85

Calls 3

ManualCompileMethod · 0.95
NewGnucppCompileProviderFunction · 0.92
ErrorfMethod · 0.80

Tested by

no test coverage detected