%~ \
doxyfile.stamp
+SUBDIRS = . tests
+
bin_PROGRAMS = bin/genetic
dist_noinst_SCRIPTS = autogen.sh
#! /bin/sh
autoreconf --force --install
+automake --add-missing
\ No newline at end of file
AM_INIT_AUTOMAKE([1.10 -Wall])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([
+ Makefile
+ tests/Makefile
+ tests/gene/Makefile
+])
AC_OUTPUT
--- /dev/null
+SUBDIRS = gene
+
+clean-local:
+ rm -f *.log
\ No newline at end of file
--- /dev/null
+noinst_PROGRAMS = create.test copy.test
+
+create_test_SOURCES = create.cpp
+create_test_CPPFLAGS = -I$(top_srcdir)/src
+
+copy_test_SOURCES = copy.cpp
+copy_test_CPPFLAGS = -I$(top_srcdir)/src
+
+TESTS = \
+ create.test \
+ copy.test
+
+check-gene: create.test copy.test all
+
+clean-local:
+ rm -f *.test
\ No newline at end of file
--- /dev/null
+#include <iostream>
+
+#include "gene.h"
+
+using namespace std;
+using namespace genetic;
+
+int main() {
+ typedef Gene<int> _Gene;
+
+ _Gene gene(1);
+ _Gene gene2(20);
+
+ gene = gene2;
+
+ if (gene.get() != 20) {
+ cout << "Gene does not copied value\n";
+ }
+
+ cout << "Gene copied value from second gene\n";
+
+ return 0;
+}
+
--- /dev/null
+#include <iostream>
+
+#include "gene.h"
+
+using namespace std;
+using namespace genetic;
+
+int main() {
+ typedef Gene<int> _Gene;
+
+ _Gene gene(1);
+
+ if (gene.get() != 1) {
+ cout << "Gene does not contained initial value\n";
+ return 1;
+ }
+
+ cout << "Gene contained initial value\n";
+ return 0;
+}
+
+++ /dev/null
-#include <iostream>
-#include <cassert>
-
-#include "gene.h"
-#include "chromosome.h"
-
-using namespace std;
-using namespace genetic;
-
-int main() {
- Gene<int> gene(1);
-
- assert(gene.get() == 1);
- cout << "Gene: " << gene.get() << " should be equal to: " << 1 << endl;
-
- return 0;
-}
-