diff --git a/tests/hello spaces/.gitignore b/tests/hello spaces/.gitignore new file mode 100644 index 0000000..31e0fce --- /dev/null +++ b/tests/hello spaces/.gitignore @@ -0,0 +1 @@ +helloworld diff --git a/tests/hello spaces/Makefile b/tests/hello spaces/Makefile new file mode 100644 index 0000000..28f53af --- /dev/null +++ b/tests/hello spaces/Makefile @@ -0,0 +1,21 @@ +# This is the default target, which will be built when +# you invoke make +.PHONY: all +all: helloworld + +# This rule tells make how to build helloworld from helloworld.cpp +helloworld: helloworld.cpp + g++ -g -o helloworld helloworld.cpp function1.cpp + +# This rule tells make to copy helloworld to the binaries subdirectory, +# creating it if necessary +.PHONY: install +install: + mkdir -p binaries + cp -p helloworld binaries + +# This rule tells make to delete helloworld and helloworld.o +.PHONY: clean +clean: + rm -f helloworld helloworld.o function1.o + diff --git a/tests/hello spaces/README b/tests/hello spaces/README new file mode 100644 index 0000000..809b58a --- /dev/null +++ b/tests/hello spaces/README @@ -0,0 +1 @@ +Simple Hello,World program. diff --git a/tests/hello spaces/function1.cpp b/tests/hello spaces/function1.cpp new file mode 100644 index 0000000..61db1f8 --- /dev/null +++ b/tests/hello spaces/function1.cpp @@ -0,0 +1,15 @@ +#include "function1.h" +#include +#include + +void function1 (const std::string& text) { + + int i = 42; + + sleep(2); // Simulate doing work. + + std::cout << text << i << std::endl; + + sleep(3); // Simulate doing work. +} + diff --git a/tests/hello spaces/function1.h b/tests/hello spaces/function1.h new file mode 100644 index 0000000..8f24a9b --- /dev/null +++ b/tests/hello spaces/function1.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +void function1 (const std::string& text); + diff --git a/tests/hello spaces/helloworld.cpp b/tests/hello spaces/helloworld.cpp new file mode 100644 index 0000000..cb7345f --- /dev/null +++ b/tests/hello spaces/helloworld.cpp @@ -0,0 +1,24 @@ + + +#include +#include + +void function1 (const std::string& message); + +int main (int argc, char** argv) { + + int j = 0; + + for (int i=0; i