FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
daScript/dastest/testing_boost.das at master · feiyunwill/daScript · GitHub
feiyunwill
/
daScript
Public
forked from
GaijinEntertainment/daScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
daScript
/
dastest
/
testing_boost.das
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (40 loc) · 1.7 KB
Breadcrumbs
daScript
/
dastest
/
testing_boost.das
Copy path
File metadata and controls
45 lines (40 loc) · 1.7 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
options
gen2
options
indenting
=
4
options
no_aot
module
testing_boost
shared
require
daslib
/
ast_boost
require
testing
public
[
macro_function
]
def
private
validate_arguments
(
type_name
:
string
,
args
) :
bool
{
let
len
=
length
(
args
)
if
(
len
==
0
) {
return
true
}
if
(
len
==
1
) {
return
(
args
[0].
_type
.
isPointer
&&
args
[0].
_type
.
firstType
.
isStructure
&&
args
[0].
_type
.
firstType
.
structType
.
name
==
type_name
&&
args
[0].
_type
.
firstType
.
structType
.
_module
!
=
null
&&
args
[0].
_type
.
firstType
.
structType
.
_module
.
name
==
"testing"
)
}
return
false
}
[
function_macro
(
name
=
"test"
)]
class
TestFunctionAnnotation
:
AstFunctionAnnotation
{
[
unused_argument
(group, args, errors)]
def
override
apply
(
var
func
:
FunctionPtr
;
var
group
:
ModuleGroup
;
args
:
AnnotationArgumentList
;
var
errors
:
das_string
) :
bool
{
if
(
!
validate_arguments
(
"T"
,
func
.
arguments
)) {
errors
:=
"Invalid arguments for test macro
\n
expected function header: def
{
func
.
name
}
() or def
{
func
.
name
}
(t: testing::T?)"
return
false
}
func
.
flags
|
=
FunctionFlags
.
exports
return
true
}
}
[
function_macro
(
name
=
"benchmark"
)]
class
BenchmarkFunctionAnnotation
:
AstFunctionAnnotation
{
[
unused_argument
(group, args, errors)]
def
override
apply
(
var
func
:
FunctionPtr
;
var
group
:
ModuleGroup
;
args
:
AnnotationArgumentList
;
var
errors
:
das_string
) :
bool
{
if
(
!
validate_arguments
(
"B"
,
func
.
arguments
)) {
errors
:=
"Invalid arguments for benchmark macro
\n
expected function header: def
{
func
.
name
}
() or def
{
func
.
name
}
(b: testing::B?)"
return
false
}
func
.
flags
|
=
FunctionFlags
.
exports
return
true
}
}
Back
|
FazBrowse Home
|
New Git URL