Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
package_identity.cc
Go to the documentation of this file.
1/*
2 Aleph_w
3
4 Data structures & Algorithms
5 version 2.0.0b
6 https://github.com/lrleon/Aleph-w
7
8 This file is part of Aleph-w library
9
10 Copyright (c) 2002-2026 Leandro Rabindranath Leon
11*/
12
22#include <cstdlib>
23#include <cstring>
24#include <iostream>
25
26#include <aleph-version.H>
27
28static_assert(ALEPH_VERSION_MAJOR == EXPECT_VERSION_MAJOR);
29static_assert(ALEPH_VERSION_MINOR == EXPECT_VERSION_MINOR);
30static_assert(ALEPH_VERSION_PATCH == EXPECT_VERSION_PATCH);
31static_assert(ALEPH_VERSION_NUMBER
32 == EXPECT_VERSION_MAJOR * 1000000 + EXPECT_VERSION_MINOR * 1000 + EXPECT_VERSION_PATCH);
33static_assert(ALEPH_BUILT_WITH_SANITIZERS == EXPECT_SANITIZERS);
34static_assert(ALEPH_BUILT_WITH_CONTAINER_ANNOTATIONS == EXPECT_CONTAINER_ANNOTATIONS);
35
36static_assert(Aleph::Build_Info::version_major == ALEPH_VERSION_MAJOR);
37static_assert(Aleph::Build_Info::version_minor == ALEPH_VERSION_MINOR);
38static_assert(Aleph::Build_Info::version_patch == ALEPH_VERSION_PATCH);
39static_assert(Aleph::Build_Info::sanitizers == (EXPECT_SANITIZERS != 0));
40static_assert(Aleph::Build_Info::container_annotations == (EXPECT_CONTAINER_ANNOTATIONS != 0));
41
42// The usage requirements of Aleph::Aleph carry the configuration of the
43// package into this translation unit.
44#if EXPECT_CONTAINER_ANNOTATIONS
45# ifndef ALEPH_ANNOTATE_CONTAINERS
46# error "Aleph::Aleph did not define ALEPH_ANNOTATE_CONTAINERS"
47# endif
48#endif
49
50int main()
51{
52 int failures = 0;
53
54 if (std::strcmp(Aleph::Build_Info::version, EXPECT_VERSION) != 0)
55 {
56 std::cerr << "release number: the header says " << Aleph::Build_Info::version
57 << ", the package says " << EXPECT_VERSION << '\n';
58 ++failures;
59 }
60
61 if (std::strcmp(Aleph::Build_Info::source_revision, EXPECT_SOURCE_REVISION) != 0)
62 {
63 std::cerr << "source revision: the header says " << Aleph::Build_Info::source_revision
64 << ", the package says " << EXPECT_SOURCE_REVISION << '\n';
65 ++failures;
66 }
67
68 if (std::strcmp(Aleph::Build_Info::source_revision, ALEPH_SOURCE_REVISION) != 0
69 or std::strlen(Aleph::Build_Info::source_revision) == 0)
70 {
71 std::cerr << "source revision: empty or different from ALEPH_SOURCE_REVISION\n";
72 ++failures;
73 }
74
75 std::cout << "Aleph-w " << Aleph::Build_Info::version
76 << ", revision " << Aleph::Build_Info::source_revision
77 << ", sanitizers " << Aleph::Build_Info::sanitizers
78 << ", container annotations " << Aleph::Build_Info::container_annotations << '\n';
79
80 return failures == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
81}
int main()