Skip to content

Commit

Permalink
test: fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel committed Oct 7, 2024
1 parent e26bbdf commit 40622b0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions field/generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ import (
// integration test will create modulus for various field sizes and run tests

const rootDir = "integration_test"
const asmDir = "../asm"

func TestIntegration(t *testing.T) {
assert := require.New(t)
asmDir := filepath.Join("..", "asm")
asmDirIncludePath := filepath.Join("..", "..", "..", "asm")

os.RemoveAll(rootDir)
err := os.MkdirAll(rootDir, 0700)
Expand Down Expand Up @@ -89,7 +90,7 @@ func TestIntegration(t *testing.T) {
childDir := filepath.Join(rootDir, elementName)
fIntegration, err = field.NewFieldConfig("integration", elementName, modulus, false)
assert.NoError(err)
assert.NoError(GenerateFF(fIntegration, childDir, asmDir, "../../../asm"))
assert.NoError(GenerateFF(fIntegration, childDir, asmDir, asmDirIncludePath))
}

// run go test
Expand Down
2 changes: 1 addition & 1 deletion field/goff/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func cmdGenerate(cmd *cobra.Command, args []string) {
os.Exit(-1)
}

if err := generator.GenerateFF(F, fOutputDir, asmDir, "asm/"); err != nil {
if err := generator.GenerateFF(F, fOutputDir, asmDir, "asm"); err != nil {
fmt.Printf("\n%s\n", err.Error())
os.Exit(-1)
}
Expand Down
2 changes: 1 addition & 1 deletion field/goldilocks/internal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
if err != nil {
panic(err)
}
if err := generator.GenerateFF(goldilocks, "../", "", ""); err != nil {
if err := generator.GenerateFF(goldilocks, "..", "", ""); err != nil {
panic(err)
}
fmt.Println("successfully generated goldilocks field")
Expand Down
4 changes: 2 additions & 2 deletions internal/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ import (
const (
copyrightHolder = "Consensys Software Inc."
copyrightYear = 2020
baseDir = "../../"
)

var bgen = bavard.NewBatchGenerator(copyrightHolder, copyrightYear, "consensys/gnark-crypto")

//go:generate go run main.go
func main() {

baseDir := filepath.Join("..", "..")
// first we loop through the field arithmetic we must generate.
// then, we create the common files (only once) for the assembly code.
asmDirBuildPath := filepath.Join(baseDir, "field", "asm")
asmDirIncludePath := filepath.Join("../../../", "field", "asm")
asmDirIncludePath := filepath.Join(baseDir, "..", "field", "asm")

// generate common assembly files depending on field number of words
mCommon := make(map[int]bool)
Expand Down

0 comments on commit 40622b0

Please sign in to comment.