Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rpn_calculator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anna Gillert
rpn_calculator
Commits
ad0ef9ac
Commit
ad0ef9ac
authored
6 years ago
by
Sebastian Staffa
Browse files
Options
Downloads
Patches
Plain Diff
Add test infrastructure
parent
faf1d371
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
Makefile
+6
-0
6 additions, 0 deletions
Makefile
main.h
+12
-0
12 additions, 0 deletions
main.h
src/main.cpp
+1
-0
1 addition, 0 deletions
src/main.cpp
test/main.test.cpp
+10
-0
10 additions, 0 deletions
test/main.test.cpp
with
30 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
ad0ef9ac
...
...
@@ -2,3 +2,4 @@ test/out/
fuzz_main
main
result
tests
This diff is collapsed.
Click to expand it.
Makefile
+
6
−
0
View file @
ad0ef9ac
...
...
@@ -17,3 +17,9 @@ fuzz: fuzz_main
clean
:
rm
-rf
bin
test
/out
rm
-rf
main fuzz_main out
tests
:
test/main.test.cpp
mkdir
-p
bin
$(
CXX
)
$(
CXXFLAGS
)
-o
bin/tests
test
/main.test.cpp
This diff is collapsed.
Click to expand it.
main.h
0 → 100644
+
12
−
0
View file @
ad0ef9ac
#ifndef __MAIN__GUARD__
#define __MAIN__GUARD__
int
add
(
int
a
,
int
b
);
int
subtract
(
int
a
,
int
b
);
int
multiply
(
int
a
,
int
b
);
int
divide
(
int
a
,
int
b
);
int
evaluate
(
const
std
::
string
&
s
);
#endif
This diff is collapsed.
Click to expand it.
src/main.cpp
+
1
−
0
View file @
ad0ef9ac
...
...
@@ -5,6 +5,7 @@
#include
<climits>
#include
<unordered_map>
#include
<iterator>
#include
"main.h"
/*
* Adds two integers
...
...
This diff is collapsed.
Click to expand it.
test/main.test.cpp
0 → 100644
+
10
−
0
View file @
ad0ef9ac
#define CATCH_CONFIG_MAIN
#include
<catch2/catch.hpp>
#include
"./../main.h"
TEST_CASE
(
"Trivial test"
,
"[trivial]"
)
{
REQUIRE
(
true
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment