mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
New test programs.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
helloworld
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Simple Hello,World program.
|
||||
@@ -0,0 +1,15 @@
|
||||
#include "function1.h"
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
|
||||
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.
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
void function1 (const std::string& text);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
void function1 (const std::string& message);
|
||||
|
||||
int main (int argc, char** argv) {
|
||||
|
||||
int j = 0;
|
||||
|
||||
for (int i=0; i<argc; i++) {
|
||||
std::cout << "XX: " << i << " " << argv[i] << std::endl;
|
||||
}
|
||||
|
||||
std::string message = "Hello, World!";
|
||||
|
||||
j++;
|
||||
|
||||
function1(message);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
hellostar
|
||||
Reference in New Issue
Block a user