mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-14 16:37:56 -05:00
Co-authored-by: colinlyguo <102356659+colinlyguo@users.noreply.github.com> Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
23 lines
431 B
Go
23 lines
431 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/docker/docker/pkg/reexec"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
// RegisterSimulation register initializer function for integration-test.
|
|
func RegisterSimulation(app *cli.App, name string) {
|
|
// Run the app for integration-test
|
|
reexec.Register(name, func() {
|
|
if err := app.Run(os.Args); err != nil {
|
|
fmt.Fprintln(os.Stderr, err)
|
|
os.Exit(1)
|
|
}
|
|
os.Exit(0)
|
|
})
|
|
reexec.Init()
|
|
}
|