Skip to content

Commit

Permalink
Reorganize some sources
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Young <[email protected]>
  • Loading branch information
rwy7 committed May 3, 2018
1 parent b645387 commit 5529440
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 59 deletions.
8 changes: 4 additions & 4 deletions b9/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
add_library(b9 SHARED
src/assemble.cpp
src/Compiler.cpp
src/deserialize.cpp
src/ExecutionContext.cpp
src/MethodBuilder.cpp
src/core.cpp
src/Compiler.cpp
src/primitives.cpp
src/serialize.cpp
src/deserialize.cpp
src/assemble.cpp
src/VirtualMachine.cpp
)

target_include_directories(b9
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion b9/include/b9/VirtualMachine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <b9/OperandStack.hpp>
#include <b9/compiler/Compiler.hpp>
#include <b9/instructions.hpp>
#include <b9/module.hpp>
#include <b9/Module.hpp>

#include <OMR/Om/Allocator.inl.hpp>
#include <OMR/Om/Context.inl.hpp>
Expand Down
2 changes: 1 addition & 1 deletion b9/include/b9/deserialize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define B9_DESERIALIZE_HPP_

#include <b9/instructions.hpp>
#include <b9/module.hpp>
#include <b9/Module.hpp>

#include <string.h>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion b9/include/b9/serialize.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef B9_SERIALIZE_HPP_
#define B9_SERIALIZE_HPP_

#include <b9/module.hpp>
#include <b9/Module.hpp>
#include <fstream>
#include <iostream>

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion b9/src/deserialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <b9/deserialize.hpp>
#include <b9/instructions.hpp>
#include <b9/module.hpp>
#include <b9/Module.hpp>

namespace b9 {

Expand Down
2 changes: 1 addition & 1 deletion b9/src/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <vector>

#include <b9/instructions.hpp>
#include <b9/module.hpp>
#include <b9/Module.hpp>
#include <b9/serialize.hpp>

namespace b9 {
Expand Down
17 changes: 0 additions & 17 deletions b9asm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,3 @@ target_link_libraries(b9asm
PUBLIC
b9
)

add_executable(b9asmTest
testAsm.cpp
)

target_link_libraries(b9asmTest
PUBLIC
b9
gtest_main
)

add_test(
NAME run_asmTest
COMMAND b9asmTest
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

2 changes: 1 addition & 1 deletion b9asm/b9asm.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <iostream>

#include <b9/assemble.hpp>
#include <b9/module.hpp>
#include <b9/Module.hpp>

using namespace b9;

Expand Down
31 changes: 1 addition & 30 deletions b9disasm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,8 @@
add_executable (b9disasm
b9disasm.cpp
b9disasm.cpp
)

target_link_libraries(b9disasm
PUBLIC
b9
)

add_executable(b9serializeTest
testDisasm.cpp
)

target_link_libraries(b9serializeTest
PUBLIC
b9
gtest_main
)

add_test(
NAME run_b9serializeTest
COMMAND b9serializeTest
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

function(b9disasm_test module)
add_test(
NAME disasm_${module}
COMMAND b9disasm ${CMAKE_CURRENT_SOURCE_DIR}/${module}
)
endfunction()

# This test material is missing from the repository
#b9disasm_test(empty.mod)
#b9disasm_test(simple.mod)
#b9disasm_test(corrupt.mod)
#b9disasm_test(complex.mod)
2 changes: 1 addition & 1 deletion b9disasm/b9disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <fstream>

#include <b9/deserialize.hpp>
#include <b9/module.hpp>
#include <b9/Module.hpp>

using namespace b9;

Expand Down
50 changes: 50 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,53 @@ add_test(
NAME run_b9test
COMMAND env B9_TEST_MODULE=interpreter_test.b9mod $<TARGET_FILE:b9test>
)

# b9 asm test

add_executable(b9asmTest
testAsm.cpp
)

target_link_libraries(b9asmTest
PUBLIC
b9
gtest_main
)

add_test(
NAME run_asmTest
COMMAND b9asmTest
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

# b9 disasm test

add_executable(b9serializeTest
testDisasm.cpp
)

target_link_libraries(b9serializeTest
PUBLIC
b9
gtest_main
)

add_test(
NAME run_b9serializeTest
COMMAND b9serializeTest
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

function(b9disasm_test module)
add_test(
NAME disasm_${module}
COMMAND b9disasm ${CMAKE_CURRENT_SOURCE_DIR}/${module}
)
endfunction()

# This test material is missing from the repository

#b9disasm_test(empty.mod)
#b9disasm_test(simple.mod)
#b9disasm_test(corrupt.mod)
#b9disasm_test(complex.mod)
File renamed without changes.
2 changes: 1 addition & 1 deletion b9disasm/testDisasm.cpp → test/testDisasm.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <b9/ExecutionContext.hpp>
#include <b9/VirtualMachine.hpp>
#include <b9/deserialize.hpp>
#include <b9/module.hpp>
#include <b9/Module.hpp>
#include <b9/serialize.hpp>

#include <gtest/gtest.h>
Expand Down

0 comments on commit 5529440

Please sign in to comment.