summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-08-06 11:02:06 -0300
committerEuAndreh <eu@euandre.org>2024-08-06 11:02:06 -0300
commit5103d37c1e1ea7fe89a03756b2813467228a6aa7 (patch)
treec1e118c52eb82c98650b8ee5a7dbe286bf8cef71
parenttests/gobang.go: Add tests for Random(), Salt() and Hash() (diff)
downloadgobang-5103d37c1e1ea7fe89a03756b2813467228a6aa7.tar.gz
gobang-5103d37c1e1ea7fe89a03756b2813467228a6aa7.tar.xz
Run in parallel slow tests
-rw-r--r--Makefile7
-rw-r--r--tests/gobang.go34
2 files changed, 38 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index fe6fe71..4b6c643 100644
--- a/Makefile
+++ b/Makefile
@@ -70,11 +70,14 @@ $(objects): Makefile
tests.bin-check = \
- tests/$(NAME)_main.bin-check \
+ tests/$(NAME)_main.bin/1 \
+ tests/$(NAME)_main.bin/2 \
+ tests/$(NAME)_main.bin/3 \
+ tests/$(NAME)_main.bin/4 \
$(tests.bin-check): tests/$(NAME)_main.bin
$(tests.bin-check):
- $(EXEC)$*.bin
+ $(EXEC)$(@D) $(@F)
check-unit: $(tests.bin-check)
diff --git a/tests/gobang.go b/tests/gobang.go
index 324a155..f071f53 100644
--- a/tests/gobang.go
+++ b/tests/gobang.go
@@ -514,10 +514,19 @@ func TestSetLoggerOutput() {
// fmt.Println(e)
}
-func MainTest() {
+func t1() {
test__PBKDF()
+}
+
+func t2() {
test_scrypt()
+}
+
+func t3() {
test_Hash()
+}
+
+func t4() {
test_Random()
test_Salt()
test_newUUIDFrom()
@@ -525,3 +534,26 @@ func MainTest() {
test_UUIDString()
test_ParseUUID()
}
+
+func MainTest() {
+ arg := ""
+ if len(os.Args) > 1 {
+ arg = os.Args[1]
+ }
+
+ switch arg {
+ case "1":
+ t1()
+ case "2":
+ t2()
+ case "3":
+ t3()
+ case "4":
+ t4()
+ default:
+ t1()
+ t2()
+ t3()
+ t4()
+ }
+}