Added testing
Preparing profiles and dependencies, but added testing to separate them from regular targets and avoid the need for a 'testing' profile which could negatively impact configuration size and readability.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
name: testing
|
||||
gpid: examples
|
||||
semv: 1.0.0
|
||||
|
||||
tests:
|
||||
- name: factorial_test
|
||||
type: program
|
||||
srcs:
|
||||
- ./entry.cpp
|
||||
@@ -0,0 +1,13 @@
|
||||
int factorial(int start) {
|
||||
if (start < 0)
|
||||
return 0;
|
||||
|
||||
auto result = 1;
|
||||
for (auto index = 2; index < start; index++)
|
||||
result *= index;
|
||||
return result;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return factorial(5) == 120;
|
||||
}
|
||||
Reference in New Issue
Block a user