Skip to content

Commit

Permalink
Update go-functions-methods lap
Browse files Browse the repository at this point in the history
Signed-off-by: Obed N Munoz <[email protected]>
  • Loading branch information
obedmr committed Sep 15, 2020
1 parent 936b7f0 commit 352efaf
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions labs/go-functions-methods/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

include ../../common.mk
-include lab.mk
13 changes: 13 additions & 0 deletions labs/go-functions-methods/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ General instructions
3. Use the `geometry.go` file for your code.
4. Have fun and don't forget the next [section](#how-to-submit-your-work).

Test Suite
----------
Build and Test automation is already implemented with the following command. Below some general tips and comments.

- Make sure that your program passes all test cases without errors.
- Remember that this is being executed by a robot script.
- You cannot edit the `lab.mk` file.
- Failed compilation or segmentation faults means 0-graded.
- Failed tests will be properly discounted from total grade.

```
make test
```

How to submit your work
=======================
Expand Down
Binary file added labs/go-functions-methods/geometry
Binary file not shown.
5 changes: 4 additions & 1 deletion labs/go-functions-methods/geometry.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// Package geometry defines simple types for plane geometry.
//!+point
package geometry
package main

import "math"

Expand Down Expand Up @@ -39,4 +39,7 @@ func (path Path) Distance() float64 {
return sum
}

func main() {
}

//!-path
17 changes: 17 additions & 0 deletions labs/go-functions-methods/lab.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# build & test automation

build:
go build geometry.go

test: build
@echo Test 1 - 2 sides - failed test
./geometry
@echo Test 2 - 4 sides
./geometry 4
@echo Test 3 - 8 sides
./geometry 8
@echo Test 3 - 12 sides
./geometry 12

clean:
rm -rf geometry

0 comments on commit 352efaf

Please sign in to comment.