aboutsummaryrefslogtreecommitdiff
path: root/build/target
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-24 16:39:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-24 16:39:55 +0200
commit1d6e68fda762535fa8508f94ca254a79f293edb2 (patch)
tree7b97edd9f1786cd610c1f41e720d2b105dd87cbc /build/target
parentbb4f9e6498ba715911f83e0dc221a5b1b86baf51 (diff)
Add support for generated test input/output
Diffstat (limited to 'build/target')
-rw-r--r--build/target22
1 files changed, 18 insertions, 4 deletions
diff --git a/build/target b/build/target
index f5a26b4..6ee65f4 100644
--- a/build/target
+++ b/build/target
@@ -10,6 +10,7 @@
#include <vector>
#include <memory> // unique_ptr
#include <cstddef> // size_t
+#include <cstdint> // uint8_t
#include <functional> // reference_wrapper
#include <ostream>
#include <cassert>
@@ -38,19 +39,32 @@ namespace build
// Target state.
//
- enum class target_state
+ enum class target_state: std::uint8_t
{
- group, // Target's state is the group's state.
+ // The order of the enumerators is arranged so that their
+ // inegral values indicate whether one "overrides" the other
+ // in the merge operator (see below).
+ //
unknown,
- postponed,
unchanged,
changed,
- failed
+ postponed,
+ failed,
+ group // Target's state is the group's state.
};
std::ostream&
operator<< (std::ostream&, target_state);
+ inline target_state&
+ operator |= (target_state& l, target_state r)
+ {
+ if (static_cast<std::uint8_t> (r) > static_cast<std::uint8_t> (l))
+ l = r;
+
+ return l;
+ }
+
// Recipe.
//
// The returned target state should be changed, unchanged, or